From 71b8af9d8c050ae6a78b76faf118751e2dd5607a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 2 Jul 2019 03:12:41 +0200 Subject: [PATCH] Prevent the statusbar label from resizing the window --- badwolf.c | 1 + config.h | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/badwolf.c b/badwolf.c index 6677d99c..9781d315 100644 --- a/badwolf.c +++ b/badwolf.c @@ -735,6 +735,7 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web gtk_widget_set_halign(browser->statusbar, GTK_ALIGN_START); gtk_label_set_single_line_mode(GTK_LABEL(browser->statuslabel), TRUE); + gtk_label_set_ellipsize(GTK_LABEL(browser->statuslabel), BADWOLF_STATUSLABEL_ELLIPSIZE); gtk_entry_set_text(GTK_ENTRY(browser->location), target_url); gtk_entry_set_has_frame(GTK_ENTRY(browser->location), FALSE); diff --git a/config.h b/config.h index 07ff0f83..626f6eda 100644 --- a/config.h +++ b/config.h @@ -69,3 +69,13 @@ "minimum-font-size", 9, \ NULL // clang-format on + +/* BADWOLF_STATUSLABEL_ELLIPSIZE: pango ellipsize mode of the status bar label text, can be one of: + * - PANGO_ELLIPSIZE_NONE + * - PANGO_ELLIPSIZE_START + * - PANGO_ELLIPSIZE_MIDDLE + * - PANGO_ELLIPSIZE_END + * + * See https://developer.gnome.org/pango/stable/pango-Layout-Objects.html#PangoEllipsizeMode + */ +#define BADWOLF_STATUSLABEL_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE -- 2.21.0