diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-16 19:19:28 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-16 19:20:37 (EDT) |
commit | ab85075e032841edd47341ae48b1c24750a05493 (patch) | |
tree | e87db0918621a6ef98d2251e52aa3cab43ba9674 /src | |
parent | a367c8f131eabdb0832e2d3b2cb8e5f09fc74113 (diff) | |
download | marquee-ab85075e032841edd47341ae48b1c24750a05493.zip marquee-ab85075e032841edd47341ae48b1c24750a05493.tar.gz marquee-ab85075e032841edd47341ae48b1c24750a05493.tar.bz2 |
mq_tab_chrome_new(): Refactor navigation toolbar code into new function
Diffstat (limited to 'src')
-rw-r--r-- | src/tab-chrome.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c index 25e6f40..ba1e4d5 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -25,17 +25,12 @@ #include "tab-chrome.h" -MqTabChrome * -mq_tab_chrome_new(gchar *uri) +static GtkWidget * +navigation_toolbar_new(MqTabChrome *chrome, gchar *uri) { - MqTabChrome *chrome; GtkWidget *navigation_toolbar; GtkToolItem *location_bar_container; - chrome = malloc(sizeof(*chrome)); - - chrome->container = gtk_grid_new(); - navigation_toolbar = gtk_toolbar_new(); gtk_toolbar_insert(GTK_TOOLBAR(navigation_toolbar), gtk_tool_button_new( @@ -59,8 +54,19 @@ mq_tab_chrome_new(gchar *uri) location_bar_container, -1); gtk_widget_set_hexpand(navigation_toolbar, TRUE); - gtk_grid_attach(GTK_GRID(chrome->container), navigation_toolbar, - 0, 0, 1, 1); + return navigation_toolbar; +} + +MqTabChrome * +mq_tab_chrome_new(gchar *uri) +{ + MqTabChrome *chrome; + + chrome = malloc(sizeof(*chrome)); + + chrome->container = gtk_grid_new(); + gtk_grid_attach(GTK_GRID(chrome->container), + navigation_toolbar_new(chrome, uri), 0, 0, 1, 1); return chrome; } |