From 80c4665c06621757f490ca2c61c725b36674a423 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Tue, 23 Nov 2010 20:41:41 +0000 Subject: [gtk] reinstate indentation of instant explanation in options dialog This was broken when the initialization of the checkbutton's label was moved. BUG=none TEST=manual Review URL: http://codereview.chromium.org/5311001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67148 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/options/general_page_gtk.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'chrome/browser/gtk') diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc index 05ce979..8d7931f 100644 --- a/chrome/browser/gtk/options/general_page_gtk.cc +++ b/chrome/browser/gtk/options/general_page_gtk.cc @@ -209,6 +209,14 @@ void GeneralPageGtk::NotifyPrefChanged(const std::string* pref_name) { base::StringPrintf("[%d]", prefs->GetInteger(prefs::kInstantType)); } gtk_button_set_label(GTK_BUTTON(instant_checkbox_), description.c_str()); + + // Relies on knowledge of GTK+ internals to find the checkbox's label child + // and then make the indent below match its vertical spacing. + GtkWidget* instant_label = gtk_bin_get_child(GTK_BIN(instant_checkbox_)); + if (instant_label && GTK_IS_LABEL(instant_label)) { + g_signal_connect(instant_label, "size-allocate", + G_CALLBACK(OnInstantLabelSizeAllocateThunk), this); + } } initializing_ = false; @@ -413,14 +421,6 @@ GtkWidget* GeneralPageGtk::InitDefaultSearchGroup() { G_CALLBACK(OnInstantToggledThunk), this); gtk_box_pack_start(GTK_BOX(instant_vbox), instant_checkbox_, FALSE, FALSE, 0); - // Relies on knowledge of GTK+ internals to find the checkbox's label child - // and then make the indent below match its vertical spacing. - GtkWidget* instant_label = gtk_bin_get_child(GTK_BIN(instant_checkbox_)); - if (instant_label && GTK_IS_LABEL(instant_label)) { - g_signal_connect(instant_label, "size-allocate", - G_CALLBACK(OnInstantLabelSizeAllocateThunk), this); - } - instant_indent_ = gtk_fixed_new(); GtkWidget* explanation_box = gtk_hbox_new(FALSE, 0); GtkWidget* explanation = gtk_label_new(( @@ -757,9 +757,8 @@ void GeneralPageGtk::UpdateHomepageIsNewTabRadio(bool homepage_is_new_tab, } void GeneralPageGtk::EnableHomepageURLField(bool enabled) { - if (homepage_.IsManaged()) { + if (homepage_.IsManaged()) enabled = false; - } gtk_widget_set_sensitive(homepage_use_url_entry_, enabled); } -- cgit v1.1