From f3aac7db49a67f3357932e1770d33aa744c73de7 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 19 Sep 2017 03:00:57 -0400 Subject: src/tab-chrome.c: Adjust history popover to size of visible child --- (limited to 'src/tab-chrome.c') diff --git a/src/tab-chrome.c b/src/tab-chrome.c index 6b373e7..1d4b2e6 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -44,10 +44,15 @@ static void back_forward_toggle_button_toggled(GtkToggleButton *toggle_button, GtkStack *stack) { - gtk_stack_set_visible_child(stack, gtk_stack_get_child_by_name( - stack, + /* Use gtk_widget_show() and gtk_widget_hide() instead of + * gtk_stack_set_visible_child() so that the stack fits the size of only + * the visible child. */ + gtk_widget_show(gtk_stack_get_child_by_name(stack, gtk_toggle_button_get_active(toggle_button) ? "text" : "list")); + gtk_widget_hide(gtk_stack_get_child_by_name(stack, + gtk_toggle_button_get_active(toggle_button) ? + "list" : "text")); } static GtkWidget * @@ -212,6 +217,7 @@ back_forward_box_button_press_cb(GtkWidget *widget, GdkEvent *event, /* NB: gtk_popover_popup() is new in GTK+ 3.22. */ gtk_widget_show_all(chrome->back_forward_popover); + gtk_widget_hide(text_view); return FALSE; } -- cgit v0.9.1