summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-11-11 12:29:26 +0000
committerMichael Meeks <michael.meeks@collabora.com>2017-11-16 18:50:28 +0100
commitfc6231f1d1dd2a4e6f678b8221971e09807d8de8 (patch)
treec77ab0678c36432040b5a866cc74b6ab5d9b8f0b /vcl/unx
parent84e1a01e2d1964a143f5b01fa0b70d9570dcb834 (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')
-rw-r--r--vcl/unx/gtk/salnativewidgets-gtk.cxx12
-rw-r--r--vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx10
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx48
-rw-r--r--vcl/unx/kde5/KDE5SalFrame.cxx12
4 files changed, 22 insertions, 60 deletions
diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx
index b5639e95ec8e..71cdf74f0ca5 100644
--- a/vcl/unx/gtk/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx
@@ -3984,17 +3984,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
if( aInfo.m_ePitch != PITCH_DONTKNOW )
aFont.SetPitch( aInfo.m_ePitch );
- aStyleSet.SetAppFont( aFont );
- aStyleSet.SetHelpFont( aFont );
- aStyleSet.SetMenuFont( aFont );
- aStyleSet.SetToolFont( aFont );
- aStyleSet.SetLabelFont( aFont );
- aStyleSet.SetRadioCheckFont( aFont );
- aStyleSet.SetPushButtonFont( aFont );
- aStyleSet.SetFieldFont( aFont );
- aStyleSet.SetIconFont( aFont );
- aStyleSet.SetTabFont( aFont );
- aStyleSet.SetGroupFont( aFont );
+ aStyleSet.BatchSetFonts( aFont, aFont );
aFont.SetWeight( WEIGHT_BOLD );
aStyleSet.SetTitleFont( aFont );
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 9229b4e178dc..f37ed7cb93dd 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2883,15 +2883,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// UI font
vcl::Font aFont(getFont(pStyle, rSettings.GetUILanguageTag().getLocale()));
- aStyleSet.SetAppFont( aFont );
- aStyleSet.SetHelpFont( aFont );
- aStyleSet.SetMenuFont( aFont );
- aStyleSet.SetLabelFont( aFont );
- aStyleSet.SetRadioCheckFont( aFont );
- aStyleSet.SetPushButtonFont( aFont );
- aStyleSet.SetFieldFont( aFont );
- aStyleSet.SetIconFont( aFont );
- aStyleSet.SetGroupFont( aFont );
+ aStyleSet.BatchSetFonts( aFont, aFont);
aFont.SetWeight( WEIGHT_BOLD );
aStyleSet.SetTitleFont( aFont );
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 );
diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx
index 1222260702ef..61b4113fa9d2 100644
--- a/vcl/unx/kde5/KDE5SalFrame.cxx
+++ b/vcl/unx/kde5/KDE5SalFrame.cxx
@@ -258,16 +258,7 @@ void KDE5SalFrame::UpdateSettings( AllSettings& rSettings )
// 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 );
+ style.BatchSetFonts( aFont, aFont );
aFont.SetWeight( WEIGHT_BOLD );
if( !bSetTitleFont )
@@ -275,7 +266,6 @@ void KDE5SalFrame::UpdateSettings( AllSettings& rSettings )
style.SetTitleFont( aFont );
}
style.SetFloatTitleFont( aFont );
-
style.SetHelpFont( toFont( QToolTip::font(), rSettings.GetUILanguageTag().getLocale()));
int flash_time = QApplication::cursorFlashTime();