summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-17 13:04:58 +0000
committerTomaž Vajngerl <quikee@gmail.com>2016-11-24 12:01:03 +0000
commit1439b3499ced0f1131af8e0de107e96d8aac4039 (patch)
treefdad3f6e67ddc06df13ee515469f9d48a48f498b
parent83dc2227f35795aee4e2ccaccbb7d67d4c50ba3f (diff)
Resolves: tdf#89760 add and use a ToolFontColor for toolbar item entries
instead of using the MenuBar text color, cause for Ambiance theme the menubar is dark and its font is light, while the toolbars can be light, so light font on light bg appears greyed out (cherry picked from commit b79cf88a048e5d8c784c97d99155104aef3d5dca) Change-Id: I0fa4ab8eabdd3cd69eb682e5ddba8314b8c9ff0f Reviewed-on: https://gerrit.libreoffice.org/30937 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--include/vcl/settings.hxx3
-rw-r--r--vcl/source/app/settings.cxx17
-rw-r--r--vcl/source/window/toolbox.cxx2
-rw-r--r--vcl/unx/gtk/salnativewidgets-gtk.cxx6
-rw-r--r--vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx10
-rw-r--r--vcl/unx/kde/salnativewidgets-kde.cxx1
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx1
-rw-r--r--vcl/win/window/salframe.cxx1
8 files changed, 38 insertions, 3 deletions
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index acbacf3346d0..b8e7f9423c60 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -383,6 +383,9 @@ public:
void SetTabHighlightTextColor( const Color& rColor );
const Color& GetTabHighlightTextColor() const;
+ void SetToolTextColor( const Color& rColor );
+ const Color& GetToolTextColor() const;
+
void SetLinkColor( const Color& rColor );
const Color& GetLinkColor() const;
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index cb84dbe0aaa6..592d85b9fbb5 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -133,6 +133,7 @@ struct ImplStyleData
Color maRadioCheckTextColor;
Color maShadowColor;
Color maVisitedLinkColor;
+ Color maToolTextColor;
Color maWindowColor;
Color maWindowTextColor;
Color maWorkspaceColor;
@@ -607,6 +608,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
maRadioCheckTextColor( rData.maRadioCheckTextColor ),
maShadowColor( rData.maShadowColor ),
maVisitedLinkColor( rData.maVisitedLinkColor ),
+ maToolTextColor( rData.maToolTextColor ),
maWindowColor( rData.maWindowColor ),
maWindowTextColor( rData.maWindowTextColor ),
maWorkspaceColor( rData.maWorkspaceColor ),
@@ -754,6 +756,7 @@ void ImplStyleData::SetStandardStyles()
maHelpTextColor = Color( COL_BLACK );
maLinkColor = Color( COL_BLUE );
maVisitedLinkColor = Color( 0x00, 0x00, 0xCC );
+ maToolTextColor = Color( COL_BLACK );
maHighlightLinkColor = Color( COL_LIGHTBLUE );
maFontColor = Color( COL_BLACK );
maAlternatingRowColor = Color( 0xEE, 0xEE, 0xEE );
@@ -1380,6 +1383,19 @@ StyleSettings::GetVisitedLinkColor() const
return mxData->maVisitedLinkColor;
}
+void
+StyleSettings::SetToolTextColor( const Color& rColor )
+{
+ CopyData();
+ mxData->maToolTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetToolTextColor() const
+{
+ return mxData->maToolTextColor;
+}
+
const Color&
StyleSettings::GetHighlightLinkColor() const
{
@@ -2364,6 +2380,7 @@ bool StyleSettings::operator ==( const StyleSettings& rSet ) const
(mxData->maHelpTextColor == rSet.mxData->maHelpTextColor) &&
(mxData->maLinkColor == rSet.mxData->maLinkColor) &&
(mxData->maVisitedLinkColor == rSet.mxData->maVisitedLinkColor) &&
+ (mxData->maToolTextColor == rSet.mxData->maToolTextColor) &&
(mxData->maHighlightLinkColor == rSet.mxData->maHighlightLinkColor) &&
(mxData->maAppFont == rSet.mxData->maAppFont) &&
(mxData->maHelpFont == rSet.mxData->maHelpFont) &&
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 3344532c4d37..c6aa12d2e5e5 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1451,7 +1451,7 @@ void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext)
|| (GetAlign() == WindowAlign::Bottom && !Application::GetSettings().GetStyleSettings().GetPersonaFooter().IsEmpty()))
{
rRenderContext.SetBackground();
- rRenderContext.SetTextColor(rStyleSettings.GetMenuBarTextColor());
+ rRenderContext.SetTextColor(rStyleSettings.GetToolTextColor());
SetPaintTransparent(true);
SetParentClipMode(ParentClipMode::NoClip);
mpData->maDisplayBackground = Wallpaper(rStyleSettings.GetFaceColor());
diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx
index 95af7fe76b41..a1c3e0596db5 100644
--- a/vcl/unx/gtk/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx
@@ -3927,6 +3927,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// get the widgets in place
NWEnsureGTKMenu( m_nXScreen );
NWEnsureGTKMenubar( m_nXScreen );
+ NWEnsureGTKToolbar( m_nXScreen );
NWEnsureGTKScrollbars( m_nXScreen );
NWEnsureGTKEditBox( m_nXScreen );
NWEnsureGTKTooltip( m_nXScreen );
@@ -4024,7 +4025,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
GtkStyle* pMenuItemStyle = gtk_rc_get_style( gWidgetData[m_nXScreen].gMenuItemMenuWidget );
GtkStyle* pMenubarStyle = gtk_rc_get_style( gWidgetData[m_nXScreen].gMenubarWidget );
GtkStyle* pMenuTextStyle = gtk_rc_get_style( gtk_bin_get_child( GTK_BIN(gWidgetData[m_nXScreen].gMenuItemMenuWidget) ) );
-
aBackColor = getColor( pMenubarStyle->bg[GTK_STATE_NORMAL] );
aStyleSet.SetMenuBarColor( aBackColor );
aStyleSet.SetMenuBarRolloverColor( aBackColor );
@@ -4038,6 +4038,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetMenuBarRolloverTextColor(getColor(pMenubarStyle->fg[GTK_STATE_PRELIGHT]));
aStyleSet.SetMenuBarHighlightTextColor(getColor(pMenubarStyle->fg[GTK_STATE_SELECTED]));
+ // toolbar colors
+ GtkStyle* pToolbarButtonStyle = gtk_rc_get_style( gWidgetData[m_nXScreen].gToolbarButtonWidget );
+ aStyleSet.SetToolTextColor(getColor(pToolbarButtonStyle->fg[GTK_STATE_NORMAL]));
+
#if OSL_DEBUG_LEVEL > 1
std::fprintf( stderr, "==\n" );
std::fprintf( stderr, "MenuColor = %x (%d)\n", (int)aStyleSet.GetMenuColor().GetColor(), aStyleSet.GetMenuColor().GetLuminance() );
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index d1f24ddc6ebd..60fc82d6275d 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2506,7 +2506,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetAppFont( aFont );
aStyleSet.SetHelpFont( aFont );
aStyleSet.SetMenuFont( aFont );
- aStyleSet.SetToolFont( aFont );
aStyleSet.SetLabelFont( aFont );
aStyleSet.SetInfoFont( aFont );
aStyleSet.SetRadioCheckFont( aFont );
@@ -2653,6 +2652,15 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetTabFont(getFont(mpNotebookHeaderTabsTabLabelStyle, rSettings.GetUILanguageTag().getLocale()));
}
+ {
+ GtkStyleContext *pCStyle = mpToolButtonStyle;
+ style_context_set_state(pCStyle, GTK_STATE_FLAG_NORMAL);
+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color);
+ aTextColor = getColor( text_color );
+ aStyleSet.SetToolTextColor(aTextColor);
+ aStyleSet.SetToolFont(getFont(mpToolButtonStyle, rSettings.GetUILanguageTag().getLocale()));
+ }
+
// mouse over text colors
{
GtkStyleContext *pCStyle = mpNotebookHeaderTabsTabHoverLabelStyle;
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index e9c1f90d76fc..1f538741d79f 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1904,6 +1904,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetFieldTextColor( aText );
aStyleSettings.SetFieldRolloverTextColor( aText );
aStyleSettings.SetWindowTextColor( aText );
+ aStyleSettings.SetToolTextColor( aText );
aStyleSettings.SetHelpTextColor( aText );
// Base
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 1d945a5c5b44..a9ec1e8bc411 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -222,6 +222,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetFieldTextColor( aText );
style.SetFieldRolloverTextColor( aText );
style.SetWindowTextColor( aText );
+ style.SetToolTextColor( aText );
// Base
style.SetFieldColor( aBase );
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 6b5fa26b071c..a6f10092a88a 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2657,6 +2657,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetWindowColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOW ) ) );
aStyleSettings.SetActiveTabColor( aStyleSettings.GetWindowColor() );
aStyleSettings.SetWindowTextColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOWTEXT ) ) );
+ aStyleSettings.SetToolTextColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOWTEXT ) ) );
aStyleSettings.SetFieldColor( aStyleSettings.GetWindowColor() );
aStyleSettings.SetFieldTextColor( aStyleSettings.GetWindowTextColor() );
aStyleSettings.SetFieldRolloverTextColor( aStyleSettings.GetFieldTextColor() );