diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-17 17:45:46 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-17 17:45:46 (EDT) |
commit | fd0f25a82781346f6aeef2c4bfeb9b69fdcbf33f (patch) | |
tree | 7814e4a14c8d79c79d496a21deda306e40c86db0 | |
parent | 27189c42c6f7d8977eede94f4b418e4fef736af4 (diff) | |
download | marquee-fd0f25a82781346f6aeef2c4bfeb9b69fdcbf33f.zip marquee-fd0f25a82781346f6aeef2c4bfeb9b69fdcbf33f.tar.gz marquee-fd0f25a82781346f6aeef2c4bfeb9b69fdcbf33f.tar.bz2 |
src/tab-chrome.[ch]: Wrap back/forward buttons in a button box
-rw-r--r-- | src/tab-chrome.c | 30 | ||||
-rw-r--r-- | src/tab-chrome.h | 4 |
2 files changed, 22 insertions, 12 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c index 7b3d1e5..0a079c3 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -27,14 +27,14 @@ #include "tab-chrome.h" static void -back_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton, +back_clicked_cb(GtkButton __attribute__((unused)) *toolbutton, MqTabChrome *chrome) { webkit_web_view_go_back(chrome->web_view); } static void -forward_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton, +forward_clicked_cb(GtkButton __attribute__((unused)) *toolbutton, MqTabChrome *chrome) { webkit_web_view_go_forward(chrome->web_view); @@ -62,29 +62,39 @@ static GtkWidget * navigation_toolbar_new(MqTabChrome *chrome, gchar *uri) { GtkToolbar *navigation_toolbar; + GtkToolItem *back_forward_tool_item; + GtkWidget *back_forward_button_box; GtkToolItem *uri_toolitem; navigation_toolbar = GTK_TOOLBAR(gtk_toolbar_new()); + back_forward_tool_item = gtk_tool_item_new(); + back_forward_button_box = gtk_button_box_new( + GTK_ORIENTATION_HORIZONTAL); + /* Back button */ - chrome->back_button = gtk_tool_button_new( - gtk_image_new_from_icon_name("go-previous", - GTK_ICON_SIZE_SMALL_TOOLBAR), "Back"); + chrome->back_button = gtk_button_new_from_icon_name("go-previous", + GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_tooltip_text(GTK_WIDGET(chrome->back_button), "Go back one page"); g_signal_connect(chrome->back_button, "clicked", G_CALLBACK(back_clicked_cb), chrome); - gtk_toolbar_insert(navigation_toolbar, chrome->back_button, -1); + gtk_box_pack_end(GTK_BOX(back_forward_button_box), + chrome->back_button, FALSE, FALSE, 0); /* Forward button */ - chrome->forward_button = gtk_tool_button_new( - gtk_image_new_from_icon_name("go-next", - GTK_ICON_SIZE_SMALL_TOOLBAR), "Forward"); + chrome->forward_button = gtk_button_new_from_icon_name("go-next", + GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_tooltip_text(GTK_WIDGET(chrome->forward_button), "Go forward one page"); g_signal_connect(chrome->forward_button, "clicked", G_CALLBACK(forward_clicked_cb), chrome); - gtk_toolbar_insert(navigation_toolbar, chrome->forward_button, -1); + gtk_box_pack_end(GTK_BOX(back_forward_button_box), + chrome->forward_button, FALSE, FALSE, 0); + + gtk_container_add(GTK_CONTAINER(back_forward_tool_item), + back_forward_button_box); + gtk_toolbar_insert(navigation_toolbar, back_forward_tool_item, -1); /* Stop/reload button */ chrome->stop_icon = gtk_image_new_from_icon_name("process-stop", diff --git a/src/tab-chrome.h b/src/tab-chrome.h index 61fc069..e63ac23 100644 --- a/src/tab-chrome.h +++ b/src/tab-chrome.h @@ -30,8 +30,8 @@ typedef struct { GtkWidget *tab_label; guint tab_position; GtkWidget *container; - GtkToolItem *back_button; - GtkToolItem *forward_button; + GtkWidget *back_button; + GtkWidget *forward_button; GtkWidget *stop_icon; GtkWidget *reload_icon; GtkToolItem *stop_reload_button; |