aboutsummaryrefslogtreecommitdiff
path: root/fastiv.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-12-19 07:31:10 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-12-19 07:32:21 +0100
commit92c6ca6c357d0ba6b39760b7706f07ff15c6610b (patch)
tree76446c32f6ac49b9cf251e89ec89c48dbd9e19ec /fastiv.c
parentae57c45c2a104beeae5b031d7e18e21cc6f2408c (diff)
downloadfiv-92c6ca6c357d0ba6b39760b7706f07ff15c6610b.tar.gz
fiv-92c6ca6c357d0ba6b39760b7706f07ff15c6610b.tar.xz
fiv-92c6ca6c357d0ba6b39760b7706f07ff15c6610b.zip
Give the zoom label a minimum width
This also hides a GTK+ bug.
Diffstat (limited to 'fastiv.c')
-rw-r--r--fastiv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fastiv.c b/fastiv.c
index daa1a53..7fc9d4d 100644
--- a/fastiv.c
+++ b/fastiv.c
@@ -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);