summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-17 17:46:34 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-17 17:46:34 (EDT)
commite32b77da10c20ca5b47d11a356b32472f1103e08 (patch)
treedaa197c69a651bce5c1885830d0549a2ce99b807 /src
parentfd0f25a82781346f6aeef2c4bfeb9b69fdcbf33f (diff)
downloadmarquee-e32b77da10c20ca5b47d11a356b32472f1103e08.zip
marquee-e32b77da10c20ca5b47d11a356b32472f1103e08.tar.gz
marquee-e32b77da10c20ca5b47d11a356b32472f1103e08.tar.bz2
Revert "src/tab-chrome.[ch]: Wrap back/forward buttons in a button box"
This reverts commit fd0f25a82781346f6aeef2c4bfeb9b69fdcbf33f. The GtkAlignment widgets in the GtkButton widgets are too wide and the (default) styling doesn't join the buttons together. GtkButtonBox is meant for OK/cancel buttons in dialogs, not joining related buttons together.
Diffstat (limited to 'src')
-rw-r--r--src/tab-chrome.c30
-rw-r--r--src/tab-chrome.h4
2 files changed, 12 insertions, 22 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index 0a079c3..7b3d1e5 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -27,14 +27,14 @@
#include "tab-chrome.h"
static void
-back_clicked_cb(GtkButton __attribute__((unused)) *toolbutton,
+back_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton,
MqTabChrome *chrome)
{
webkit_web_view_go_back(chrome->web_view);
}
static void
-forward_clicked_cb(GtkButton __attribute__((unused)) *toolbutton,
+forward_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton,
MqTabChrome *chrome)
{
webkit_web_view_go_forward(chrome->web_view);
@@ -62,39 +62,29 @@ 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_button_new_from_icon_name("go-previous",
- GTK_ICON_SIZE_SMALL_TOOLBAR);
+ chrome->back_button = gtk_tool_button_new(
+ gtk_image_new_from_icon_name("go-previous",
+ GTK_ICON_SIZE_SMALL_TOOLBAR), "Back");
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_box_pack_end(GTK_BOX(back_forward_button_box),
- chrome->back_button, FALSE, FALSE, 0);
+ gtk_toolbar_insert(navigation_toolbar, chrome->back_button, -1);
/* Forward button */
- chrome->forward_button = gtk_button_new_from_icon_name("go-next",
- GTK_ICON_SIZE_SMALL_TOOLBAR);
+ chrome->forward_button = gtk_tool_button_new(
+ gtk_image_new_from_icon_name("go-next",
+ GTK_ICON_SIZE_SMALL_TOOLBAR), "Forward");
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_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);
+ gtk_toolbar_insert(navigation_toolbar, chrome->forward_button, -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 e63ac23..61fc069 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;
- GtkWidget *back_button;
- GtkWidget *forward_button;
+ GtkToolItem *back_button;
+ GtkToolItem *forward_button;
GtkWidget *stop_icon;
GtkWidget *reload_icon;
GtkToolItem *stop_reload_button;