diff options
author | trav90 <travawine@protonmail.ch> | 2018-04-06 10:37:03 -0500 |
---|---|---|
committer | trav90 <travawine@protonmail.ch> | 2018-04-06 10:37:03 -0500 |
commit | 50217bd546fc2cc5486856559090d8f69bc9d4fc (patch) | |
tree | 8a1c48bb7c90a766a0b577f9728bb43c8461e984 /widget | |
parent | d75e9071f11fe7ad2cb1271a002326d2d71c075d (diff) | |
download | uxp-50217bd546fc2cc5486856559090d8f69bc9d4fc.tar.gz |
[GTK3] For Gtk > 3.20 determine scale trough size from trough CSS node and also add border/padding/margin
Diffstat (limited to 'widget')
-rw-r--r-- | widget/gtk/gtk3drawing.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/widget/gtk/gtk3drawing.cpp b/widget/gtk/gtk3drawing.cpp index 351c7c6548..6b0f9cddc0 100644 --- a/widget/gtk/gtk3drawing.cpp +++ b/widget/gtk/gtk3drawing.cpp @@ -2500,11 +2500,11 @@ void moz_gtk_get_scale_metrics(GtkOrientation orient, gint* scale_width, gint* scale_height) { - WidgetNodeType widget = (orient == GTK_ORIENTATION_HORIZONTAL) ? - MOZ_GTK_SCALE_HORIZONTAL : - MOZ_GTK_SCALE_VERTICAL; - if (gtk_check_version(3, 20, 0) != nullptr) { + WidgetNodeType widget = (orient == GTK_ORIENTATION_HORIZONTAL) ? + MOZ_GTK_SCALE_HORIZONTAL : + MOZ_GTK_SCALE_VERTICAL; + gint thumb_length, thumb_height, trough_border; moz_gtk_get_scalethumb_metrics(orient, &thumb_length, &thumb_height); @@ -2520,12 +2520,10 @@ moz_gtk_get_scale_metrics(GtkOrientation orient, gint* scale_width, } ReleaseStyleContext(style); } else { - GtkStyleContext* style = ClaimStyleContext(widget); - gtk_style_context_get(style, gtk_style_context_get_state(style), - "min-width", scale_width, - "min-height", scale_height, - nullptr); - ReleaseStyleContext(style); + WidgetNodeType widget = (orient == GTK_ORIENTATION_HORIZONTAL) ? + MOZ_GTK_SCALE_TROUGH_HORIZONTAL : + MOZ_GTK_SCALE_TROUGH_VERTICAL; + moz_gtk_get_widget_min_size(widget, scale_width, scale_height); } } |