diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2011-06-05 21:04:51 +0200 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2011-06-05 21:04:51 +0200 |
commit | a059fe247c6ba6be105986b229bf2d8374f40583 (patch) | |
tree | e91c16de86332f52bfff728140fb3c5387c4128b /src/gtkutil.c | |
parent | ac09b8a1289ec8f8a71c8dc55d4eeebaf2600707 (diff) | |
download | emacs-a059fe247c6ba6be105986b229bf2d8374f40583.tar.gz |
Handle scroll bar width larger than 16 for GTK3.
* gtkutil.c (xg_get_default_scrollbar_width): New function.
* gtkutil.h: Declare xg_get_default_scrollbar_width.
* xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
min width by calling x_set_scroll_bar_default_width.
Fixes: debbugs:8505
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r-- | src/gtkutil.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index 6e54006d913..18c6c185eae 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -3326,6 +3326,21 @@ xg_get_widget_from_map (int idx) return 0; } +int +xg_get_default_scrollbar_width (FRAME_PTR f) +{ + GtkWidget *wscroll = gtk_vscrollbar_new (gtk_adjustment_new (XG_SB_MIN, + XG_SB_MIN, + XG_SB_MAX, + 0.1, 0.1, 0.1)); + int w = 0, b = 0; + gtk_widget_style_get (wscroll, "slider-width", &w, "trough-border", &b, NULL); + gtk_widget_destroy (wscroll); + w += 2*b; + if (w < 16) w = 16; + return w; +} + /* Return the scrollbar id for X Window WID on display DPY. Return -1 if WID not in id_to_widget. */ |