From aee614a8e32325e217970c81cc0e9a3dcd6a4b83 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 17 Sep 2017 02:21:54 -0400 Subject: Revert add_tab() and pass label widgets instead --- (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 2cecc0d..770d59d 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 = mq_tab_new(uri, GTK_NOTEBOOK(window->notebook)); + 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, tab_label_image, tab_label_label); 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), -- cgit v0.9.1