diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-17 18:26:32 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-17 18:26:32 (EDT) |
commit | 7720c99207b1cc53f1e9516a7a65ed1c72c63264 (patch) | |
tree | 4ab06088921a6b543ba6d33750eddef128aecea0 | |
parent | e32b77da10c20ca5b47d11a356b32472f1103e08 (diff) | |
download | marquee-7720c99207b1cc53f1e9516a7a65ed1c72c63264.zip marquee-7720c99207b1cc53f1e9516a7a65ed1c72c63264.tar.gz marquee-7720c99207b1cc53f1e9516a7a65ed1c72c63264.tar.bz2 |
src/tab-chrome.[ch]: Link back/forward buttons
-rw-r--r-- | src/tab-chrome.c | 31 | ||||
-rw-r--r-- | src/tab-chrome.h | 4 |
2 files changed, 23 insertions, 12 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c index 7b3d1e5..9120f5b 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,40 @@ static GtkWidget * navigation_toolbar_new(MqTabChrome *chrome, gchar *uri) { GtkToolbar *navigation_toolbar; + GtkToolItem *back_forward_tool_item; + GtkWidget *back_forward_box; GtkToolItem *uri_toolitem; navigation_toolbar = GTK_TOOLBAR(gtk_toolbar_new()); + back_forward_tool_item = gtk_tool_item_new(); + back_forward_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + /* 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_start(GTK_BOX(back_forward_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_start(GTK_BOX(back_forward_box), chrome->forward_button, + FALSE, FALSE, 0); + + gtk_style_context_add_class( + gtk_widget_get_style_context(back_forward_box), "linked"); + gtk_container_add(GTK_CONTAINER(back_forward_tool_item), + back_forward_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; |