diff options
author | Vaclav Vancura <vaclav@vancura.org> | 2016-01-16 12:01:37 +0300 |
---|---|---|
committer | Vaclav Vancura <vaclav@vancura.org> | 2016-01-16 12:01:59 +0300 |
commit | 4d79eadb3784a44a147b827cf0f120a98bb0bbe4 (patch) | |
tree | b7079100b82492dcdfcb7cde25c2c8fa5db587c5 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage | |
parent | fd6c266b3d0bddc02562a73318496e16a8aea5fa (diff) |
Revert "[WelcomePage] Unifying fonts: Getting rid of aging Calibri, Tahoma and Lucida Grande in favor of system fonts"
This reverts commit 3fce8122bdf2ab0009d645f256ae692fc8e1666d.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage')
6 files changed, 46 insertions, 18 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 ae2cf9eaf5..f8b86440f2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs @@ -6,6 +6,8 @@ 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; } @@ -27,6 +29,8 @@ 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; } @@ -44,6 +48,7 @@ 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; @@ -137,9 +142,9 @@ namespace MonoDevelop.Ide.WelcomePage } } - public static string GetFormatString (int fontSize, string color, Pango.Weight weight = Pango.Weight.Normal) + public static string GetFormatString (string fontFace, int fontSize, string color, Pango.Weight weight = Pango.Weight.Normal) { - return "<span font=\"Sans " + fontSize + "px\" foreground=\"" + color + "\" font_weight=\"" + weight + "\">{0}</span>"; + return "<span font=\"" + fontFace + " " + 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 9beb19667d..a2a4e777ae 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs @@ -42,6 +42,7 @@ 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; } @@ -73,6 +74,7 @@ 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; @@ -157,7 +159,7 @@ namespace MonoDevelop.Ide.WelcomePage if (imageNormal != null) image.Image = mouseOver ? imageHover : imageNormal; var color = mouseOver ? HoverColor : Color; - label.Markup = WelcomePageSection.FormatText (FontSize, FontWeight, color, Text); + label.Markup = WelcomePageSection.FormatText (FontFamily, 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 2c6c852762..ebd9c0f9ec 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs @@ -56,10 +56,11 @@ namespace MonoDevelop.Ide.WelcomePage static WelcomePageFeedItem ()
{
- 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);
+ 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);
}
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 695fe63922..df2f768770 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs @@ -31,7 +31,6 @@ using MonoDevelop.Ide.Gui; using MonoDevelop.Components; using System.Collections.Generic; using Xwt.Motion; -using MonoDevelop.Ide.Fonts; namespace MonoDevelop.Ide.WelcomePage { @@ -358,7 +357,7 @@ namespace MonoDevelop.Ide.WelcomePage Pango.Layout ButtonLayout (Pango.Context context) { var layout = new Pango.Layout (context); - layout.FontDescription = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); + layout.FontDescription = Pango.FontDescription.FromString (Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows); layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (16); layout.SetText ("Start Building Apps"); @@ -368,7 +367,7 @@ namespace MonoDevelop.Ide.WelcomePage Pango.Layout TitleLayout (Pango.Context context) { var layout = new Pango.Layout (context); - layout.FontDescription = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); + layout.FontDescription = Pango.FontDescription.FromString (Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows); layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (26); layout.SetText ("Welcome To " + BrandingService.SuiteName + "!"); @@ -378,7 +377,7 @@ namespace MonoDevelop.Ide.WelcomePage Pango.Layout TextLayout (Pango.Context context) { var layout = new Pango.Layout (context); - layout.FontDescription = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); + 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; 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 4a7d7e25bf..74368adfd6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs @@ -78,6 +78,26 @@ 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 { @@ -278,7 +298,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 (titleFontSize, TitleFontWeight, MediumTitleColor, title)); + titleLayout.SetMarkup (WelcomePageSection.FormatText (TitleFontFace, titleFontSize, TitleFontWeight, MediumTitleColor, title)); Pango.Layout subtitleLayout = null; @@ -286,7 +306,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 (smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle)); + subtitleLayout.SetMarkup (WelcomePageSection.FormatText (SmallTitleFontFace, smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle)); } int height = 0; @@ -302,11 +322,11 @@ namespace MonoDevelop.Ide.WelcomePage int tx = Allocation.X + InternalPadding + LeftTextPadding; int ty = Allocation.Y + (Allocation.Height - height) / 2; - DrawLayout (ctx, titleLayout, "Sans", titleFontSize, TitleFontWeight, MediumTitleColor, tx, ty); + DrawLayout (ctx, titleLayout, TitleFontFace, titleFontSize, TitleFontWeight, MediumTitleColor, tx, ty); if (subtitleLayout != null) { ty += h1 + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; - DrawLayout (ctx, subtitleLayout, "Sans", smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty); + DrawLayout (ctx, subtitleLayout, SmallTitleFontFace, 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 9e23c9786f..969fbb2fa7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs @@ -43,7 +43,8 @@ namespace MonoDevelop.Ide.WelcomePage static WelcomePageSection () { - headerFormat = Styles.GetFormatString (Styles.WelcomeScreen.Pad.LargeTitleFontSize, Styles.WelcomeScreen.Pad.LargeTitleFontColor); + var face = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows; + headerFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.LargeTitleFontSize, Styles.WelcomeScreen.Pad.LargeTitleFontColor); } public WelcomePageSection (string title = null) @@ -115,9 +116,9 @@ namespace MonoDevelop.Ide.WelcomePage return true; } - public static string FormatText (int fontSize, Pango.Weight weight, string color, string text) + public static string FormatText (string fontFace, int fontSize, Pango.Weight weight, string color, string text) { - var format = Styles.GetFormatString (fontSize, color, weight); + var format = Styles.GetFormatString (fontFace, fontSize, color, weight); return string.Format (format, GLib.Markup.EscapeText (text)); } |