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

Isamu Mogi saturday6c at gmail.com
Fri Mar 28 04:39:28 PDT 2014


 vcl/unx/generic/window/salframe.cxx           |    1 +
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx      |    2 +-
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |    2 +-
 vcl/unx/kde/salnativewidgets-kde.cxx          |    2 +-
 vcl/unx/kde4/KDESalFrame.cxx                  |    2 +-
 vcl/win/source/gdi/salnativewidgets-luna.cxx  |    5 +++--
 vcl/win/source/window/salframe.cxx            |   12 ++++++++++--
 7 files changed, 18 insertions(+), 8 deletions(-)

New commits:
commit 42877b3478074e64d14bf8ffc3b31cb3a2a86d87
Author: Isamu Mogi <saturday6c at gmail.com>
Date:   Sat Mar 22 11:51:08 2014 +0900

    fdo#68546 Make menubar's text color of persona the same as Firefox
    
    Change-Id: Ib9370f4b369f2baf29d118a1bbcd565bca005c30
    Reviewed-on: https://gerrit.libreoffice.org/8712
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index af6ce24..a292449 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2551,6 +2551,7 @@ void X11SalFrame::UpdateSettings( AllSettings& rSettings )
 {
     StyleSettings aStyleSettings = rSettings.GetStyleSettings();
     aStyleSettings.SetCursorBlinkTime( 500 );
+    aStyleSettings.SetMenuBarTextColor( aStyleSettings.GetPersonaMenuBarTextColor().get_value_or( Color( COL_BLACK ) ) );
     rSettings.SetStyleSettings( aStyleSettings );
 }
 
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 76e5d44..be7b35e 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3888,7 +3888,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
     aStyleSet.SetMenuColor( aBackColor );
     aStyleSet.SetMenuTextColor( aTextColor );
 
-    aTextColor = getColor( pMenubarStyle->fg[GTK_STATE_NORMAL] );
+    aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( pMenubarStyle->fg[GTK_STATE_NORMAL] ) );
     aStyleSet.SetMenuBarTextColor( aTextColor );
     aStyleSet.SetMenuBarRolloverTextColor( aTextColor );
 
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 311746d..9ddeda3 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1212,7 +1212,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
     aStyleSet.SetMenuBarRolloverColor( aBackColor );
 
     gtk_style_context_get_color( mpMenuBarStyle, GTK_STATE_FLAG_NORMAL, &text_color );
-    aTextColor = getColor( text_color );
+    aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( text_color ) );
     aStyleSet.SetMenuBarTextColor( aTextColor );
     aStyleSet.SetMenuBarRolloverTextColor( aTextColor );
 
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index f95740f..5e58799 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1982,7 +1982,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
         }
 
         aStyleSettings.SetMenuTextColor( aMenuFore );
-        aStyleSettings.SetMenuBarTextColor( aMenuFore );
+        aStyleSettings.SetMenuBarTextColor( aStyleSettings.GetPersonaMenuBarTextColor().get_value_or( aMenuFore ) );
         aStyleSettings.SetMenuColor( aMenuBack );
         aStyleSettings.SetMenuBarColor( aMenuBack );
         aStyleSettings.SetMenuHighlightColor( toColor ( qMenuCG.highlight() ) );
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 8afc217..25b092a 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -299,7 +299,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
         Color aMenuBack = toColor( qMenuCG.color( QPalette::Window ) );
 
         style.SetMenuTextColor( aMenuFore );
-        style.SetMenuBarTextColor( aMenuFore );
+        style.SetMenuBarTextColor( style.GetPersonaMenuBarTextColor().get_value_or( aMenuFore ) );
         style.SetMenuColor( aMenuBack );
         style.SetMenuBarColor( aMenuBack );
         style.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) );
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 67326b0..45d6c59 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -1517,12 +1517,13 @@ void WinSalGraphics::updateSettingsNative( AllSettings& rSettings )
     // FIXME get the color directly from the theme, not from the settings
     if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 )
     {
+        Color aMenuBarTextColor = aStyleSettings.GetPersonaMenuBarTextColor().get_value_or( aStyleSettings.GetMenuTextColor() );
         // in aero menuitem highlight text is drawn in the same color as normal
         aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() );
-        aStyleSettings.SetMenuBarRolloverTextColor( aStyleSettings.GetMenuTextColor() );
+        aStyleSettings.SetMenuBarRolloverTextColor( aMenuBarTextColor );
         pSVData->maNWFData.mnMenuFormatBorderX = 2;
         pSVData->maNWFData.mnMenuFormatBorderY = 2;
-        pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor();
+        pSVData->maNWFData.maMenuBarHighlightTextColor = aMenuBarTextColor;
         GetSalData()->mbThemeMenuSupport = TRUE;
     }
 
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index fa664cb..1aa8743 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2828,8 +2828,16 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
     aStyleSettings.SetUseFlatBorders( FALSE );
     aStyleSettings.SetUseFlatMenus( FALSE );
     aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
-    aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
-    aStyleSettings.SetMenuBarRolloverTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
+    if ( boost::optional<Color> aColor = aStyleSettings.GetPersonaMenuBarTextColor() )
+    {
+        aStyleSettings.SetMenuBarTextColor( *aColor );
+        aStyleSettings.SetMenuBarRolloverTextColor( *aColor );
+    }
+    else
+    {
+        aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+        aStyleSettings.SetMenuBarRolloverTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
+    }
     aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
     aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
     aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );


More information about the Libreoffice-commits mailing list