From 4091267e4aac077bff98b7d81549ce93f41893c0 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 18 Sep 2017 22:10:58 -0400 Subject: Revert "src/tab-chrome.c: Try to synchronize tab history list icon sizes" This reverts commit 6eb6482e94ee5a82891a7e3294e4f8d72f2104d5. --- (limited to 'src') 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"); -- cgit v0.9.1