logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 3ae5614e9e8b5ad5f346a6ea43a2fd514e55f318
parent: 5a95d17490a7acbb41ce797e0fc294be259b5d5a
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 12 Mar 2019 06:46:58 +0100

Add configuration of tab label (ellipsis, size)

Diffstat:

Mbadwolf.c4++--
Mconfig.h12++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/badwolf.c b/badwolf.c @@ -113,8 +113,8 @@ GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser) GtkWidget *playing = gtk_image_new_from_icon_name("media-playback-start-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_label_set_width_chars(GTK_LABEL(label), 25); - gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_MIDDLE); + gtk_label_set_width_chars(GTK_LABEL(label), BADWOLF_TAB_LABEL_CHARWIDTH); // 26 + gtk_label_set_ellipsize(GTK_LABEL(label), BADWOLF_TAB_LABEL_ELLIPSIZE); // PANGO_ELLIPSIZE_MIDDLE gtk_label_set_single_line_mode(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(tab_box), playing, FALSE, FALSE, 0); diff --git a/config.h b/config.h @@ -8,6 +8,18 @@ */ #define BADWOLF_TAB_POSITION GTK_POS_TOP +// BADWOLF_TAB_LABEL_CHARWIDTH: Amount of characters the tab label text fits +#define BADWOLF_TAB_LABEL_CHARWIDTH 26 + +/* BADWOLF_TAB_LABEL_ELLIPSIZE: pango ellipsize mode of the tab 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 + */ + // BADWOLF_BOX_PADDING: Amount of padding between browser’s box (tab child) elements #define BADWOLF_BOX_PADDING 0