static WelcomePageBranding() { try { using (var stream = BrandingService.GetStream("WelcomePageContent.xml")) { Content = XDocument.Load(stream); } } catch (Exception ex) { LoggingService.LogError("Error while reading welcome page contents.", ex); using (var stream = typeof(WelcomePageBranding).Assembly.GetManifestResourceStream("WelcomePageContent.xml")) { Content = XDocument.Load(stream); } } try { HeaderTextSize = BrandingService.GetString("WelcomePage", "HeaderTextSize") ?? HeaderTextSize; HeaderTextColor = BrandingService.GetString("WelcomePage", "HeaderTextColor") ?? HeaderTextColor; BackgroundColor = BrandingService.GetString("WelcomePage", "BackgroundColor") ?? BackgroundColor; TextColor = BrandingService.GetString("WelcomePage", "TextColor") ?? TextColor; TextSize = BrandingService.GetString("WelcomePage", "TextSize") ?? TextSize; LinkColor = BrandingService.GetString("WelcomePage", "LinkColor") ?? LinkColor; Spacing = BrandingService.GetInt("WelcomePage", "Spacing") ?? Spacing; LogoHeight = BrandingService.GetInt("WelcomePage", "LogoHeight") ?? LogoHeight; } catch (Exception e) { LoggingService.LogError("Error while reading welcome page branding.", e); } }
//this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar. public SplashScreenForm() : base(Gtk.WindowType.Popup) { AppPaintable = true; this.Decorated = false; this.WindowPosition = WindowPosition.Center; this.TypeHint = Gdk.WindowTypeHint.Splashscreen; this.showVersionInfo = BrandingService.GetBool("SplashScreen", "ShowVersionInfo") ?? true; try { using (var stream = BrandingService.GetStream("SplashScreen.png", true)) bitmap = new Gdk.Pixbuf(stream); } catch (Exception e) { LoggingService.LogError("Can't load splash screen pixbuf 'SplashScreen.png'.", e); } progress = new ProgressBar(); progress.Fraction = 0.00; progress.HeightRequest = 6; vbox = new VBox(); vbox.BorderWidth = 12; label = new Gtk.Label(); label.UseMarkup = true; label.Xalign = 0; vbox.PackEnd(progress, false, true, 0); vbox.PackEnd(label, false, true, 3); this.Add(vbox); if (bitmap != null) { this.Resize(bitmap.Width, bitmap.Height); } }
void LoadBranding() { try { var textColStr = BrandingService.GetString("AboutBox", "TextColor"); if (textColStr != null) { Gdk.Color.Parse(textColStr, ref textColor); } var bgColStr = BrandingService.GetString("AboutBox", "BackgroundColor"); if (bgColStr != null) { Gdk.Color.Parse(bgColStr, ref bgColor); } //branders may provide either fg image or bg image, or both using (var stream = BrandingService.GetStream("AboutImage.png", false)) { image = (stream != null ? new Gdk.Pixbuf(stream) : null); } using (var streamBg = BrandingService.GetStream("AboutImageBg.png", false)) { imageBg = (streamBg != null ? new Gdk.Pixbuf(streamBg) : null); } //if branding did not provide any image, use the built-in one if (imageBg == null && image == null) { image = Gdk.Pixbuf.LoadFromResource("AboutImage.png"); } } catch (Exception ex) { LoggingService.LogError("Error loading about box branding", ex); } }
//this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar. public SplashScreenForm() : base(WindowType.Popup) { AppPaintable = true; this.Decorated = false; this.WindowPosition = WindowPosition.Center; this.TypeHint = Gdk.WindowTypeHint.Splashscreen; this.showVersionInfo = BrandingService.GetBool("SplashScreen", "ShowVersionInfo") ?? true; using (var stream = BrandingService.GetStream("SplashScreen.png", true)) bitmap = new Gdk.Pixbuf(stream); this.Resize(bitmap.Width, bitmap.Height); }
public ScrollBox() { LoadBranding(); this.Realized += new EventHandler(OnRealized); this.ModifyBg(Gtk.StateType.Normal, bgColor); this.ModifyText(Gtk.StateType.Normal, textColor); using (var stream = BrandingService.GetStream("AboutImage.png")) image = new Gdk.Pixbuf(stream); monoPowered = new Gdk.Pixbuf(GetType().Assembly, "mono-powered.png"); this.SetSizeRequest(450, image.Height - 1); TimerHandle = GLib.Timeout.Add(50, new TimeoutHandler(ScrollDown)); }
public AboutMonoDevelopTabPage() { BorderWidth = 0; aboutPictureScrollBox = new ScrollBox(); PackStart(aboutPictureScrollBox, false, false, 0); using (var stream = BrandingService.GetStream("AboutImageSep.png")) imageSep = new Pixbuf(stream); PackStart(new Gtk.Image(imageSep), false, false, 0); var label = new Label(); label.Markup = string.Format( "<b>{0}</b>\n {1}", GettextCatalog.GetString("Version"), BuildVariables.PackageVersion == BuildVariables.PackageVersionLabel ? BuildVariables.PackageVersionLabel : String.Format("{0} ({1})", BuildVariables.PackageVersionLabel, BuildVariables.PackageVersion)); var hBoxVersion = new HBox(); hBoxVersion.PackStart(label, false, false, 5); this.PackStart(hBoxVersion, false, true, 0); label = null; label = new Label(); label.Markup = GettextCatalog.GetString("<b>License</b>\n {0}", GettextCatalog.GetString("Released under the GNU Lesser General Public License.")); var hBoxLicense = new HBox(); hBoxLicense.PackStart(label, false, false, 5); this.PackStart(hBoxLicense, false, true, 5); label = null; label = new Label(); label.Markup = GettextCatalog.GetString("<b>Copyright</b>\n (c) 2004-{0} by MonoDevelop contributors", DateTime.Now.Year); var hBoxCopyright = new HBox(); hBoxCopyright.PackStart(label, false, false, 5); this.PackStart(hBoxCopyright, false, true, 5); this.ShowAll(); }
public static Gdk.Pixbuf GetTopBorderImage() { using (var stream = BrandingService.GetStream("WelcomePage_TopBorderRepeat.png", true)) return(new Gdk.Pixbuf(stream)); }
public static Gdk.Pixbuf GetLogoImage() { using (var stream = BrandingService.GetStream("WelcomePage_Logo.png", true)) return(new Gdk.Pixbuf(stream)); }
public AboutMonoDevelopTabPage() { BorderWidth = 0; using (var stream = BrandingService.GetStream("AboutImage.png", true)) imageSep = new Pixbuf(stream); PackStart(new Gtk.Image(imageSep), false, false, 0); Xwt.VBox infoBox = new Xwt.VBox(); infoBox.Spacing = 6; infoBox.Margin = 12; PackStart(infoBox.ToGtkWidget(), false, false, 0); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Version"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart(new Xwt.Label() { Text = IdeVersionInfo.MonoDevelopVersion, MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("License"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Released under the GNU Lesser General Public License."), MarginLeft = 12 }); infoBox.PackStart(new Xwt.Label() { Text = GettextCatalog.GetString("Copyright"), Font = infoBox.Font.WithWeight(Xwt.Drawing.FontWeight.Bold) }); var cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("© 2011-2012 ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Xamarin Inc."), Uri = new Uri("http://www.xamarin.com") }); infoBox.PackStart(cbox); infoBox.PackStart(new Xwt.Label() { Text = "© 2004-2012 MonoDevelop contributors", MarginLeft = 12 }); cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("Some icons by ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Yusuke Kamiyamane"), Uri = new Uri("http://p.yusukekamiyamane.com") }); infoBox.PackStart(cbox); cbox = new Xwt.HBox() { Spacing = 0, MarginLeft = 12 }; cbox.PackStart(new Xwt.Label("Some icons from the ")); cbox.PackStart(new Xwt.LinkLabel() { Text = string.Format("Silk icon set"), Uri = new Uri("http://www.famfamfam.com/") }); infoBox.PackStart(cbox); this.ShowAll(); }