diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-12-19 07:31:10 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-12-19 07:32:21 +0100 |
commit | 92c6ca6c357d0ba6b39760b7706f07ff15c6610b (patch) | |
tree | 76446c32f6ac49b9cf251e89ec89c48dbd9e19ec | |
parent | ae57c45c2a104beeae5b031d7e18e21cc6f2408c (diff) | |
download | fiv-92c6ca6c357d0ba6b39760b7706f07ff15c6610b.tar.gz fiv-92c6ca6c357d0ba6b39760b7706f07ff15c6610b.tar.xz fiv-92c6ca6c357d0ba6b39760b7706f07ff15c6610b.zip |
Give the zoom label a minimum width
This also hides a GTK+ bug.
-rw-r--r-- | fastiv.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -757,10 +757,14 @@ make_view_toolbar(void) TOOLBAR(XX) #undef XX - // TODO(p): The scale should be at least as wide as "999%". gtk_widget_set_margin_start(g.toolbar[TOOLBAR_SCALE], 5); gtk_widget_set_margin_end(g.toolbar[TOOLBAR_SCALE], 5); + // So that the width doesn't jump around in the usual zoom range. + // Ideally, we'd measure the widest digit and use width(NNN%). + gtk_label_set_width_chars(GTK_LABEL(g.toolbar[TOOLBAR_SCALE]), 5); + gtk_widget_set_halign(g.toolbar[TOOLBAR_SCALE], GTK_ALIGN_CENTER); + // GtkStatusBar solves a problem we do not have here. GtkWidget *view_toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); GtkBox *box = GTK_BOX(view_toolbar); |