[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - include/vcl vcl/source vcl/unx vcl/win

Caolán McNamara caolanm at redhat.com
Thu Nov 24 12:01:34 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 1439b3499ced0f1131af8e0de107e96d8aac4039
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 17 13:04:58 2016 +0000

    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 at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index acbacf3..b8e7f94 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 cb84dbe..592d85b 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 3344532..c6aa12d 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 95af7fe..a1c3e05 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 d1f24dd..60fc82d 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 e9c1f90..1f53874 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 1d945a5..a9ec1e8 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 6b5fa26..a6f1009 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() );


More information about the Libreoffice-commits mailing list