diff options
author | Vaclav Vancura <vaclav@vancura.org> | 2016-01-15 23:05:37 +0300 |
---|---|---|
committer | Vaclav Vancura <vaclav@vancura.org> | 2016-01-15 23:05:57 +0300 |
commit | 3fce8122bdf2ab0009d645f256ae692fc8e1666d (patch) | |
tree | a0971e71b19828bf3189605b7930a29b1e61dc30 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage | |
parent | 3fd376271552fd353610729a766bfb6f3a50ace9 (diff) |
[WelcomePage] Unifying fonts: Getting rid of aging Calibri, Tahoma and Lucida Grande in favor of system fonts
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage')
6 files changed, 18 insertions, 46 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs index f8b86440f2..ae2cf9eaf5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs @@ -6,8 +6,6 @@ namespace MonoDevelop.Ide.WelcomePage { public static class WelcomeScreen { - public const string FontFamilyMac = "Lucida Grande"; - public const string FontFamilyWindows = "Calibri"; // TODO: VV: "Segoe UI" public const int VerticalPadding = 24; public const int HorizontalPadding = 50; public static string BackgroundColor { get; internal set; } @@ -29,8 +27,6 @@ namespace MonoDevelop.Ide.WelcomePage public static class Pad { - public const string TitleFontFamilyMac = "Lucida Grande"; - public const string TitleFontFamilyWindows = "Calibri"; // TODO: VV: "Segoe UI" public const int Padding = 20; public static string BackgroundColor { get; internal set; } public static string BorderColor { get; internal set; } @@ -48,7 +44,6 @@ namespace MonoDevelop.Ide.WelcomePage public static string SmallTitleColor { get; internal set; } public const int SmallTitleFontSize = 13; public const int SummaryFontSize = 12; - public const string SummaryFontFamily = "Arial"; // TODO: VV: "Segoe UI" public const int SummaryLineHeight = 19; public const int SummaryParagraphMarginTop = 8; @@ -142,9 +137,9 @@ namespace MonoDevelop.Ide.WelcomePage } } - public static string GetFormatString (string fontFace, int fontSize, string color, Pango.Weight weight = Pango.Weight.Normal) + public static string GetFormatString (int fontSize, string color, Pango.Weight weight = Pango.Weight.Normal) { - return "<span font=\"" + fontFace + " " + fontSize + "px\" foreground=\"" + color + "\" font_weight=\"" + weight + "\">{0}</span>"; + return "<span font=\"Sans " + fontSize + "px\" foreground=\"" + color + "\" font_weight=\"" + weight + "\">{0}</span>"; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs index a2a4e777ae..9beb19667d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs @@ -42,7 +42,6 @@ namespace MonoDevelop.Ide.WelcomePage string actionLink; private static Gdk.Cursor hand_cursor = new Gdk.Cursor(Gdk.CursorType.Hand1); - public string FontFamily { get; set; } public string HoverColor { get; set; } public string Color { get; set; } public int FontSize { get; set; } @@ -74,7 +73,6 @@ namespace MonoDevelop.Ide.WelcomePage public WelcomePageBarButton (string title, string href, string iconResource = null) { - FontFamily = Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows; HoverColor = Styles.WelcomeScreen.Links.HoverColor; Color = Styles.WelcomeScreen.Links.Color; FontSize = Styles.WelcomeScreen.Links.FontSize; @@ -159,7 +157,7 @@ namespace MonoDevelop.Ide.WelcomePage if (imageNormal != null) image.Image = mouseOver ? imageHover : imageNormal; var color = mouseOver ? HoverColor : Color; - label.Markup = WelcomePageSection.FormatText (FontFamily, FontSize, FontWeight, color, Text); + label.Markup = WelcomePageSection.FormatText (FontSize, FontWeight, color, Text); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs index ebd9c0f9ec..2c6c852762 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs @@ -56,11 +56,10 @@ namespace MonoDevelop.Ide.WelcomePage static WelcomePageFeedItem ()
{
- var face = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows;
- linkUnderlinedFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.MediumTitleFontSize, Styles.WelcomeScreen.Pad.News.Item.TitleHoverColor);
- linkFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.MediumTitleFontSize, Styles.WelcomeScreen.Pad.MediumTitleColor);
- descFormat = Styles.GetFormatString (Styles.WelcomeScreen.Pad.SummaryFontFamily, Styles.WelcomeScreen.Pad.SummaryFontSize, Styles.WelcomeScreen.Pad.TextColor);
- subtitleFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.SmallTitleFontSize, Styles.WelcomeScreen.Pad.SmallTitleColor);
+ linkUnderlinedFormat = Styles.GetFormatString (Styles.WelcomeScreen.Pad.MediumTitleFontSize, Styles.WelcomeScreen.Pad.News.Item.TitleHoverColor);
+ linkFormat = Styles.GetFormatString (Styles.WelcomeScreen.Pad.MediumTitleFontSize, Styles.WelcomeScreen.Pad.MediumTitleColor);
+ descFormat = Styles.GetFormatString (Styles.WelcomeScreen.Pad.SummaryFontSize, Styles.WelcomeScreen.Pad.TextColor);
+ subtitleFormat = Styles.GetFormatString (Styles.WelcomeScreen.Pad.SmallTitleFontSize, Styles.WelcomeScreen.Pad.SmallTitleColor);
}
public WelcomePageFeedItem (XElement el)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs index df2f768770..695fe63922 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs @@ -31,6 +31,7 @@ using MonoDevelop.Ide.Gui; using MonoDevelop.Components; using System.Collections.Generic; using Xwt.Motion; +using MonoDevelop.Ide.Fonts; namespace MonoDevelop.Ide.WelcomePage { @@ -357,7 +358,7 @@ namespace MonoDevelop.Ide.WelcomePage Pango.Layout ButtonLayout (Pango.Context context) { var layout = new Pango.Layout (context); - layout.FontDescription = Pango.FontDescription.FromString (Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows); + layout.FontDescription = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (16); layout.SetText ("Start Building Apps"); @@ -367,7 +368,7 @@ namespace MonoDevelop.Ide.WelcomePage Pango.Layout TitleLayout (Pango.Context context) { var layout = new Pango.Layout (context); - layout.FontDescription = Pango.FontDescription.FromString (Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows); + layout.FontDescription = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (26); layout.SetText ("Welcome To " + BrandingService.SuiteName + "!"); @@ -377,7 +378,7 @@ namespace MonoDevelop.Ide.WelcomePage 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 = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (15); layout.Width = Pango.Units.FromPixels (420); layout.Wrap = Pango.WrapMode.Word; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs index 74368adfd6..4a7d7e25bf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs @@ -78,26 +78,6 @@ namespace MonoDevelop.Ide.WelcomePage } } - string titleFontFace = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows; - public string TitleFontFace { - get { - return titleFontFace; - } - set { - titleFontFace = value; - } - } - - string smallTitleFontFace = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows; - public string SmallTitleFontFace { - get { - return smallTitleFontFace; - } - set { - smallTitleFontFace = value; - } - } - string hoverBackgroundColor = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.HoverBackgroundColor; public string HoverBackgroundColor { get { @@ -298,7 +278,7 @@ namespace MonoDevelop.Ide.WelcomePage Pango.Layout titleLayout = new Pango.Layout (PangoContext); titleLayout.Width = Pango.Units.FromPixels (textWidth); titleLayout.Ellipsize = Pango.EllipsizeMode.End; - titleLayout.SetMarkup (WelcomePageSection.FormatText (TitleFontFace, titleFontSize, TitleFontWeight, MediumTitleColor, title)); + titleLayout.SetMarkup (WelcomePageSection.FormatText (titleFontSize, TitleFontWeight, MediumTitleColor, title)); Pango.Layout subtitleLayout = null; @@ -306,7 +286,7 @@ namespace MonoDevelop.Ide.WelcomePage subtitleLayout = new Pango.Layout (PangoContext); subtitleLayout.Width = Pango.Units.FromPixels (textWidth); subtitleLayout.Ellipsize = Pango.EllipsizeMode.Start; - subtitleLayout.SetMarkup (WelcomePageSection.FormatText (SmallTitleFontFace, smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle)); + subtitleLayout.SetMarkup (WelcomePageSection.FormatText (smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle)); } int height = 0; @@ -322,11 +302,11 @@ namespace MonoDevelop.Ide.WelcomePage int tx = Allocation.X + InternalPadding + LeftTextPadding; int ty = Allocation.Y + (Allocation.Height - height) / 2; - DrawLayout (ctx, titleLayout, TitleFontFace, titleFontSize, TitleFontWeight, MediumTitleColor, tx, ty); + DrawLayout (ctx, titleLayout, "Sans", titleFontSize, TitleFontWeight, MediumTitleColor, tx, ty); if (subtitleLayout != null) { ty += h1 + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; - DrawLayout (ctx, subtitleLayout, SmallTitleFontFace, smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty); + DrawLayout (ctx, subtitleLayout, "Sans", smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty); } } return true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs index 969fbb2fa7..9e23c9786f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs @@ -43,8 +43,7 @@ namespace MonoDevelop.Ide.WelcomePage static WelcomePageSection () { - var face = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows; - headerFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.LargeTitleFontSize, Styles.WelcomeScreen.Pad.LargeTitleFontColor); + headerFormat = Styles.GetFormatString (Styles.WelcomeScreen.Pad.LargeTitleFontSize, Styles.WelcomeScreen.Pad.LargeTitleFontColor); } public WelcomePageSection (string title = null) @@ -116,9 +115,9 @@ namespace MonoDevelop.Ide.WelcomePage return true; } - public static string FormatText (string fontFace, int fontSize, Pango.Weight weight, string color, string text) + public static string FormatText (int fontSize, Pango.Weight weight, string color, string text) { - var format = Styles.GetFormatString (fontFace, fontSize, color, weight); + var format = Styles.GetFormatString (fontSize, color, weight); return string.Format (format, GLib.Markup.EscapeText (text)); } |