commit: 4b85e087dad714f6e969f702e8be7319531afc37
parent: 828e2e38e092a8ccc11a57b66baa14e2291f59e6
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 12 Jun 2020 02:20:14 +0200
downloads: Use a ListBox in a ScrollWindow
Diffstat:
3 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/config.h b/config.h
@@ -104,5 +104,4 @@
*/
#define BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE
-
#endif /* CONFIG_H_INCLUDED */
diff --git a/downloads.c b/downloads.c
@@ -53,8 +53,7 @@ download_new_entry(WebKitDownload *webkit_download, struct Download *download)
gtk_box_pack_start(GTK_BOX(download->container), download->status, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(download->container), download->file_path, FALSE, FALSE, 0);
- gtk_box_pack_start(
- GTK_BOX(download->window->downloads_tab), download->container, FALSE, FALSE, 0);
+ gtk_list_box_insert(GTK_LIST_BOX(download->window->downloads_tab), download->container, -1);
gtk_widget_show_all(download->container);
}
@@ -180,14 +179,18 @@ downloadCb_received_data(WebKitDownload *webkit_download, guint64 data_lenght, g
GtkWidget *
badwolf_downloads_tab_new()
{
- return gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ return gtk_list_box_new();
}
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, TRUE);
+ GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL);
+ gtk_widget_set_name(scrolled_window, "browser__scrollwin_downloads");
+ gtk_container_add(GTK_CONTAINER(scrolled_window), window->downloads_tab);
+ gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook), scrolled_window, NULL, 0);
+
+ gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook), scrolled_window, TRUE);
GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_set_name(tab_box, "browser__tabbox");
@@ -211,9 +214,9 @@ badwolf_downloads_tab_attach(struct Window *window)
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_tab_label(GTK_NOTEBOOK(window->notebook), scrolled_window, tab_box);
gtk_notebook_set_menu_label_text(
- GTK_NOTEBOOK(window->notebook), window->downloads_tab, _("Badwolf Downloads"));
+ GTK_NOTEBOOK(window->notebook), scrolled_window, _("Badwolf Downloads"));
gtk_widget_show_all(tab_box);
}
diff --git a/po/messages.pot b/po/messages.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: Badwolf 1.0.0+ged40d74.develop\n"
+"Project-Id-Version: Badwolf 1.0.0+g828e2e3.develop\n"
"Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n"
-"POT-Creation-Date: 2020-06-12 01:46+0200\n"
+"POT-Creation-Date: 2020-06-12 02:16+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"
@@ -17,27 +17,27 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: downloads.c:118
+#: downloads.c:117
#, c-format
msgid "%02i:%02i:%02i Download cancelled"
msgstr ""
-#: downloads.c:120
+#: downloads.c:119
#, c-format
msgid "%02i:%02i:%02i Download error"
msgstr ""
-#: downloads.c:142
+#: downloads.c:141
#, c-format
msgid "%02i:%02i:%02i Download finished"
msgstr ""
-#: downloads.c:168
+#: downloads.c:167
#, c-format
msgid "%02i:%02i:%02i Downloading…"
msgstr ""
-#: downloads.c:196 downloads.c:213 downloads.c:216
+#: downloads.c:199 downloads.c:216 downloads.c:218
msgid "Badwolf Downloads"
msgstr ""