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

Cao Cuong Ngo cao.cuong.ngo at gmail.com
Thu Apr 4 04:26:12 PDT 2013


 vcl/source/app/settings.cxx |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 84e99bd79ab4fef7e91bd302d1426cf1b3653b7f
Author: Cao Cuong Ngo <cao.cuong.ngo at gmail.com>
Date:   Sat Mar 30 19:30:07 2013 +0100

    fdo#60542 Persona setting: change color of the text menu.
    
    Change-Id: I1d0ed94d41b3b8bcf0504e1528f4f505f817ad86
    Reviewed-on: https://gerrit.libreoffice.org/3127
    Reviewed-by: Jan Holesovsky <kendy at suse.cz>
    Tested-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index d8b1ce5..a237488 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -702,7 +702,7 @@ static BitmapEx readBitmapEx( const OUString& rPath )
 enum WhichPersona { PERSONA_HEADER, PERSONA_FOOTER };
 
 /** Update the setting of the Persona header / footer in ImplStyleData */
-static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFooter, BitmapEx& rHeaderFooterBitmap )
+static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFooter, BitmapEx& rHeaderFooterBitmap, Color& maMenuBarTextColor )
 {
     uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
     if ( !xContext.is() )
@@ -721,13 +721,20 @@ static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFoot
     rHeaderFooterBitmap = BitmapEx();
 
     // now read the new values and setup bitmaps
-    OUString aHeader, aFooter;
+    OUString aHeader, aFooter, aColor;
     if ( aPersona == "own" )
     {
         sal_Int32 nIndex = 0;
         aHeader = aPersonaSettings.getToken( 0, ';', nIndex );
         if ( nIndex > 0 )
             aFooter = aPersonaSettings.getToken( 0, ';', nIndex );
+
+        // change menu text color, advance nIndex to skip the '#'
+        if ( nIndex > 0 )
+        {
+            aColor = aPersonaSettings.getToken( 0, ';', ++nIndex );
+            maMenuBarTextColor = Color( aColor.toInt64( 16 ) );
+        }
     }
     else if ( aPersona == "default" )
     {
@@ -762,7 +769,7 @@ static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFoot
 
 const BitmapEx StyleSettings::GetPersonaHeader() const
 {
-    setupPersonaHeaderFooter( PERSONA_HEADER, mpData->maPersonaHeaderFooter, mpData->maPersonaHeaderBitmap );
+    setupPersonaHeaderFooter( PERSONA_HEADER, mpData->maPersonaHeaderFooter, mpData->maPersonaHeaderBitmap, mpData->maMenuBarTextColor );
     return mpData->maPersonaHeaderBitmap;
 }
 


More information about the Libreoffice-commits mailing list