From 92c6ca6c357d0ba6b39760b7706f07ff15c6610b Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sun, 19 Dec 2021 07:31:10 +0100 Subject: Give the zoom label a minimum width This also hides a GTK+ bug. --- fastiv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3-70-g09d2