summaryrefslogtreecommitdiffstats
path: root/src/tab-chrome.c
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-18 22:10:58 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-18 22:10:58 (EDT)
commit4091267e4aac077bff98b7d81549ce93f41893c0 (patch)
treea5f53bfd6cc1980884dae351742c59433987c5e4 /src/tab-chrome.c
parent678ad5ef403b78ee544bcf3674e1247cb23d13fe (diff)
downloadmarquee-4091267e4aac077bff98b7d81549ce93f41893c0.zip
marquee-4091267e4aac077bff98b7d81549ce93f41893c0.tar.gz
marquee-4091267e4aac077bff98b7d81549ce93f41893c0.tar.bz2
Revert "src/tab-chrome.c: Try to synchronize tab history list icon sizes"
This reverts commit 6eb6482e94ee5a82891a7e3294e4f8d72f2104d5.
Diffstat (limited to 'src/tab-chrome.c')
-rw-r--r--src/tab-chrome.c52
1 files changed, 4 insertions, 48 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index 70b1787..1d10bfa 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -50,44 +50,9 @@ back_forward_toggle_button_toggled(GtkToggleButton *toggle_button,
"text" : "list"));
}
-static GtkRequisition *
-get_max_requisition(GtkWidget *widget_a, GtkWidget *widget_b)
-{
- GtkRequisition *req_a;
- GtkRequisition *req_b;
- GtkRequisition *max_req;
-
- /* Allocate widget requisitions. */
- req_a = g_malloc(sizeof(*req_a));
- req_b = g_malloc(sizeof(*req_b));
-
- /* Get requisitions. */
- gtk_widget_get_preferred_size(widget_a, req_a, NULL);
- gtk_widget_get_preferred_size(widget_b, req_b, NULL);
-
- /* Allocate and calculate maximum requisition. */
- max_req = g_malloc(sizeof(*max_req));
- max_req->width = MAX(req_a->width, req_b->width);
- max_req->height = MAX(req_a->height, req_b->height);
-
- /* Free widget requisitions. */
- g_free(req_a);
- g_free(req_b);
-
- /* For convenience, remove the widgets' floating references (assume
- * ownership) and decrease their reference counts (finalize them).
- * They're instantiated only for this function. */
- g_object_ref_sink(widget_a);
- g_object_ref_sink(widget_b);
- g_object_unref(widget_a);
- g_object_unref(widget_b);
-
- return max_req;
-}
-
static GtkWidget *
back_forward_list_item_new(WebKitBackForwardListItem *list_item,
- GtkWidget *icon, GtkRequisition *max_req)
+ GtkWidget *icon)
{
GtkWidget *label;
GtkWidget *box;
@@ -95,7 +60,6 @@ back_forward_list_item_new(WebKitBackForwardListItem *list_item,
label = gtk_label_new(webkit_back_forward_list_item_get_title(
list_item));
gtk_widget_set_halign(label, GTK_ALIGN_START);
- gtk_widget_set_size_request(icon, max_req->width, max_req->height);
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start(GTK_BOX(box), icon, FALSE, FALSE, 0);
@@ -112,7 +76,6 @@ back_forward_box_button_press_cb(GtkWidget *widget, GdkEvent *event,
{
WebKitBackForwardList *back_forward_list;
GtkWidget *list_box;
- GtkRequisition *max_req;
GList *list_item;
GtkWidget *stack;
GtkWidget *toggle_button;
@@ -131,14 +94,9 @@ back_forward_box_button_press_cb(GtkWidget *widget, GdkEvent *event,
GTK_SELECTION_BROWSE);
gtk_list_box_set_activate_on_single_click(GTK_LIST_BOX(list_box), TRUE);
- max_req = get_max_requisition(gtk_radio_button_new(NULL),
- gtk_image_new_from_icon_name("go-previous",
- GTK_ICON_SIZE_BUTTON));
-
gtk_list_box_insert(GTK_LIST_BOX(list_box), back_forward_list_item_new(
webkit_back_forward_list_get_current_item(
- back_forward_list), gtk_radio_button_new(NULL),
- max_req),
+ back_forward_list), gtk_radio_button_new(NULL)),
-1);
gtk_list_box_select_row(GTK_LIST_BOX(list_box),
gtk_list_box_get_row_at_index(GTK_LIST_BOX(list_box), 0));
@@ -149,7 +107,7 @@ back_forward_box_button_press_cb(GtkWidget *widget, GdkEvent *event,
gtk_list_box_insert(GTK_LIST_BOX(list_box),
back_forward_list_item_new(list_item->data,
gtk_image_new_from_icon_name("go-previous",
- GTK_ICON_SIZE_BUTTON), max_req), 0);
+ GTK_ICON_SIZE_BUTTON)), 0);
}
list_item = webkit_back_forward_list_get_forward_list(
@@ -158,11 +116,9 @@ back_forward_box_button_press_cb(GtkWidget *widget, GdkEvent *event,
gtk_list_box_insert(GTK_LIST_BOX(list_box),
back_forward_list_item_new(list_item->data,
gtk_image_new_from_icon_name("go-next",
- GTK_ICON_SIZE_BUTTON), max_req), -1);
+ GTK_ICON_SIZE_BUTTON)), -1);
}
- g_free(max_req);
-
stack = gtk_stack_new();
gtk_stack_add_named(GTK_STACK(stack), list_box, "list");
gtk_stack_add_named(GTK_STACK(stack), gtk_label_new("Text"), "text");