diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-16 16:54:43 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-16 16:54:43 (EDT) |
commit | fcff97c2a8d6fa471bd53798dc320e34075de8e8 (patch) | |
tree | 925041b7375e516158bf87f7c01dc208ddcf6b4c /src | |
parent | 776baccd121eae4fdc42b50cfb55e13491f2adc2 (diff) | |
download | marquee-fcff97c2a8d6fa471bd53798dc320e34075de8e8.zip marquee-fcff97c2a8d6fa471bd53798dc320e34075de8e8.tar.gz marquee-fcff97c2a8d6fa471bd53798dc320e34075de8e8.tar.bz2 |
mq_tab_chrome_new(): Create a proper toolbar
Diffstat (limited to 'src')
-rw-r--r-- | src/tab-chrome.c | 26 | ||||
-rw-r--r-- | src/tab-chrome.h | 1 |
2 files changed, 20 insertions, 7 deletions
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 * |