From a719147bf3a276386d55790c86c332e19fe27d6f Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Mon, 22 Nov 2021 12:06:40 +0100 Subject: Another focus-related fix --- fastiv.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fastiv.c b/fastiv.c index 0709ac0..00afe42 100644 --- a/fastiv.c +++ b/fastiv.c @@ -606,7 +606,7 @@ main(int argc, char *argv[]) G_CALLBACK(on_button_press_browser), NULL); gtk_container_add(GTK_CONTAINER(g.browser_scroller), g.browser); - // Christ, no. + // Christ, no, do not scroll all the way to the top on focus. GtkWidget *browser_port = gtk_bin_get_child(GTK_BIN(g.browser_scroller)); gtk_container_set_focus_hadjustment(GTK_CONTAINER(browser_port), NULL); gtk_container_set_focus_vadjustment(GTK_CONTAINER(browser_port), NULL); @@ -619,6 +619,15 @@ main(int argc, char *argv[]) g_signal_connect(g.browser_sidebar, "open-location", G_CALLBACK(on_open_location), NULL); + // The opposite case, and it doesn't work from the init function. + GtkWidget *sidebar_port = gtk_bin_get_child(GTK_BIN(g.browser_sidebar)); + gtk_container_set_focus_hadjustment(GTK_CONTAINER(sidebar_port), + gtk_scrolled_window_get_hadjustment( + GTK_SCROLLED_WINDOW(g.browser_sidebar))); + gtk_container_set_focus_vadjustment(GTK_CONTAINER(sidebar_port), + gtk_scrolled_window_get_vadjustment( + GTK_SCROLLED_WINDOW(g.browser_sidebar))); + g.plus = gtk_button_new_from_icon_name("zoom-in-symbolic", GTK_ICON_SIZE_BUTTON); gtk_widget_set_tooltip_text(g.plus, "Larger thumbnails"); -- cgit v1.2.3-70-g09d2