[Libreoffice-commits] core.git: include/vcl vcl/headless vcl/inc vcl/osx vcl/qt5 vcl/source vcl/unx vcl/win

Thorsten Wagner (via logerrit) logerrit at kemper.freedesktop.org
Fri Mar 6 19:36:55 UTC 2020


 include/vcl/settings.hxx                    |   31 ++++
 vcl/headless/CustomWidgetDraw.cxx           |   17 ++
 vcl/inc/WidgetThemeLibrary.hxx              |   12 +
 vcl/inc/widgetdraw/WidgetDefinition.hxx     |   12 +
 vcl/osx/salframe.cxx                        |   34 ++++
 vcl/qt5/Qt5Frame.cxx                        |   11 +
 vcl/source/app/settings.cxx                 |  192 ++++++++++++++++++++++++----
 vcl/source/control/button.cxx               |   86 +++++++-----
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx |   17 ++
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx   |    7 -
 vcl/win/window/salframe.cxx                 |   37 +++--
 11 files changed, 373 insertions(+), 83 deletions(-)

New commits:
commit 8d11b953c0a69f4f5eb5ca42dec3812a62d0cd0f
Author:     Thorsten Wagner <thorsten.wagner.4 at gmail.com>
AuthorDate: Sun Feb 23 21:11:05 2020 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri Mar 6 20:36:23 2020 +0100

    tdf#125532: White text on default/action buttons and selected tabs on macOS
    
    Change-Id: I58ce75e711504553c8fc606382866754286f1aa7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89313
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 347c861bc5aa..6adda0d66fa2 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -245,6 +245,9 @@ public:
     void                            SetDarkShadowColor( const Color& rColor );
     const Color&                    GetDarkShadowColor() const;
 
+    void                            SetDefaultButtonTextColor( const Color& rColor );
+    const Color&                    GetDefaultButtonTextColor() const;
+
     void                            SetButtonTextColor( const Color& rColor );
     const Color&                    GetButtonTextColor() const;
 
@@ -254,15 +257,39 @@ public:
     void                            SetActionButtonTextColor( const Color& rColor );
     const Color&                    GetActionButtonTextColor() const;
 
-    void                            SetActionButtonRolloverTextColor( const Color& rColor );
-    const Color&                    GetActionButtonRolloverTextColor() const;
+    void                            SetFlatButtonTextColor( const Color& rColor );
+    const Color&                    GetFlatButtonTextColor() const;
+
+    void                            SetDefaultButtonRolloverTextColor( const Color& rColor );
+    const Color&                    GetDefaultButtonRolloverTextColor() const;
 
     void                            SetButtonRolloverTextColor( const Color& rColor );
     const Color&                    GetButtonRolloverTextColor() const;
 
+    void                            SetDefaultActionButtonRolloverTextColor( const Color& rColor );
+    const Color&                    GetDefaultActionButtonRolloverTextColor() const;
+
+    void                            SetActionButtonRolloverTextColor( const Color& rColor );
+    const Color&                    GetActionButtonRolloverTextColor() const;
+
+    void                            SetFlatButtonRolloverTextColor( const Color& rColor );
+    const Color&                    GetFlatButtonRolloverTextColor() const;
+
+    void                            SetDefaultButtonPressedRolloverTextColor( const Color& rColor );
+    const Color&                    GetDefaultButtonPressedRolloverTextColor() const;
+
     void                            SetButtonPressedRolloverTextColor( const Color& rColor );
     const Color&                    GetButtonPressedRolloverTextColor() const;
 
+    void                            SetDefaultActionButtonPressedRolloverTextColor( const Color& rColor );
+    const Color&                    GetDefaultActionButtonPressedRolloverTextColor() const;
+
+    void                            SetActionButtonPressedRolloverTextColor( const Color& rColor );
+    const Color&                    GetActionButtonPressedRolloverTextColor() const;
+
+    void                            SetFlatButtonPressedRolloverTextColor( const Color& rColor );
+    const Color&                    GetFlatButtonPressedRolloverTextColor() const;
+
     void                            SetRadioCheckTextColor( const Color& rColor );
     const Color&                    GetRadioCheckTextColor() const;
 
diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx
index 343f5cd75a4e..600875d5c4ca 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -344,11 +344,26 @@ bool CustomWidgetDraw::updateSettings(AllSettings& rSettings)
         aStyleSet.SetLightBorderColor(aStyle.maLightBorderColor);
         aStyleSet.SetShadowColor(aStyle.maShadowColor);
         aStyleSet.SetDarkShadowColor(aStyle.maDarkShadowColor);
+        aStyleSet.SetDefaultButtonTextColor(aStyle.maDefaultButtonTextColor);
         aStyleSet.SetButtonTextColor(aStyle.maButtonTextColor);
-        aStyleSet.SetActionButtonTextColor(aStyle.maActionButtonTextColor);
         aStyleSet.SetDefaultActionButtonTextColor(aStyle.maDefaultActionButtonTextColor);
+        aStyleSet.SetActionButtonTextColor(aStyle.maActionButtonTextColor);
+        aStyleSet.SetFlatButtonTextColor(aStyle.maFlatButtonTextColor);
+        aStyleSet.SetDefaultButtonRolloverTextColor(aStyle.maDefaultButtonRolloverTextColor);
         aStyleSet.SetButtonRolloverTextColor(aStyle.maButtonRolloverTextColor);
+        aStyleSet.SetDefaultActionButtonRolloverTextColor(
+            aStyle.maDefaultActionButtonRolloverTextColor);
         aStyleSet.SetActionButtonRolloverTextColor(aStyle.maActionButtonRolloverTextColor);
+        aStyleSet.SetFlatButtonRolloverTextColor(aStyle.maFlatButtonRolloverTextColor);
+        aStyleSet.SetDefaultButtonPressedRolloverTextColor(
+            aStyle.maDefaultButtonPressedRolloverTextColor);
+        aStyleSet.SetButtonPressedRolloverTextColor(aStyle.maButtonPressedRolloverTextColor);
+        aStyleSet.SetDefaultActionButtonPressedRolloverTextColor(
+            aStyle.maDefaultActionButtonPressedRolloverTextColor);
+        aStyleSet.SetActionButtonPressedRolloverTextColor(
+            aStyle.maActionButtonPressedRolloverTextColor);
+        aStyleSet.SetFlatButtonPressedRolloverTextColor(
+            aStyle.maFlatButtonPressedRolloverTextColor);
         aStyleSet.SetRadioCheckTextColor(aStyle.maRadioCheckTextColor);
         aStyleSet.SetGroupTextColor(aStyle.maGroupTextColor);
         aStyleSet.SetLabelTextColor(aStyle.maLabelTextColor);
diff --git a/vcl/inc/WidgetThemeLibrary.hxx b/vcl/inc/WidgetThemeLibrary.hxx
index 404d93159aee..ace74a49a965 100644
--- a/vcl/inc/WidgetThemeLibrary.hxx
+++ b/vcl/inc/WidgetThemeLibrary.hxx
@@ -24,11 +24,21 @@ struct WidgetDrawStyle
     uint32_t maLightBorderColor;
     uint32_t maShadowColor;
     uint32_t maDarkShadowColor;
+    uint32_t maDefaultButtonTextColor;
     uint32_t maButtonTextColor;
     uint32_t maDefaultActionButtonTextColor;
     uint32_t maActionButtonTextColor;
-    uint32_t maActionButtonRolloverTextColor;
+    uint32_t maFlatButtonTextColor;
+    uint32_t maDefaultButtonRolloverTextColor;
     uint32_t maButtonRolloverTextColor;
+    uint32_t maDefaultActionButtonRolloverTextColor;
+    uint32_t maActionButtonRolloverTextColor;
+    uint32_t maFlatButtonRolloverTextColor;
+    uint32_t maDefaultButtonPressedRolloverTextColor;
+    uint32_t maButtonPressedRolloverTextColor;
+    uint32_t maDefaultActionButtonPressedRolloverTextColor;
+    uint32_t maActionButtonPressedRolloverTextColor;
+    uint32_t maFlatButtonPressedRolloverTextColor;
     uint32_t maRadioCheckTextColor;
     uint32_t maGroupTextColor;
     uint32_t maLabelTextColor;
diff --git a/vcl/inc/widgetdraw/WidgetDefinition.hxx b/vcl/inc/widgetdraw/WidgetDefinition.hxx
index 7e451bbe8834..cc3eb6606557 100644
--- a/vcl/inc/widgetdraw/WidgetDefinition.hxx
+++ b/vcl/inc/widgetdraw/WidgetDefinition.hxx
@@ -223,11 +223,21 @@ public:
     Color maLightBorderColor;
     Color maShadowColor;
     Color maDarkShadowColor;
+    Color maDefaultButtonTextColor;
     Color maButtonTextColor;
     Color maDefaultActionButtonTextColor;
     Color maActionButtonTextColor;
-    Color maActionButtonRolloverTextColor;
+    Color maFlatButtonTextColor;
+    Color maDefaultButtonRolloverTextColor;
     Color maButtonRolloverTextColor;
+    Color maDefaultActionButtonRolloverTextColor;
+    Color maActionButtonRolloverTextColor;
+    Color maFlatButtonRolloverTextColor;
+    Color maDefaultButtonPressedRolloverTextColor;
+    Color maButtonPressedRolloverTextColor;
+    Color maDefaultActionButtonPressedRolloverTextColor;
+    Color maActionButtonPressedRolloverTextColor;
+    Color maFlatButtonPressedRolloverTextColor;
     Color maRadioCheckTextColor;
     Color maGroupTextColor;
     Color maLabelTextColor;
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index dc012aa1d07b..9539fb26401d 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1090,13 +1090,13 @@ OUString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
     if( it != aKeyMap.end() )
     {
         if( (nKeyCode & KEY_SHIFT) != 0 )
-            aResult.append( u'\x21e7' ); //⇧
+            aResult.append( u'\x21e7' ); // shift
         if( (nKeyCode & KEY_MOD1) != 0 )
-            aResult.append( u'\x2318' ); //⌘
+            aResult.append( u'\x2318' ); // command
         if( (nKeyCode & KEY_MOD2) != 0 )
-            aResult.append( u'\x2325' ); //⌥
+            aResult.append( u'\x2325' ); // alternate
         if( (nKeyCode & KEY_MOD3) != 0 )
-            aResult.append( u'\x2303' ); //⌃
+            aResult.append( u'\x2303' ); // control
 
         aResult.append( it->second );
     }
@@ -1280,6 +1280,32 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     aStyleSettings.SetMenuBarRolloverTextColor( aMenuTextColor );
     aStyleSettings.SetMenuBarHighlightTextColor(aStyleSettings.GetMenuHighlightTextColor());
 
+    // Set text colors for buttons and their different status according to OS settings, typically white for selected buttons,
+    // black otherwise
+
+    Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, mpNSWindow));
+    Color aSelectedControlTextColor(getColor([NSColor alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
+    aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetButtonTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultActionButtonTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetActionButtonTextColor(aControlTextColor);
+    aStyleSettings.SetFlatButtonTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultButtonRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetButtonRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultActionButtonRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetButtonPressedRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
+
+    // Set text colors for tabs according to OS settings, typically white for selected buttons, black otherwise
+
+    aStyleSettings.SetTabTextColor(aControlTextColor);
+    aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+
     aStyleSettings.SetCursorBlinkTime( 500 );
 
     // no mnemonics on macOS
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 8f1594240f46..722dca9467db 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -1033,12 +1033,21 @@ void Qt5Frame::UpdateSettings(AllSettings& rSettings)
     style.SetActiveTabColor(aBase);
 
     // Buttons
+    style.SetDefaultButtonTextColor(aButn);
     style.SetButtonTextColor(aButn);
     style.SetDefaultActionButtonTextColor(aButn);
     style.SetActionButtonTextColor(aButn);
-    style.SetActionButtonRolloverTextColor(aButn);
+    style.SetFlatButtonTextColor(aButn);
+    style.SetDefaultButtonRolloverTextColor(aButn);
     style.SetButtonRolloverTextColor(aButn);
+    style.SetDefaultActionButtonRolloverTextColor(aButn);
+    style.SetActionButtonRolloverTextColor(aButn);
+    style.SetFlatButtonRolloverTextColor(aButn);
+    style.SetDefaultButtonPressedRolloverTextColor(aButn);
     style.SetButtonPressedRolloverTextColor(aButn);
+    style.SetDefaultActionButtonPressedRolloverTextColor(aButn);
+    style.SetActionButtonPressedRolloverTextColor(aButn);
+    style.SetFlatButtonPressedRolloverTextColor(aButn);
 
     // Tabs
     style.SetTabTextColor(aButn);
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 4adc9328a161..f54f05814258 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -81,12 +81,21 @@ struct ImplStyleData
     Color                           maActiveColor;
     Color                           maActiveTextColor;
     Color                           maAlternatingRowColor;
+    Color                           maDefaultButtonTextColor;
     Color                           maButtonTextColor;
     Color                           maDefaultActionButtonTextColor;
     Color                           maActionButtonTextColor;
-    Color                           maActionButtonRolloverTextColor;
+    Color                           maFlatButtonTextColor;
+    Color                           maDefaultButtonRolloverTextColor;
     Color                           maButtonRolloverTextColor;
+    Color                           maDefaultActionButtonRolloverTextColor;
+    Color                           maActionButtonRolloverTextColor;
+    Color                           maFlatButtonRolloverTextColor;
+    Color                           maDefaultButtonPressedRolloverTextColor;
     Color                           maButtonPressedRolloverTextColor;
+    Color                           maDefaultActionButtonPressedRolloverTextColor;
+    Color                           maActionButtonPressedRolloverTextColor;
+    Color                           maFlatButtonPressedRolloverTextColor;
     Color                           maCheckedColor;
     Color                           maDarkShadowColor;
     Color                           maDeactiveBorderColor;
@@ -492,12 +501,21 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
     maActiveColor( rData.maActiveColor ),
     maActiveTextColor( rData.maActiveTextColor ),
     maAlternatingRowColor( rData.maAlternatingRowColor ),
+    maDefaultButtonTextColor( rData.maDefaultButtonTextColor ),
     maButtonTextColor( rData.maButtonTextColor ),
     maDefaultActionButtonTextColor( rData.maDefaultActionButtonTextColor ),
     maActionButtonTextColor( rData.maActionButtonTextColor ),
-    maActionButtonRolloverTextColor( rData.maActionButtonRolloverTextColor ),
+    maFlatButtonTextColor( rData.maFlatButtonTextColor ),
+    maDefaultButtonRolloverTextColor( rData.maDefaultButtonRolloverTextColor ),
     maButtonRolloverTextColor( rData.maButtonRolloverTextColor ),
+    maDefaultActionButtonRolloverTextColor( rData.maDefaultActionButtonRolloverTextColor ),
+    maActionButtonRolloverTextColor( rData.maActionButtonRolloverTextColor ),
+    maFlatButtonRolloverTextColor( rData.maFlatButtonRolloverTextColor ),
+    maDefaultButtonPressedRolloverTextColor( rData.maDefaultButtonPressedRolloverTextColor ),
     maButtonPressedRolloverTextColor( rData.maButtonPressedRolloverTextColor ),
+    maDefaultActionButtonPressedRolloverTextColor( rData.maDefaultActionButtonPressedRolloverTextColor ),
+    maActionButtonPressedRolloverTextColor( rData.maActionButtonPressedRolloverTextColor ),
+    maFlatButtonPressedRolloverTextColor( rData.maFlatButtonPressedRolloverTextColor ),
     maCheckedColor( rData.maCheckedColor ),
     maDarkShadowColor( rData.maDarkShadowColor ),
     maDeactiveBorderColor( rData.maDeactiveBorderColor ),
@@ -632,12 +650,23 @@ void ImplStyleData::SetStandardStyles()
     maLightBorderColor          = COL_LIGHTGRAY;
     maShadowColor               = COL_GRAY;
     maDarkShadowColor           = COL_BLACK;
-    maButtonTextColor           = COL_BLACK;
-    maDefaultActionButtonTextColor = COL_BLACK;
-    maActionButtonTextColor     = COL_BLACK;
-    maActionButtonRolloverTextColor = COL_BLACK;
-    maButtonRolloverTextColor   = COL_BLACK;
-    maButtonPressedRolloverTextColor = COL_BLACK;
+
+    maDefaultButtonTextColor                      = COL_BLACK;
+    maButtonTextColor                             = COL_BLACK;
+    maDefaultActionButtonTextColor                = COL_BLACK;
+    maActionButtonTextColor                       = COL_BLACK;
+    maFlatButtonTextColor                         = COL_BLACK;
+    maDefaultButtonRolloverTextColor              = COL_BLACK;
+    maButtonRolloverTextColor                     = COL_BLACK;
+    maDefaultActionButtonRolloverTextColor        = COL_BLACK;
+    maActionButtonRolloverTextColor               = COL_BLACK;
+    maFlatButtonRolloverTextColor                 = COL_BLACK;
+    maDefaultButtonPressedRolloverTextColor       = COL_BLACK;
+    maButtonPressedRolloverTextColor              = COL_BLACK;
+    maDefaultActionButtonPressedRolloverTextColor = COL_BLACK;
+    maActionButtonPressedRolloverTextColor        = COL_BLACK;
+    maFlatButtonPressedRolloverTextColor          = COL_BLACK;
+
     maRadioCheckTextColor       = COL_BLACK;
     maGroupTextColor            = COL_BLACK;
     maLabelTextColor            = COL_BLACK;
@@ -683,18 +712,18 @@ void ImplStyleData::SetStandardStyles()
     maFontColor                 = COL_BLACK;
     maAlternatingRowColor       = Color( 0xEE, 0xEE, 0xEE );
 
-    mnTitleHeight               = 18;
-    mnFloatTitleHeight          = 13;
-    mbHighContrast              = false;
-    mbUseSystemUIFonts          = true;
-    mbUseFontAAFromSystem = true;
-    mnUseFlatBorders            = false;
-    mnUseFlatMenus              = false;
-    mbPreferredUseImagesInMenus = true;
-    mbSkipDisabledInMenus       = false;
-    mbHideDisabledMenuItems     = false;
+    mnTitleHeight                   = 18;
+    mnFloatTitleHeight              = 13;
+    mbHighContrast                  = false;
+    mbUseSystemUIFonts              = true;
+    mbUseFontAAFromSystem           = true;
+    mnUseFlatBorders                = false;
+    mnUseFlatMenus                  = false;
+    mbPreferredUseImagesInMenus     = true;
+    mbSkipDisabledInMenus           = false;
+    mbHideDisabledMenuItems         = false;
     mbPreferredContextMenuShortcuts = true;
-    mbPrimaryButtonWarpsSlider = false;
+    mbPrimaryButtonWarpsSlider      = false;
 }
 
 StyleSettings::StyleSettings()
@@ -780,6 +809,19 @@ StyleSettings::GetDarkShadowColor() const
     return mxData->maDarkShadowColor;
 }
 
+void
+StyleSettings::SetDefaultButtonTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maDefaultButtonTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetDefaultButtonTextColor() const
+{
+    return mxData->maDefaultButtonTextColor;
+}
+
 void
 StyleSettings::SetButtonTextColor( const Color& rColor )
 {
@@ -820,16 +862,29 @@ StyleSettings::GetActionButtonTextColor() const
 }
 
 void
-StyleSettings::SetActionButtonRolloverTextColor( const Color& rColor )
+StyleSettings::SetFlatButtonTextColor( const Color& rColor )
 {
     CopyData();
-    mxData->maActionButtonRolloverTextColor = rColor;
+    mxData->maFlatButtonTextColor = rColor;
 }
 
 const Color&
-StyleSettings::GetActionButtonRolloverTextColor() const
+StyleSettings::GetFlatButtonTextColor() const
 {
-    return mxData->maActionButtonRolloverTextColor;
+    return mxData->maFlatButtonTextColor;
+}
+
+void
+StyleSettings::SetDefaultButtonRolloverTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maDefaultButtonRolloverTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetDefaultButtonRolloverTextColor() const
+{
+    return mxData->maDefaultButtonRolloverTextColor;
 }
 
 void
@@ -845,6 +900,58 @@ StyleSettings::GetButtonRolloverTextColor() const
     return mxData->maButtonRolloverTextColor;
 }
 
+void
+StyleSettings::SetDefaultActionButtonRolloverTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maDefaultActionButtonRolloverTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetDefaultActionButtonRolloverTextColor() const
+{
+    return mxData->maDefaultActionButtonRolloverTextColor;
+}
+
+void
+StyleSettings::SetActionButtonRolloverTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maActionButtonRolloverTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetActionButtonRolloverTextColor() const
+{
+    return mxData->maActionButtonRolloverTextColor;
+}
+
+void
+StyleSettings::SetFlatButtonRolloverTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maFlatButtonRolloverTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetFlatButtonRolloverTextColor() const
+{
+    return mxData->maFlatButtonRolloverTextColor;
+}
+
+void
+StyleSettings::SetDefaultButtonPressedRolloverTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maDefaultButtonPressedRolloverTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetDefaultButtonPressedRolloverTextColor() const
+{
+    return mxData->maDefaultButtonPressedRolloverTextColor;
+}
+
 void
 StyleSettings::SetButtonPressedRolloverTextColor( const Color& rColor )
 {
@@ -858,6 +965,45 @@ StyleSettings::GetButtonPressedRolloverTextColor() const
     return mxData->maButtonPressedRolloverTextColor;
 }
 
+void
+StyleSettings::SetDefaultActionButtonPressedRolloverTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maDefaultActionButtonPressedRolloverTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetDefaultActionButtonPressedRolloverTextColor() const
+{
+    return mxData->maDefaultActionButtonPressedRolloverTextColor;
+}
+
+void
+StyleSettings::SetActionButtonPressedRolloverTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maActionButtonPressedRolloverTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetActionButtonPressedRolloverTextColor() const
+{
+    return mxData->maActionButtonPressedRolloverTextColor;
+}
+
+void
+StyleSettings::SetFlatButtonPressedRolloverTextColor( const Color& rColor )
+{
+    CopyData();
+    mxData->maFlatButtonPressedRolloverTextColor = rColor;
+}
+
+const Color&
+StyleSettings::GetFlatButtonPressedRolloverTextColor() const
+{
+    return mxData->maFlatButtonPressedRolloverTextColor;
+}
+
 void
 StyleSettings::SetRadioCheckTextColor( const Color& rColor )
 {
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index cee637ee8e03..e859625f6d63 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -733,51 +733,67 @@ DrawTextFlags PushButton::ImplGetTextStyle( DrawFlags nDrawFlags ) const
     return nTextStyle;
 }
 
-void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFlags,
-                                           const tools::Rectangle& rRect, bool bMenuBtnSep,
+void PushButton::ImplDrawPushButtonContent(OutputDevice *pDev, DrawFlags nDrawFlags,
+                                           const tools::Rectangle &rRect, bool bMenuBtnSep,
                                            DrawButtonFlags nButtonFlags)
 {
-    const StyleSettings&    rStyleSettings = GetSettings().GetStyleSettings();
-    tools::Rectangle               aInRect = rRect;
-    Color                   aColor;
-    DrawTextFlags           nTextStyle = ImplGetTextStyle( nDrawFlags );
-    DrawSymbolFlags         nStyle;
+    const StyleSettings &rStyleSettings = GetSettings().GetStyleSettings();
+    tools::Rectangle aInRect = rRect;
+    Color aColor;
+    DrawTextFlags nTextStyle = ImplGetTextStyle(nDrawFlags);
+    DrawSymbolFlags nStyle;
 
-    if( aInRect.Right() < aInRect.Left() || aInRect.Bottom() < aInRect.Top() )
-        return; // nothing to do
+    if (aInRect.Right() < aInRect.Left() || aInRect.Bottom() < aInRect.Top())
+        return;
 
-    pDev->Push( PushFlags::CLIPREGION );
-    pDev->IntersectClipRegion( aInRect );
+    pDev->Push(PushFlags::CLIPREGION);
+    pDev->IntersectClipRegion(aInRect);
 
-    if ( nDrawFlags & DrawFlags::Mono )
+    if (nDrawFlags & DrawFlags::Mono)
         aColor = COL_BLACK;
-    else if( (nButtonFlags & DrawButtonFlags::Highlight) && IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire) )
-    {
-        if (nButtonFlags & DrawButtonFlags::Pressed)
-            aColor = rStyleSettings.GetButtonPressedRolloverTextColor();
-        else
-            aColor = isAction() ? rStyleSettings.GetActionButtonRolloverTextColor()
-                                : rStyleSettings.GetButtonRolloverTextColor();
-    }
-    else if ( IsControlForeground() )
-        aColor = GetControlForeground();
-    else if( nButtonFlags & DrawButtonFlags::Highlight )
-    {
+
+    // Button types with possibly different text coloring are flat buttons and regular buttons. Regular buttons may be action
+    // buttons and may have an additional default status. Moreover all buttons may have an additional pressed and rollover
+    // (highlight) status. Pressed buttons are always in rollover status.
+
+    else if (GetStyle() & WB_FLATBUTTON)
         if (nButtonFlags & DrawButtonFlags::Pressed)
-            aColor = rStyleSettings.GetButtonPressedRolloverTextColor();
+            aColor = rStyleSettings.GetFlatButtonPressedRolloverTextColor();
+        else if (nButtonFlags & DrawButtonFlags::Highlight)
+            aColor = rStyleSettings.GetFlatButtonRolloverTextColor();
         else
-            aColor = isAction() ? rStyleSettings.GetActionButtonRolloverTextColor()
-                                : rStyleSettings.GetButtonRolloverTextColor();
-    }
+            aColor = rStyleSettings.GetFlatButtonTextColor();
     else
-    {
-        aColor = isAction() ? ((GetButtonState() & DrawButtonFlags::Default)
-                                   ? rStyleSettings.GetDefaultActionButtonTextColor()
-                                   : rStyleSettings.GetActionButtonTextColor())
-                            : rStyleSettings.GetButtonTextColor();
-    }
+        if (isAction() && (nButtonFlags & DrawButtonFlags::Default))
+            if (nButtonFlags & DrawButtonFlags::Pressed)
+                aColor = rStyleSettings.GetDefaultActionButtonPressedRolloverTextColor();
+            else if (nButtonFlags & DrawButtonFlags::Highlight)
+                aColor = rStyleSettings.GetDefaultActionButtonRolloverTextColor();
+            else
+                aColor = rStyleSettings.GetDefaultActionButtonTextColor();
+        else if (isAction())
+            if (nButtonFlags & DrawButtonFlags::Pressed)
+                aColor = rStyleSettings.GetActionButtonPressedRolloverTextColor();
+            else if (nButtonFlags & DrawButtonFlags::Highlight)
+                aColor = rStyleSettings.GetActionButtonRolloverTextColor();
+            else
+                aColor = rStyleSettings.GetActionButtonTextColor();
+        else if (nButtonFlags & DrawButtonFlags::Default)
+            if (nButtonFlags & DrawButtonFlags::Pressed)
+                aColor = rStyleSettings.GetDefaultButtonPressedRolloverTextColor();
+            else if (nButtonFlags & DrawButtonFlags::Highlight)
+                aColor = rStyleSettings.GetDefaultButtonRolloverTextColor();
+            else
+                aColor = rStyleSettings.GetDefaultButtonTextColor();
+        else
+            if (nButtonFlags & DrawButtonFlags::Pressed)
+                aColor = rStyleSettings.GetButtonPressedRolloverTextColor();
+            else if (nButtonFlags & DrawButtonFlags::Highlight)
+                aColor = rStyleSettings.GetButtonRolloverTextColor();
+            else
+                aColor = rStyleSettings.GetButtonTextColor();
 
-    pDev->SetTextColor( aColor );
+    pDev->SetTextColor(aColor);
 
     if ( IsEnabled() )
         nStyle = DrawSymbolFlags::NONE;
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 747c0543c20e..80bcda56b2a6 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -975,11 +975,26 @@ bool FileDefinitionWidgetDraw::updateSettings(AllSettings& rSettings)
     aStyleSet.SetLightBorderColor(pDefinitionStyle->maLightBorderColor);
     aStyleSet.SetShadowColor(pDefinitionStyle->maShadowColor);
     aStyleSet.SetDarkShadowColor(pDefinitionStyle->maDarkShadowColor);
+    aStyleSet.SetDefaultButtonTextColor(pDefinitionStyle->maDefaultButtonTextColor);
     aStyleSet.SetButtonTextColor(pDefinitionStyle->maButtonTextColor);
     aStyleSet.SetDefaultActionButtonTextColor(pDefinitionStyle->maDefaultActionButtonTextColor);
     aStyleSet.SetActionButtonTextColor(pDefinitionStyle->maActionButtonTextColor);
-    aStyleSet.SetActionButtonRolloverTextColor(pDefinitionStyle->maActionButtonRolloverTextColor);
+    aStyleSet.SetFlatButtonTextColor(pDefinitionStyle->maFlatButtonTextColor);
+    aStyleSet.SetDefaultButtonRolloverTextColor(pDefinitionStyle->maDefaultButtonRolloverTextColor);
     aStyleSet.SetButtonRolloverTextColor(pDefinitionStyle->maButtonRolloverTextColor);
+    aStyleSet.SetDefaultActionButtonRolloverTextColor(
+        pDefinitionStyle->maDefaultActionButtonRolloverTextColor);
+    aStyleSet.SetActionButtonRolloverTextColor(pDefinitionStyle->maActionButtonRolloverTextColor);
+    aStyleSet.SetFlatButtonRolloverTextColor(pDefinitionStyle->maFlatButtonRolloverTextColor);
+    aStyleSet.SetDefaultButtonPressedRolloverTextColor(
+        pDefinitionStyle->maDefaultButtonPressedRolloverTextColor);
+    aStyleSet.SetButtonPressedRolloverTextColor(pDefinitionStyle->maButtonPressedRolloverTextColor);
+    aStyleSet.SetDefaultActionButtonPressedRolloverTextColor(
+        pDefinitionStyle->maDefaultActionButtonPressedRolloverTextColor);
+    aStyleSet.SetActionButtonPressedRolloverTextColor(
+        pDefinitionStyle->maActionButtonPressedRolloverTextColor);
+    aStyleSet.SetFlatButtonPressedRolloverTextColor(
+        pDefinitionStyle->maFlatButtonPressedRolloverTextColor);
     aStyleSet.SetRadioCheckTextColor(pDefinitionStyle->maRadioCheckTextColor);
     aStyleSet.SetGroupTextColor(pDefinitionStyle->maGroupTextColor);
     aStyleSet.SetLabelTextColor(pDefinitionStyle->maLabelTextColor);
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 95750805ac4f..1a1a334d1439 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -3030,10 +3030,13 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings)
     // mouse over text colors
     style_context_set_state(pStyle, GTK_STATE_FLAG_PRELIGHT);
     gtk_style_context_get_color(pStyle, gtk_style_context_get_state(pStyle), &text_color);
-    aTextColor = getColor( text_color );
+    aTextColor = getColor(text_color);
+    aStyleSet.SetDefaultButtonRolloverTextColor(aTextColor);
     aStyleSet.SetButtonRolloverTextColor(aTextColor);
+    aStyleSet.SetDefaultActionButtonRolloverTextColor(aTextColor);
     aStyleSet.SetActionButtonRolloverTextColor(aTextColor);
-    aStyleSet.SetFieldRolloverTextColor( aTextColor );
+    aStyleSet.SetFlatButtonRolloverTextColor(aTextColor);
+    aStyleSet.SetFieldRolloverTextColor(aTextColor);
 
     aContextState.restore();
 
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 2a125deeddab..a9a30b71086d 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2597,18 +2597,31 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
     aStyleSettings.SetHelpColor( ImplWinColorToSal( GetSysColor( COLOR_INFOBK ) ) );
     aStyleSettings.SetHelpTextColor( ImplWinColorToSal( GetSysColor( COLOR_INFOTEXT ) ) );
 
-    aStyleSettings.SetDialogColor( aStyleSettings.GetFaceColor() );
-
-    aStyleSettings.SetDialogTextColor( aStyleSettings.GetButtonTextColor() );
-    aStyleSettings.SetButtonTextColor( ImplWinColorToSal( GetSysColor( COLOR_BTNTEXT ) ) );
-    aStyleSettings.SetDefaultActionButtonTextColor( ImplWinColorToSal( GetSysColor( COLOR_BTNTEXT ) ) );
-    aStyleSettings.SetActionButtonTextColor( aStyleSettings.GetDefaultActionButtonTextColor() );
-    aStyleSettings.SetActionButtonRolloverTextColor( aStyleSettings.GetActionButtonTextColor() );
-    aStyleSettings.SetButtonRolloverTextColor( aStyleSettings.GetButtonTextColor() );
-    aStyleSettings.SetButtonPressedRolloverTextColor( aStyleSettings.GetButtonTextColor() );
-    aStyleSettings.SetTabTextColor( aStyleSettings.GetButtonTextColor() );
-    aStyleSettings.SetTabRolloverTextColor( aStyleSettings.GetButtonTextColor() );
-    aStyleSettings.SetTabHighlightTextColor( aStyleSettings.GetButtonTextColor() );
+    Color aControlTextColor(ImplWinColorToSal(GetSysColor(COLOR_BTNTEXT)));
+
+    aStyleSettings.SetDialogColor(aStyleSettings.GetFaceColor());
+    aStyleSettings.SetDialogTextColor(aControlTextColor);
+
+    aStyleSettings.SetDefaultButtonTextColor(aControlTextColor);
+    aStyleSettings.SetButtonTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultActionButtonTextColor(aControlTextColor);
+    aStyleSettings.SetActionButtonTextColor(aControlTextColor);
+    aStyleSettings.SetFlatButtonTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultButtonRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetButtonRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultActionButtonRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetButtonPressedRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetActionButtonPressedRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
+
+    aStyleSettings.SetTabTextColor(aControlTextColor);
+    aStyleSettings.SetTabRolloverTextColor(aControlTextColor);
+    aStyleSettings.SetTabHighlightTextColor(aControlTextColor);
+
     aStyleSettings.SetRadioCheckTextColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOWTEXT ) ) );
     aStyleSettings.SetGroupTextColor( aStyleSettings.GetRadioCheckTextColor() );
     aStyleSettings.SetLabelTextColor( aStyleSettings.GetRadioCheckTextColor() );


More information about the Libreoffice-commits mailing list