Discard the inner sidebar's size request

It used to create a hole when there weren't enough bookmarks
to fill that space.
This commit is contained in:
Přemysl Eric Janouch 2022-07-14 12:45:45 +02:00
parent 07aa11d78d
commit c6096d05b5
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 6 additions and 1 deletions

View File

@ -480,7 +480,8 @@ fiv_sidebar_init(FivSidebar *self)
// TODO(p): Transplant functionality from the shitty GtkPlacesSidebar.
// We cannot reasonably place any new items within its own GtkListBox,
// so we need to replicate the style hierarchy to some extent.
self->places = GTK_PLACES_SIDEBAR(gtk_places_sidebar_new());
GtkWidget *places = gtk_places_sidebar_new();
self->places = GTK_PLACES_SIDEBAR(places);
gtk_places_sidebar_set_show_recent(self->places, FALSE);
gtk_places_sidebar_set_show_trash(self->places, FALSE);
gtk_places_sidebar_set_open_flags(self->places,
@ -488,6 +489,10 @@ fiv_sidebar_init(FivSidebar *self)
g_signal_connect(self->places, "open-location",
G_CALLBACK(on_open_location), self);
gint minimum_width = -1;
gtk_widget_get_size_request(places, &minimum_width, NULL);
gtk_widget_set_size_request(places, minimum_width, -1);
gtk_places_sidebar_set_show_enter_location(self->places, TRUE);
g_signal_connect(self->places, "show-enter-location",
G_CALLBACK(on_show_enter_location), self);