From 493936adcb014b28d598db00aea862b34aff2e42 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 3 Apr 2011 23:59:29 +0200 Subject: [PATCH] Always render icon only tabs at their natural size --- midori/midori-browser.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index f812335a..8fb85fb1 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2007-2010 Christian Dywan + Copyright (C) 2007-2011 Christian Dywan Copyright (C) 2008 Dale Whittaker Copyright (C) 2009 Jérôme Geulfucci @@ -224,6 +224,9 @@ midori_browser_add_speed_dial (MidoriBrowser* browser); gboolean midori_transferbar_confirm_delete (MidoriTransferbar* transferbar); +static void +_midori_browser_update_notebook (MidoriBrowser* browser); + #if WEBKIT_CHECK_VERSION (1, 1, 3) void midori_transferbar_add_download_item (MidoriTransferbar* transferbar, @@ -624,6 +627,21 @@ midori_view_notify_title_cb (GtkWidget* widget, } } +static void +midori_view_notify_minimized_cb (GtkWidget* widget, + GParamSpec* pspec, + MidoriBrowser* browser) +{ + if (katze_object_get_boolean (widget, "minimized")) + { + GtkNotebook* notebook = GTK_NOTEBOOK (browser->notebook); + GtkWidget* label = gtk_notebook_get_tab_label (notebook, widget); + gtk_widget_set_size_request (label, -1, -1); + } + else + _midori_browser_update_notebook (browser); +} + static void midori_view_notify_zoom_level_cb (GtkWidget* view, GParamSpec* pspec, @@ -1484,7 +1502,8 @@ _midori_browser_update_notebook (MidoriBrowser* browser) view = gtk_notebook_get_nth_page (GTK_NOTEBOOK(browser->notebook), i); label = gtk_notebook_get_tab_label (GTK_NOTEBOOK(browser->notebook), view); /* Don't resize empty bin, which is used for thumbnail tabs */ - if (GTK_IS_BIN (label) && gtk_bin_get_child (GTK_BIN (label))) + if (GTK_IS_BIN (label) && gtk_bin_get_child (GTK_BIN (label)) + && !katze_object_get_boolean (view, "minimized")) gtk_widget_set_size_request (label, new_size, -1); } } @@ -1517,6 +1536,8 @@ _midori_browser_add_tab (MidoriBrowser* browser, midori_view_notify_uri_cb, browser, "signal::notify::title", midori_view_notify_title_cb, browser, + "signal::notify::minimized", + midori_view_notify_minimized_cb, browser, "signal::notify::zoom-level", midori_view_notify_zoom_level_cb, browser, "signal::notify::statusbar-text",