diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2017-11-11 12:29:26 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-11-16 18:50:28 +0100 |
commit | fc6231f1d1dd2a4e6f678b8221971e09807d8de8 (patch) | |
tree | c77ab0678c36432040b5a866cc74b6ab5d9b8f0b /vcl/unx/kde4 | |
parent | 84e1a01e2d1964a143f5b01fa0b70d9570dcb834 (diff) |
vcl: StyleSettings - start to unwind code duplication.
This should be a pure re-factor, plus:
switch from Serif -> Sans font default for the UI (wow).
enable larger font size for LOK only
that avoids a hard to debug svx junit test failure.
Change-Id: Id438026064983ea4907819bab55c4be740954605
Reviewed-on: https://gerrit.libreoffice.org/44625
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/unx/kde4')
-rw-r--r-- | vcl/unx/kde4/KDESalFrame.cxx | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index ea46d6e5c247..769e456e8738 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -175,6 +175,19 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) style.SetActiveTextColor(toColor(pal.color(QPalette::Active, QPalette::WindowText))); style.SetDeactiveTextColor(toColor(pal.color(QPalette::Inactive, QPalette::WindowText))); + // Font + vcl::Font aFont = toFont( QApplication::font(), rSettings.GetUILanguageTag().getLocale() ); + style.BatchSetFonts( aFont, aFont ); + + aFont.SetWeight( WEIGHT_BOLD ); + if( !bSetTitleFont ) + { + style.SetTitleFont( aFont ); + } + style.SetFloatTitleFont( aFont ); + + style.SetHelpFont( toFont( QToolTip::font(), rSettings.GetUILanguageTag().getLocale())); + // WM settings KConfig *pConfig = KGlobal::config().data(); if ( pConfig ) @@ -187,9 +200,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) pKey = "titleFont"; if (aWMGroup.hasKey(pKey)) { - vcl::Font aFont = toFont(aWMGroup.readEntry(pKey, QFont()), - rSettings.GetUILanguageTag().getLocale()); - style.SetTitleFont( aFont ); + vcl::Font aTitleFont = toFont(aWMGroup.readEntry(pKey, QFont()), + rSettings.GetUILanguageTag().getLocale()); + style.SetTitleFont( aTitleFont ); bSetTitleFont = true; } } @@ -204,9 +217,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) pKey = "toolbarFont"; if (aIconsGroup.hasKey(pKey)) { - vcl::Font aFont = toFont(aIconsGroup.readEntry(pKey, QFont()), - rSettings.GetUILanguageTag().getLocale()); - style.SetToolFont( aFont ); + vcl::Font aToolFont = toFont(aIconsGroup.readEntry(pKey, QFont()), + rSettings.GetUILanguageTag().getLocale()); + style.SetToolFont( aToolFont ); } } @@ -269,29 +282,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) style.SetHelpColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipBase ))); style.SetHelpTextColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipText ))); - // Font - vcl::Font aFont = toFont( QApplication::font(), rSettings.GetUILanguageTag().getLocale() ); - - style.SetAppFont( aFont ); - - style.SetMenuFont( aFont ); // will be changed according to pMenuBar - style.SetLabelFont( aFont ); - style.SetRadioCheckFont( aFont ); - style.SetPushButtonFont( aFont ); - style.SetFieldFont( aFont ); - style.SetIconFont( aFont ); - style.SetTabFont( aFont ); - style.SetGroupFont( aFont ); - - aFont.SetWeight( WEIGHT_BOLD ); - if( !bSetTitleFont ) - { - style.SetTitleFont( aFont ); - } - style.SetFloatTitleFont( aFont ); - - style.SetHelpFont( toFont( QToolTip::font(), rSettings.GetUILanguageTag().getLocale())); - int flash_time = QApplication::cursorFlashTime(); style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME ); |