[Libreoffice-commits] .: vcl/unx

Jan Holesovsky kendy at kemper.freedesktop.org
Mon Dec 20 09:10:28 PST 2010


 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 3a1a1a05cc6e4035b500c2f407f0402ea3c0ba28
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Dec 20 18:06:30 2010 +0100

    gtk: Use the right padding in the menus, bnc#304620
    
    This is not 100% perfect, it sets even the vertical padding to this
    value, but better than hardcoded '1' ;-)

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 6ad43ac..f7a1cf2 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -403,9 +403,6 @@ void GtkData::initNWF( void )
     // draw separate buttons for toolbox dropdown items
     pSVData->maNWFData.mbToolboxDropDownSeparate = true;
 
-    // small extra border around menu items
-    pSVData->maNWFData.mnMenuFormatExtraBorder = 1;
-
     // draw toolbars in separate lines
     pSVData->maNWFData.mbDockingAreaSeparateTB = true;
 
@@ -420,6 +417,14 @@ void GtkData::initNWF( void )
     for( int i = 0; i < nScreens; i++ )
         gWidgetData[i].gNWPixmapCacheList = new NWPixmapCacheList;
 
+    // small extra border around menu items
+    NWEnsureGTKMenu( 0 );
+    gint horizontal_padding = 1;
+    gtk_widget_style_get( gWidgetData[0].gMenuItemMenuWidget,
+            "horizontal_padding", &horizontal_padding,
+            (char *)NULL);
+    pSVData->maNWFData.mnMenuFormatExtraBorder = horizontal_padding;
+
     if( SalGetDesktopEnvironment().equalsAscii( "KDE" ) )
     {
         // #i97196# ensure a widget exists and the style engine was loaded


More information about the Libreoffice-commits mailing list