[Libreoffice-commits] core.git: include/vcl vcl/source vcl/unx vcl/win

Caolán McNamara caolanm at redhat.com
Thu Nov 17 13:08:01 UTC 2016


 include/vcl/settings.hxx                  |    3 +++
 vcl/source/app/settings.cxx               |   17 +++++++++++++++++
 vcl/source/window/toolbox.cxx             |    2 +-
 vcl/unx/gtk/salnativewidgets-gtk.cxx      |    6 +++++-
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |   10 +++++++++-
 vcl/unx/kde/salnativewidgets-kde.cxx      |    1 +
 vcl/unx/kde4/KDESalFrame.cxx              |    1 +
 vcl/win/window/salframe.cxx               |    1 +
 8 files changed, 38 insertions(+), 3 deletions(-)

New commits:
commit b79cf88a048e5d8c784c97d99155104aef3d5dca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 17 13:04:58 2016 +0000

    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

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index fd28810..e8b7c0a 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 215a9e1..d9dbe57 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 e46d0da..2fe5869 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 2424ec3..5c70c1e 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 908df09..86e039c 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 7fff8df..de55f1b 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 be38c59..06a0abd 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 8257ec0..42baae8 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() );


More information about the Libreoffice-commits mailing list