aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-22 12:06:40 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-22 12:07:03 +0100
commita719147bf3a276386d55790c86c332e19fe27d6f (patch)
treeb129b0c478b9e0e3ce8b1fe42fdd4131ea0378e2
parentcd72ea902f31d659cd2c02cf59f5ccae3cfad549 (diff)
downloadfiv-a719147bf3a276386d55790c86c332e19fe27d6f.tar.gz
fiv-a719147bf3a276386d55790c86c332e19fe27d6f.tar.xz
fiv-a719147bf3a276386d55790c86c332e19fe27d6f.zip
Another focus-related fix
-rw-r--r--fastiv.c11
1 files changed, 10 insertions, 1 deletions
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");