From fcff97c2a8d6fa471bd53798dc320e34075de8e8 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 16 Sep 2017 16:54:43 -0400 Subject: mq_tab_chrome_new(): Create a proper toolbar --- (limited to 'src') diff --git a/src/tab-chrome.c b/src/tab-chrome.c index 52197d3..b09484d 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -29,16 +29,28 @@ MqTabChrome * mq_tab_chrome_new(gchar *uri) { MqTabChrome *chrome; + GtkToolItem *location_bar_container; chrome = malloc(sizeof(*chrome)); - chrome->container = gtk_grid_new(); - gtk_grid_attach(GTK_GRID(chrome->container), gtk_label_new("Back"), - 0, 0, 1, 1); - gtk_grid_attach(GTK_GRID(chrome->container), gtk_label_new("Forward"), - 1, 0, 1, 1); - gtk_grid_attach(GTK_GRID(chrome->container), gtk_label_new(uri), - 2, 0, 1, 1); + chrome->container = gtk_toolbar_new(); + gtk_toolbar_insert(GTK_TOOLBAR(chrome->container), + gtk_tool_button_new( + gtk_image_new_from_icon_name("go-previous", 16), + "Back"), + -1); + gtk_toolbar_insert(GTK_TOOLBAR(chrome->container), + gtk_tool_button_new( + gtk_image_new_from_icon_name("go-next", 16), + "Forward"), + -1); + location_bar_container = gtk_tool_item_new(); + chrome->location_bar = gtk_entry_new_with_buffer( + gtk_entry_buffer_new(uri, -1)); + gtk_container_add(GTK_CONTAINER(location_bar_container), + chrome->location_bar); + gtk_toolbar_insert(GTK_TOOLBAR(chrome->container), + location_bar_container, -1); return chrome; } diff --git a/src/tab-chrome.h b/src/tab-chrome.h index 27804fd..564474c 100644 --- a/src/tab-chrome.h +++ b/src/tab-chrome.h @@ -24,6 +24,7 @@ typedef struct { GtkWidget *container; + GtkWidget *location_bar; } MqTabChrome; MqTabChrome * -- cgit v0.9.1