summaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-17 01:54:57 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-17 01:54:57 (EDT)
commit61e241ea4b4ecfeb62abe990931e9cce4e4e1354 (patch)
tree4cc1b06f5328c1df7644df18791a54f5f19da80d /src/window.c
parentd6fad72f86efdf7497999225398cb1b1691e1046 (diff)
downloadmarquee-61e241ea4b4ecfeb62abe990931e9cce4e4e1354.zip
marquee-61e241ea4b4ecfeb62abe990931e9cce4e4e1354.tar.gz
marquee-61e241ea4b4ecfeb62abe990931e9cce4e4e1354.tar.bz2
add_tab(): Set tab labels
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c
index c9d67d9..a3f0c49 100644
--- a/src/window.c
+++ b/src/window.c
@@ -29,14 +29,27 @@
static void
add_tab(MqWindow *window, gchar *uri, gint position)
{
+ GtkWidget *tab_label;
+ GtkWidget *tab_label_image;
+ GtkWidget *tab_label_label;
MqTab *tab;
GtkWidget *tab_widget;
+ tab_label = gtk_grid_new();
+ tab_label_image = gtk_image_new_from_icon_name("text-x-generic",
+ GTK_ICON_SIZE_BUTTON);
+ gtk_grid_attach(GTK_GRID(tab_label), tab_label_image,
+ 0, 0, 1, 1);
+ tab_label_label = gtk_label_new("New tab");
+ gtk_grid_attach(GTK_GRID(tab_label), tab_label_label,
+ 1, 0, 1, 1);
+ gtk_widget_show_all(tab_label);
+
tab = mq_tab_new(uri);
- /* TODO: Set tab label (container widget with icon and title) */
+
tab_widget = mq_tab_get_container(tab);
position = gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook),
- tab_widget, NULL, position);
+ tab_widget, tab_label, position);
gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook),
tab_widget, TRUE);
gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(window->notebook),