[Libreoffice-commits] .: vcl/unx

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Sat May 5 03:38:48 PDT 2012


 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

New commits:
commit c1ac12f52776c625c7a091ab864b9e99e3bc3d67
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Sat May 5 14:34:47 2012 +0400

    gtk: fix drawing of disabled menu-item checkmarks and submenu arrows
    
    Change-Id: Ic9929de974b1dd806dee294e574ad9f561468eb4

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 447ca92..7c06d6a 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -2851,19 +2851,15 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
                                  gWidgetData[m_nXScreen].gMenuItemCheckMenuWidget :
                                  gWidgetData[m_nXScreen].gMenuItemRadioMenuWidget;
 
-            GtkStateType nStateType = GTK_STATE_NORMAL;
+            GtkStateType nStateType;
             GtkShadowType nShadowType;
+            NWConvertVCLStateToGTKState( nState, &nStateType, &nShadowType );
 
-            if ( nState & CTRL_STATE_SELECTED )
+            if ( (nState & CTRL_STATE_SELECTED) && (nState & CTRL_STATE_ENABLED) )
                 nStateType = GTK_STATE_PRELIGHT;
 
             NWSetWidgetState( pWidget, nState, nStateType );
 
-            if ( nState & CTRL_STATE_PRESSED )
-                nShadowType = GTK_SHADOW_IN;
-            else
-                nShadowType = GTK_SHADOW_OUT;
-
             if ( nPart == PART_MENU_ITEM_CHECK_MARK )
             {
                 gtk_paint_check( pWidget->style,
@@ -2899,20 +2895,16 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
         }
         else if( nPart == PART_MENU_SUBMENU_ARROW )
         {
-            GtkStateType nStateType = GTK_STATE_NORMAL;
+            GtkStateType nStateType;
             GtkShadowType nShadowType;
+            NWConvertVCLStateToGTKState( nState, &nStateType, &nShadowType );
 
-            if ( nState & CTRL_STATE_SELECTED )
+            if ( (nState & CTRL_STATE_SELECTED) && (nState & CTRL_STATE_ENABLED) )
                 nStateType = GTK_STATE_PRELIGHT;
 
             NWSetWidgetState( gWidgetData[m_nXScreen].gMenuItemMenuWidget,
                               nState, nStateType );
 
-            if ( nState & CTRL_STATE_PRESSED )
-                nShadowType = GTK_SHADOW_IN;
-            else
-                nShadowType = GTK_SHADOW_OUT;
-
             GtkArrowType eArrow;
             if( Application::GetSettings().GetLayoutRTL() )
                 eArrow = GTK_ARROW_LEFT;


More information about the Libreoffice-commits mailing list