public WelcomePageFeedItem() { var actionHandler = new ActionDelegate(this); actionHandler.PerformPress += PerformPress; Accessible.Description = "A news item that opens the full story in a browser when clicked"; Accessible.Role = Atk.Role.Link; VisibleWindow = false; box = new VBox(); box.Accessible.SetShouldIgnore(true); titleLabel = new Label() { Xalign = 0 }; titleLabel.Accessible.SetShouldIgnore(true); titleLabel.Wrap = false; titleLabel.Ellipsize = Pango.EllipsizeMode.End; titleLabel.LineWrapMode = Pango.WrapMode.Word; box.PackStart(titleLabel, false, false, 0); subtitleLabel = new Label() { Xalign = 0 }; subtitleLabel.Accessible.SetShouldIgnore(true); var align = new Gtk.Alignment(0, 0, 1f, 1f) { TopPadding = Styles.WelcomeScreen.Pad.MediumTitleMarginBottom, BottomPadding = Styles.WelcomeScreen.Pad.SummaryParagraphMarginTop }; align.Add(subtitleLabel); align.Accessible.SetShouldIgnore(true); box.PackStart(align, false, false, 0); summaryLabel = new Label() { Xalign = 0 }; summaryLabel.Accessible.SetShouldIgnore(true); summaryLabel.Wrap = true; box.PackStart(summaryLabel, true, true, 0); Pango.AttrRise rise = new Pango.AttrRise(Pango.Units.FromPixels(7)); summaryLabel.Attributes = new Pango.AttrList(); summaryLabel.Attributes.Insert(rise); Add(box); Gui.Styles.Changed += UpdateStyle; }
public WelcomePageFeedItem() { VisibleWindow = false; box = new VBox(); titleLabel = new Label() { Xalign = 0 }; titleLabel.Wrap = false; titleLabel.Ellipsize = Pango.EllipsizeMode.End; titleLabel.LineWrapMode = Pango.WrapMode.Word; box.PackStart(titleLabel, false, false, 0); subtitleLabel = new Label() { Xalign = 0 }; var align = new Gtk.Alignment(0, 0, 1f, 1f) { TopPadding = Styles.WelcomeScreen.Pad.MediumTitleMarginBottom, BottomPadding = Styles.WelcomeScreen.Pad.SummaryParagraphMarginTop }; align.Add(subtitleLabel); box.PackStart(align, false, false, 0); summaryLabel = new Label() { Xalign = 0 }; summaryLabel.Wrap = true; box.PackStart(summaryLabel, true, true, 0); Pango.AttrRise rise = new Pango.AttrRise(Pango.Units.FromPixels(7)); summaryLabel.Attributes = new Pango.AttrList(); summaryLabel.Attributes.Insert(rise); Add(box); Gui.Styles.Changed += UpdateStyle; }
Pango.Layout TextLayout(Pango.Context context) { var layout = new Pango.Layout(context); layout.FontDescription = Pango.FontDescription.FromString(Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows); layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels(15); layout.Width = Pango.Units.FromPixels(420); layout.Wrap = Pango.WrapMode.Word; Pango.AttrRise rise = new Pango.AttrRise(Pango.Units.FromPixels(7)); layout.Attributes = new Pango.AttrList(); layout.Attributes.Insert(rise); string description = BrandingService.GetString("FirstRunDescription"); if (description != null) { description = description.Replace("\\n", "\n"); } layout.SetText(description ?? "No Text Set"); return(layout); }
Pango.Layout TextLayout (Pango.Context context) { var layout = new Pango.Layout (context); layout.FontDescription = Pango.FontDescription.FromString (Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows); layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (15); layout.Width = Pango.Units.FromPixels (420); layout.Wrap = Pango.WrapMode.Word; Pango.AttrRise rise = new Pango.AttrRise (Pango.Units.FromPixels (7)); layout.Attributes = new Pango.AttrList (); layout.Attributes.Insert (rise); string description = BrandingService.GetString ("FirstRunDescription"); if (description != null) description = description.Replace ("\\n", "\n"); layout.SetText (description ?? "No Text Set"); return layout; }
public WelcomePageFeedItem () { VisibleWindow = false; box = new VBox (); titleLabel = new Label () { Xalign = 0 }; titleLabel.Wrap = false; titleLabel.Ellipsize = Pango.EllipsizeMode.End; titleLabel.LineWrapMode = Pango.WrapMode.Word; box.PackStart (titleLabel, false, false, 0); subtitleLabel = new Label () { Xalign = 0 }; var align = new Gtk.Alignment (0, 0, 1f, 1f) { TopPadding = Styles.WelcomeScreen.Pad.MediumTitleMarginBottom, BottomPadding = Styles.WelcomeScreen.Pad.SummaryParagraphMarginTop }; align.Add (subtitleLabel); box.PackStart (align, false, false, 0); summaryLabel = new Label () { Xalign = 0 }; summaryLabel.Wrap = true; box.PackStart (summaryLabel, true, true, 0); Pango.AttrRise rise = new Pango.AttrRise (Pango.Units.FromPixels (7)); summaryLabel.Attributes = new Pango.AttrList (); summaryLabel.Attributes.Insert (rise); Add (box); }