diff options
author | Vaclav Vancura <vaclav@vancura.org> | 2016-01-18 15:50:23 +0300 |
---|---|---|
committer | Vaclav Vancura <vaclav@vancura.org> | 2016-01-18 15:53:13 +0300 |
commit | 7a639dfd0839312c5ca1d61fc3d00b42c71517af (patch) | |
tree | 7d234b93ad67e20693987237cfa2fdb15c4fae67 /main/src | |
parent | e1a99a916ecfb2b5f9b97cd7ac87810aab67a4d3 (diff) |
[Ide] FontService fixes
Diffstat (limited to 'main/src')
17 files changed, 30 insertions, 35 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs index 4bc5f46731..3266afe292 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs @@ -51,7 +51,7 @@ namespace MonoDevelop.Debugger.PreviewVisualizers var label = new Gtk.Label (); label.Text = value; - var font = label.Style.FontDescription.Copy (); + var font = label.Style.FontDescription.Copy (); // TODO: VV: Use FontService if (font.SizeIsAbsolute) { font.AbsoluteSize = font.Size - 1; diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs index d5790882b4..b928141e25 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs @@ -65,7 +65,7 @@ namespace MonoDevelop.Debugger var headerTitle = new Label (); headerTitle.ModifyFg (StateType.Normal, Styles.PreviewVisualizerHeaderTextColor.ToGdkColor ()); - var font = headerTitle.Style.FontDescription.Copy (); + var font = headerTitle.Style.FontDescription.Copy (); // TODO: VV: Use FontService font.Weight = Pango.Weight.Bold; headerTitle.ModifyFont (font); headerTitle.Text = val.TypeName; diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index 1ba0159830..962d1b58fd 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -409,7 +409,7 @@ namespace MonoDevelop.Debugger class StackFrameCellRenderer : CellRenderer { - static readonly Pango.FontDescription LineNumberFont = FontService.MonospaceFont.CopyModified (0.9d); + static readonly Pango.FontDescription LineNumberFont = FontService.MonospaceFont.CopyModified (Ide.Gui.Styles.FontScale11); const int RoundedRectangleRadius = 2; const int RoundedRectangleHeight = 14; const int RoundedRectangleWidth = 28; diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs index c09aa80603..5da2ab92d6 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs @@ -298,7 +298,7 @@ namespace MonoDevelop.Debugger Selection.Changed += HandleSelectionChanged; ResetColumnSizes (); - Pango.FontDescription newFont = Style.FontDescription.Copy (); + Pango.FontDescription newFont = Style.FontDescription.Copy (); // TODO: VV: Use FontService newFont.Size = (newFont.Size * 8) / 10; liveIcon = ImageService.GetIcon (Stock.Execute, IconSize.Menu); @@ -727,7 +727,7 @@ namespace MonoDevelop.Debugger compact = value; Pango.FontDescription newFont; if (compact) { - newFont = Style.FontDescription.Copy (); + newFont = Style.FontDescription.Copy (); // TODO: VV: Use FontService newFont.Size = (newFont.Size * 8) / 10; valueCol.MaxWidth = 800; crpViewer.Image = ImageService.GetIcon (Stock.Edit).WithSize (12,12); diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorItem.cs index 9c5980ce04..9cf09eb96e 100644 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorItem.cs +++ b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorItem.cs @@ -187,7 +187,7 @@ namespace Stetic.Editor bool calcSize = (testx == -1); Pango.Layout layout = new Pango.Layout (this.PangoContext); - Pango.FontDescription des = this.Style.FontDescription.Copy(); + Pango.FontDescription des = this.Style.FontDescription.Copy(); // TODO: VV: Use FontService des.Size = 10 * (int) Pango.Scale.PangoScale; layout.FontDescription = des; layout.SetMarkup (title); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs index 9ab27759db..3207a5872c 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs @@ -370,8 +370,7 @@ namespace MonoDevelop.VersionControl.Views public void OptionsChanged () { - var description = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); - layout.FontDescription = description; + layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); UpdateWidth (); } @@ -710,8 +709,7 @@ namespace MonoDevelop.VersionControl.Views } using (var authorLayout = MonoDevelop.Components.PangoUtil.CreateLayout (this)) { - var description = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); - authorLayout.FontDescription = description; + authorLayout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); authorLayout.SetText (ann.Author); authorLayout.GetPixelSize (out authorWidth, out h); diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs index e582532248..0706c1b260 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs @@ -258,7 +258,7 @@ namespace Mono.TextEditor.PopupWindow } else { Symbol = SymbolTokenType.None; - var desc = ctx.FontDescription.Copy (); + var desc = ctx.FontDescription.Copy (); // TODO: VV: Use FontService desc.AbsoluteSize = Pango.Units.FromPixels (Outlined ? outlinedFontSize : normalFontSize); if (Outlined) { desc.Weight = Pango.Weight.Bold; @@ -355,7 +355,7 @@ namespace Mono.TextEditor.PopupWindow List<TokenRenderer> line = new List<TokenRenderer> (); var currentLine = ""; - var desc = ctx.FontDescription.Copy (); + var desc = ctx.FontDescription.Copy (); // TODO: VV: Use FontService desc.AbsoluteSize = Pango.Units.FromPixels (14); desc.Weight = Pango.Weight.Bold; var layout = new Pango.Layout (ctx); @@ -412,7 +412,7 @@ namespace Mono.TextEditor.PopupWindow }; titleLayout = new Pango.Layout (PangoContext); - var desc = PangoContext.FontDescription.Copy (); + var desc = PangoContext.FontDescription.Copy (); // TODO: VV: Use FontService desc.AbsoluteSize = Pango.Units.FromPixels (12); desc.Weight = Pango.Weight.Bold; titleLayout.FontDescription = desc; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs index 8b8c208857..cfe3b9cb6f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs @@ -630,7 +630,7 @@ namespace MonoDevelop.Components.Chart if (showLabels) { layout = new Pango.Layout (this.PangoContext); - layout.FontDescription = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); + layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); } bool isX = pos == AxisPosition.Top || pos == AxisPosition.Bottom; @@ -766,7 +766,7 @@ namespace MonoDevelop.Components.Chart { int max = 0; Pango.Layout layout = new Pango.Layout (this.PangoContext); - layout.FontDescription = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); + layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); double start = GetStart (ad); double end = GetEnd (ad); @@ -877,7 +877,7 @@ namespace MonoDevelop.Components.Chart if (text != null && text.Length > 0) { Pango.Layout layout = new Pango.Layout (this.PangoContext); - layout.FontDescription = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11); + layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); layout.SetMarkup (text); int tw, th; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs index 0dbdbc6317..b4cb07dfd6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs @@ -36,6 +36,7 @@ using MonoDevelop.Components; using Xwt.Motion; using Animations = Xwt.Motion.AnimationExtensions; using MonoDevelop.Core; +using MonoDevelop.Ide.Fonts; namespace MonoDevelop.Components.Docking { @@ -233,10 +234,7 @@ namespace MonoDevelop.Components.Docking if (!string.IsNullOrEmpty (it.Label)) { label = new Label (it.Label); label.UseMarkup = true; - - var font = label.Style.FontDescription.Copy (); - font.Size = (int)((Platform.IsMac ? Styles.FontScale11 : Styles.FontScale12) * font.Size); - label.ModifyFont (font); + label.ModifyFont (FontService.SansFont.CopyModified (Styles.FontScale11)); if (bar.Orientation == Orientation.Vertical) label.Angle = 270; @@ -244,9 +242,9 @@ namespace MonoDevelop.Components.Docking // fine-tune label alignment issues if (Platform.IsMac) { if (bar.Orientation == Orientation.Horizontal) - label.SetAlignment (0, 0.7f); + label.SetAlignment (0, 0.5f); else - label.SetAlignment (0.3f, 0); + label.SetAlignment (0.6f, 0); } else { if (bar.Orientation == Orientation.Vertical) label.SetAlignment (1, 0); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs index 758950d528..9eb9ae93e3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs @@ -33,6 +33,7 @@ using System.Linq; using MonoDevelop.Core; using MonoDevelop.Ide; using MonoDevelop.Components; +using MonoDevelop.Ide.Fonts; namespace MonoDevelop.Components.Docking { @@ -165,11 +166,7 @@ namespace MonoDevelop.Components.Docking labelWidget.DropShadowVisible = true; labelWidget.UseMarkup = true; labelWidget.SetPadding (0, 5); - - var font = labelWidget.Style.FontDescription.Copy (); - font.Size = (int) (Styles.FontScale11 * font.Size); - font.Weight = Pango.Weight.Bold; - labelWidget.ModifyFont (font); + labelWidget.ModifyFont (Ide.Fonts.FontService.SansFont.CopyModified (Styles.FontScale11)); box.PackStart (labelWidget, true, true, 0); } else { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs index 907b94be56..774ef4cbb8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs @@ -323,7 +323,7 @@ namespace MonoDevelop.Components.MainToolbar } - using (var font = FontService.SansFont.CopyModified (0.8d)) { + using (var font = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { errors.Visible = ec > 0; errors.ModifyFont (font); errors.Text = ec.ToString (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs index 5b9bad2368..9c19b383b9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs @@ -380,7 +380,7 @@ namespace MonoDevelop.Components.PropertyGrid descTextView.LeftMargin = 5;
descTextView.RightMargin = 5;
- Pango.FontDescription font = Style.FontDescription.Copy ();
+ Pango.FontDescription font = Style.FontDescription.Copy (); // TODO: VV: Use FontService
font.Size = (font.Size * 8) / 10;
descTextView.ModifyFont (font);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs index ce942631ca..f18a3dd446 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs @@ -84,7 +84,7 @@ namespace MonoDevelop.Components alignment.SetPadding (4, 4, 6, 6); - var f = Style.FontDescription.Copy (); + var f = Style.FontDescription.Copy (); // TODO: VV: Use FontService f.Size = ((f.Size / (int)Pango.Scale.PangoScale) - 1) * (int)Pango.Scale.PangoScale; label.ModifyFont (f); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs index fb0a44eaf6..1d7cbd363e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs @@ -82,7 +82,7 @@ namespace MonoDevelop.Ide.Gui fd = null; } if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar) { - fd = Style.FontDescription.Copy (); + fd = Style.FontDescription.Copy (); // TODO: VV: Use FontService fd.Size = (int) (fd.Size * Pango.Scale.Small); } combo.ModifyLabelFont (fd); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs index 71c0b3c766..eeec543579 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs @@ -48,8 +48,10 @@ namespace MonoDevelop.Ide.Gui public static Pango.FontDescription DefaultFont { get; internal set; } public static string DefaultFontName { get; internal set; } - public static double FontScale12 = 1; // 12pt - public static double FontScale11 = 0.917; // 11pt = default font size * 0.917 + public static double FontScale11 = 0.84616; + public static double FontScale12 = 0.92308; + public static double FontScale13 = 1; + public static double FontScale14 = 1.07693; public static Color ThinSplitterColor { get; internal set; } public static Color SeparatorColor { get; internal set; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs index 4b821b558e..01fac931a1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs @@ -65,7 +65,7 @@ namespace MonoDevelop.Ide.Gui { if (Style != null) { if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar) { - Pango.FontDescription fd = Style.FontDescription.Copy (); + Pango.FontDescription fd = Style.FontDescription.Copy (); // TODO: VV: Use FontService fd.Size = (int) (fd.Size * Pango.Scale.Small); ctx.FontDesc = fd; } else { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs index 0f79fe34a5..61ff873e80 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs @@ -132,7 +132,7 @@ namespace MonoDevelop.Ide.Projects topBannerLabel = new Label ();
topBannerLabel.Name = "topBannerLabel";
- Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy ();
+ Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy (); // TODO: VV: Use FontService
font.Size = (int)(font.Size * 1.8);
topBannerLabel.ModifyFont (font);
topBannerLabel.ModifyFg (StateType.Normal, whiteColor);
|