diff options
author | lukefromdc <[email protected]> | 2016-09-05 23:52:06 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2016-09-05 23:52:06 -0400 |
commit | adcd1fba4c7d42ca2a0190887937c7ea17a26204 (patch) | |
tree | 9beb6cba4b72580a1229d090173ad2f8b5702879 /src | |
parent | adabb4340bdcd1fe4dc58614690631bc69937fc5 (diff) | |
download | caja-adcd1fba4c7d42ca2a0190887937c7ea17a26204.tar.bz2 caja-adcd1fba4c7d42ca2a0190887937c7ea17a26204.tar.xz |
GTK3: Fix pathbar "w/o calling gtk_widget get preferred width" warnings
Stop the "allocating size of GtkButton <xxxx> without calling gtk_widget get preferred width/height()" warnings from caja-pathbar's slider buttons
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-pathbar.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c index 39903f6e..ca8807b1 100644 --- a/src/caja-pathbar.c +++ b/src/caja-pathbar.c @@ -560,6 +560,7 @@ caja_path_bar_get_preferred_width (GtkWidget *widget, gint child_height; gint height; gint child_min, child_nat; + gint slider_width; path_bar = CAJA_PATH_BAR (widget); @@ -586,12 +587,20 @@ caja_path_bar_get_preferred_width (GtkWidget *widget, /* Theoretically, the slider could be bigger than the other button. But we're * not going to worry about that now. */ - path_bar->slider_width = MIN (height * 2 / 3 + 5, height); + gtk_widget_get_preferred_width (path_bar->down_slider_button, + &slider_width, + NULL); + gtk_widget_get_preferred_width (path_bar->up_slider_button, + &slider_width, + NULL); + if (path_bar->button_list) { - *minimum += (path_bar->spacing + path_bar->slider_width) * 2; - *natural += (path_bar->spacing + path_bar->slider_width) * 2; + *minimum += (path_bar->spacing + slider_width) * 2; + *natural += (path_bar->spacing + slider_width) * 2; } + /*Let's keep the rest of this as it was */ + path_bar->slider_width = slider_width; } static void |