logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 07d0381569633d0391a7dc098f3b468cf29330c1
parent: 657cacd378a1004627cf279f684663f281746916
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 11 May 2020 00:18:07 +0200

downloads: Make tab look & behave like a real tab

Diffstat:

Mdownloads.c33+++++++++++++++++++++++++++------
Mpo/fr.po8++++----
Mpo/messages.pot10+++++-----
3 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/downloads.c b/downloads.c @@ -186,12 +186,33 @@ void badwolf_downloads_tab_attach(struct Window *window) { gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook), window->downloads_tab, NULL, 0); - gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook), window->downloads_tab, FALSE); - GtkWidget *downloads_tab_label = - gtk_image_new_from_icon_name("emblem-downloads", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_widget_set_tooltip_text(downloads_tab_label, _("Badwolf Downloads")); - gtk_notebook_set_tab_label( - GTK_NOTEBOOK(window->notebook), window->downloads_tab, downloads_tab_label); + gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook), window->downloads_tab, TRUE); + + GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_set_name(tab_box, "browser__tabbox"); + GtkWidget *icon = gtk_image_new_from_icon_name("emblem-downloads", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_set_name(icon, "browser__tabbox__icon"); + GtkWidget *label = gtk_label_new(_("Badwolf Downloads")); + gtk_widget_set_name(label, "browser__tabbox__label"); + +#ifdef BADWOLF_TAB_BOX_WIDTH + gtk_widget_set_size_request(label, BADWOLF_TAB_BOX_WIDTH, -1); +#endif +#ifdef BADWOLF_TAB_LABEL_CHARWIDTH + gtk_label_set_width_chars(GTK_LABEL(label), BADWOLF_TAB_LABEL_CHARWIDTH); +#endif + gtk_widget_set_hexpand(tab_box, BADWOLF_TAB_HEXPAND); + + gtk_label_set_ellipsize(GTK_LABEL(label), BADWOLF_TAB_LABEL_ELLIPSIZE); + gtk_label_set_single_line_mode(GTK_LABEL(label), TRUE); + + gtk_box_pack_start(GTK_BOX(tab_box), icon, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(tab_box), label, TRUE, TRUE, 0); + + gtk_widget_set_tooltip_text(tab_box, _("Badwolf Downloads")); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(window->notebook), window->downloads_tab, tab_box); gtk_notebook_set_menu_label_text( GTK_NOTEBOOK(window->notebook), window->downloads_tab, _("Badwolf Downloads")); + + gtk_widget_show_all(tab_box); } diff --git a/po/fr.po b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-04 02:40+0200\n" +"POT-Creation-Date: 2020-05-11 00:19+0200\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier <contact@hacktivis.me>\n" "Language-Team: French\n" @@ -27,17 +27,17 @@ msgstr "%02i:%02i:%02i Téléchargement annulé" msgid "%02i:%02i:%02i Download error" msgstr "%02i:%02i:%02i Erreur du téléchargement" -#: downloads.c:140 +#: downloads.c:141 #, fuzzy, c-format msgid "%02i:%02i:%02i Download finished" msgstr "%02i:%02i:%02i Téléchargement finit" -#: downloads.c:166 +#: downloads.c:167 #, c-format msgid "%02i:%02i:%02i Downloading…" msgstr "%02i:%02i:%02i Téléchargement en cours…" -#: downloads.c:191 downloads.c:195 +#: downloads.c:195 downloads.c:212 downloads.c:215 msgid "Badwolf Downloads" msgstr "Téléchargements Badwolf" diff --git a/po/messages.pot b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g73e576e.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g226ed40.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-04 02:40+0200\n" +"POT-Creation-Date: 2020-05-11 00:19+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -27,17 +27,17 @@ msgstr "" msgid "%02i:%02i:%02i Download error" msgstr "" -#: downloads.c:140 +#: downloads.c:141 #, c-format msgid "%02i:%02i:%02i Download finished" msgstr "" -#: downloads.c:166 +#: downloads.c:167 #, c-format msgid "%02i:%02i:%02i Downloading…" msgstr "" -#: downloads.c:191 downloads.c:195 +#: downloads.c:195 downloads.c:212 downloads.c:215 msgid "Badwolf Downloads" msgstr ""