[Libreoffice-commits] .: vcl/unx

Petr Mladek pmladek at kemper.freedesktop.org
Tue Mar 20 04:49:45 PDT 2012


 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit fd205e95ad1bc1dca319900311b47e589e06e9f1
Author: David Bolen <db3l.net at gmail.com>
Date:   Tue Mar 20 12:46:21 2012 +0100

    Missing sub-menu arrows with 3.5.x and GTK < 2.15
    
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 6669a97..0b723e1 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1027,13 +1027,21 @@ sal_Bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
             gint arrow_size;
             gint arrow_extent;
             guint horizontal_padding;
-            gfloat arrow_scaling;
+            gfloat arrow_scaling = 0.4; // Default for early GTK versions
 
             gtk_widget_style_get( widget,
                                   "horizontal-padding", &horizontal_padding,
-                                  "arrow-scaling", &arrow_scaling,
                                   NULL );
 
+            // Use arrow-scaling property if available (2.15+), avoid warning otherwise
+            if ( gtk_widget_class_find_style_property( GTK_WIDGET_GET_CLASS( widget ),
+                                                       "arrow-scaling" ) )
+            {
+                gtk_widget_style_get( widget,
+                                      "arrow-scaling", &arrow_scaling,
+                                      NULL );
+            }
+
             child = GTK_BIN( widget )->child;
 
             context = gtk_widget_get_pango_context( child );


More information about the Libreoffice-commits mailing list