diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-07-16 16:49:47 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-07-17 05:27:06 +0200 |
commit | 23429d9631ed8b94007fa9af49d7ae83c47e419e (patch) | |
tree | 49c70e34ceb6e953c21381b11882c0b394fe2c23 /fiv-browser.c | |
parent | ca57c2632a22b0a8ca262af5609cd22e3c842962 (diff) | |
download | fiv-23429d9631ed8b94007fa9af49d7ae83c47e419e.tar.gz fiv-23429d9631ed8b94007fa9af49d7ae83c47e419e.tar.xz fiv-23429d9631ed8b94007fa9af49d7ae83c47e419e.zip |
Implement GtkScrollable in FivView
This fixes rendering and positioning behaviour when dragging on X11,
where we aim to use a native GdkWindow.
Diffstat (limited to 'fiv-browser.c')
-rw-r--r-- | fiv-browser.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fiv-browser.c b/fiv-browser.c index fdce71a..c1c6a48 100644 --- a/fiv-browser.c +++ b/fiv-browser.c @@ -198,12 +198,12 @@ relayout(FivBrowser *self, int width) if (self->vadjustment) { gtk_adjustment_set_lower(self->vadjustment, 0); gtk_adjustment_set_upper(self->vadjustment, total_height); - gtk_adjustment_set_page_size( - self->vadjustment, gtk_widget_get_allocated_height(widget)); - gtk_adjustment_set_page_increment( - self->vadjustment, gtk_widget_get_allocated_height(widget)); gtk_adjustment_set_step_increment(self->vadjustment, self->item_height + self->item_spacing + 2 * self->item_border_y); + gtk_adjustment_set_page_increment( + self->vadjustment, gtk_widget_get_allocated_height(widget) * 0.9); + gtk_adjustment_set_page_size( + self->vadjustment, gtk_widget_get_allocated_height(widget)); } return total_height; } @@ -765,8 +765,7 @@ static void on_adjustment_value_changed( G_GNUC_UNUSED GtkAdjustment *adjustment, gpointer user_data) { - FivBrowser *self = FIV_BROWSER(user_data); - gtk_widget_queue_draw(GTK_WIDGET(self)); + gtk_widget_queue_draw(GTK_WIDGET(user_data)); } static gboolean |