summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bolen <db3l.net@gmail.com>2012-03-20 12:46:21 +0100
committerPetr Mladek <pmladek@suse.cz>2012-03-20 12:46:21 +0100
commit9876424a32439fb81a93f97900dda078c659c5e1 (patch)
treed89d6e591edab1cb38fa3c55b84163769616af18
parent1523e93bfc9a5d96fa519c801e904aab82a2b4d4 (diff)
Missing sub-menu arrows with 3.5.x and GTK < 2.15
Signed-off-by: Michael Meeks <michael.meeks@suse.com> Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 686c7846f85e..75e3c9460bcc 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1052,13 +1052,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 );