summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-17 13:04:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-17 13:07:26 +0000
commitb79cf88a048e5d8c784c97d99155104aef3d5dca (patch)
tree88532121bba991ab9a924f4dda6834ec60b7731c
parent46f544fa4b9ce43d3c44be1f12ff0d85d12bdb0e (diff)
Resolves: tdf#87960 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 Change-Id: I0fa4ab8eabdd3cd69eb682e5ddba8314b8c9ff0f
-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 fd2881001e42..e8b7c0a6f28a 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -380,6 +380,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 215a9e1a9232..d9dbe571081d 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -132,6 +132,7 @@ struct ImplStyleData
Color maRadioCheckTextColor;
Color maShadowColor;
Color maVisitedLinkColor;
+ Color maToolTextColor;
Color maWindowColor;
Color maWindowTextColor;
Color maWorkspaceColor;
@@ -602,6 +603,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 ),
@@ -745,6 +747,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 );
@@ -1358,6 +1361,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
{
@@ -2322,6 +2338,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 e46d0da88dff..2fe58697735d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1455,7 +1455,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 2424ec333617..5c70c1eb062a 100644
--- a/vcl/unx/gtk/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx
@@ -3913,6 +3913,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 );
@@ -4009,7 +4010,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 );
@@ -4023,6 +4023,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 908df09a4db3..86e039cca0aa 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2488,7 +2488,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetAppFont( aFont );
aStyleSet.SetHelpFont( aFont );
aStyleSet.SetMenuFont( aFont );
- aStyleSet.SetToolFont( aFont );
aStyleSet.SetLabelFont( aFont );
aStyleSet.SetRadioCheckFont( aFont );
aStyleSet.SetPushButtonFont( aFont );
@@ -2634,6 +2633,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 7fff8dfa26e1..de55f1bb05d3 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1914,6 +1914,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 be38c5908799..06a0abd7b9bc 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -233,6 +233,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 8257ec046dfa..42baae8ef715 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2658,6 +2658,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() );