Support horizontal scrolling in the browser

An unlikely situation.
This commit is contained in:
Přemysl Eric Janouch 2022-07-17 13:47:16 +02:00
parent bd2e929b77
commit 62b1e83541
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 8 additions and 1 deletions

View File

@ -193,7 +193,14 @@ relayout(FivBrowser *self, int width)
g_array_free(items, TRUE); g_array_free(items, TRUE);
int total_height = y + padding.bottom; int total_height = y + padding.bottom;
if (self->hadjustment) { if (self->hadjustment) {
// TODO(p): Set it to the width. Ideally, bump it to the minimum width. gint minimum_width = 0;
gtk_widget_get_preferred_width(widget, &minimum_width, NULL);
gtk_adjustment_set_lower(self->hadjustment, 0);
gtk_adjustment_set_upper(self->hadjustment, MAX(width, minimum_width));
gtk_adjustment_set_step_increment(self->hadjustment, width * 0.1);
gtk_adjustment_set_page_increment(self->hadjustment, width * 0.9);
gtk_adjustment_set_page_size(self->hadjustment, width);
} }
if (self->vadjustment) { if (self->vadjustment) {
gtk_adjustment_set_lower(self->vadjustment, 0); gtk_adjustment_set_lower(self->vadjustment, 0);