diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-03 10:13:00 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-04 03:17:26 +0000 |
commit | 697d445ed0c7b60e463243db89af32e2145b475b (patch) | |
tree | 5a74d57cdc97f82bc78a686dee345a229a082a72 /vcl/source/window/settings.cxx | |
parent | 91a7580e03d5b47c6e2513afce85ddee45e730b6 (diff) |
vcl: take into account the font width is the average font width
I'm changing the Font class function names:
- SetSize -> SetFontSize
- GetSize -> GetFontSize
- SetHeight -> SetFontHeight
- GetHeight -> GetFontHeight
- SetWidth -> SetAverageFontWidth
- GetWidth -> GetAverageFontWidth
That's because it really makes no sense to say that there is a
single constant font width because obviously proportional fonts
don't have one - the best we can do is an average font width,
which is what folks like Microsoft sort of do already. On a fixed
font, the average is still accurate, for obvious reasons :-)
I'm also not a fan of GetSize/SetSize as I find it a might too
generic.
Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70
Reviewed-on: https://gerrit.libreoffice.org/22069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/source/window/settings.cxx')
-rw-r--r-- | vcl/source/window/settings.cxx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx index e54a4382c747..c9a8fd1c7ba0 100644 --- a/vcl/source/window/settings.cxx +++ b/vcl/source/window/settings.cxx @@ -161,7 +161,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl ) maxFontheight = (int) ((( 8.0 * (double) GetDesktopRectPixel().getHeight()) / 600.0) + 1.5); vcl::Font aFont = aStyleSettings.GetMenuFont(); - int defFontheight = aFont.GetHeight(); + int defFontheight = aFont.GetFontHeight(); if( defFontheight > maxFontheight ) defFontheight = maxFontheight; @@ -178,59 +178,59 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl ) toolfontheight = (defFontheight+8) / 2; aFont = aStyleSettings.GetAppFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetAppFont( aFont ); aFont = aStyleSettings.GetTitleFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetTitleFont( aFont ); aFont = aStyleSettings.GetFloatTitleFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetFloatTitleFont( aFont ); // keep menu and help font size from system unless in broken locale size if( bBrokenLangFontHeight ) { aFont = aStyleSettings.GetMenuFont(); - if( aFont.GetHeight() < defFontheight ) + if( aFont.GetFontHeight() < defFontheight ) { - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetMenuFont( aFont ); } aFont = aStyleSettings.GetHelpFont(); - if( aFont.GetHeight() < defFontheight ) + if( aFont.GetFontHeight() < defFontheight ) { - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetHelpFont( aFont ); } } // use different height for toolfont aFont = aStyleSettings.GetToolFont(); - aFont.SetHeight( toolfontheight ); + aFont.SetFontHeight( toolfontheight ); aStyleSettings.SetToolFont( aFont ); aFont = aStyleSettings.GetLabelFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetLabelFont( aFont ); aFont = aStyleSettings.GetInfoFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetInfoFont( aFont ); aFont = aStyleSettings.GetRadioCheckFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetRadioCheckFont( aFont ); aFont = aStyleSettings.GetPushButtonFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetPushButtonFont( aFont ); aFont = aStyleSettings.GetFieldFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetFieldFont( aFont ); aFont = aStyleSettings.GetIconFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetIconFont( aFont ); aFont = aStyleSettings.GetTabFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetTabFont( aFont ); aFont = aStyleSettings.GetGroupFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetGroupFont( aFont ); rSettings.SetStyleSettings( aStyleSettings ); |