diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-15 22:14:40 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-15 22:14:40 +0000 |
commit | b5a4cf359cec8f0ca15ed901ae2ff7e366d7fc2d (patch) | |
tree | 43c775226bb337b9bbfd0c17e2d8f227e22b33f9 /chrome/browser/gtk | |
parent | e301150ae6bcc8e3d3d660b81ad35be1278d3bf6 (diff) | |
download | chromium_src-b5a4cf359cec8f0ca15ed901ae2ff7e366d7fc2d.zip chromium_src-b5a4cf359cec8f0ca15ed901ae2ff7e366d7fc2d.tar.gz chromium_src-b5a4cf359cec8f0ca15ed901ae2ff7e366d7fc2d.tar.bz2 |
Fill in "web content" section in "user data" options.
BUG=11507
TEST=open options -> user data. Click the configure fonts button. Font configuration dialog should appear.
Review URL: http://codereview.chromium.org/157002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/options/advanced_contents_gtk.cc | 35 | ||||
-rw-r--r-- | chrome/browser/gtk/options/options_layout_gtk.cc | 14 | ||||
-rw-r--r-- | chrome/browser/gtk/options/options_layout_gtk.h | 3 |
3 files changed, 47 insertions, 5 deletions
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc index 62231b9..402c285 100644 --- a/chrome/browser/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc @@ -8,6 +8,7 @@ #include "base/basictypes.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/fonts_languages_window.h" #include "chrome/browser/gtk/gtk_chrome_link_button.h" #include "chrome/browser/gtk/options/options_layout_gtk.h" #include "chrome/browser/net/dns_global.h" @@ -459,6 +460,10 @@ class SecuritySection : public OptionsPageBase { } private: + // The callback functions for the options widgets. + static void OnFontsAndLanguagesButtonClicked(GtkButton *button, + WebContentSection* section); + // The widget containing the options for this section. GtkWidget* page_; @@ -494,8 +499,36 @@ class WebContentSection : public OptionsPageBase { WebContentSection::WebContentSection(Profile* profile) : OptionsPageBase(profile) { page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); - gtk_box_pack_start(GTK_BOX(page_), gtk_label_new("TODO web content options"), + + GtkWidget* fonts_and_languages_label = CreateWrappedLabel( + IDS_OPTIONS_FONTSETTINGS_INFO); + gtk_misc_set_alignment(GTK_MISC(fonts_and_languages_label), 0, 0); + gtk_box_pack_start(GTK_BOX(page_), fonts_and_languages_label, + FALSE, FALSE, 0); + + GtkWidget* fonts_and_languages_button = gtk_button_new_with_label( + l10n_util::GetStringUTF8( + IDS_OPTIONS_FONTSETTINGS_CONFIGUREFONTS_BUTTON).c_str()); + g_signal_connect(fonts_and_languages_button, "clicked", + G_CALLBACK(OnFontsAndLanguagesButtonClicked), this); + // Stick it in an hbox so it doesn't expand to the whole width. + GtkWidget* button_hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(button_hbox), + fonts_and_languages_button, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(page_), + OptionsLayoutBuilderGtk::IndentWidget(button_hbox), + FALSE, FALSE, 0); + + // TODO(mattm): gears options would go here if we supported gears +} + +// static +void WebContentSection::OnFontsAndLanguagesButtonClicked( + GtkButton *button, WebContentSection* section) { + ShowFontsLanguagesWindow(GTK_WINDOW(gtk_widget_get_toplevel(section->page_)), + FONTS_ENCODING_PAGE, + section->profile()); } /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/gtk/options/options_layout_gtk.cc b/chrome/browser/gtk/options/options_layout_gtk.cc index 35a47e7..a2507fe 100644 --- a/chrome/browser/gtk/options/options_layout_gtk.cc +++ b/chrome/browser/gtk/options/options_layout_gtk.cc @@ -31,10 +31,7 @@ void OptionsLayoutBuilderGtk::AddOptionGroup(const std::string& title, GtkWidget* title_alignment = gtk_alignment_new(0.0, 0.5, 0.0, 0.0); gtk_container_add(GTK_CONTAINER(title_alignment), title_label); - GtkWidget* content_alignment = gtk_alignment_new(0.0, 0.5, 1.0, 1.0); - gtk_alignment_set_padding(GTK_ALIGNMENT(content_alignment), 0, 0, - gtk_util::kGroupIndent, 0); - gtk_container_add(GTK_CONTAINER(content_alignment), content); + GtkWidget* content_alignment = IndentWidget(content); GtkWidget* group = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(group), title_alignment, FALSE, FALSE, 0); @@ -42,3 +39,12 @@ void OptionsLayoutBuilderGtk::AddOptionGroup(const std::string& title, gtk_box_pack_start(GTK_BOX(page_), group, expandable, expandable, 0); } + +// static +GtkWidget* OptionsLayoutBuilderGtk::IndentWidget(GtkWidget* content) { + GtkWidget* content_alignment = gtk_alignment_new(0.0, 0.5, 1.0, 1.0); + gtk_alignment_set_padding(GTK_ALIGNMENT(content_alignment), 0, 0, + gtk_util::kGroupIndent, 0); + gtk_container_add(GTK_CONTAINER(content_alignment), content); + return content_alignment; +} diff --git a/chrome/browser/gtk/options/options_layout_gtk.h b/chrome/browser/gtk/options/options_layout_gtk.h index c4fedc6..0ef3174 100644 --- a/chrome/browser/gtk/options/options_layout_gtk.h +++ b/chrome/browser/gtk/options/options_layout_gtk.h @@ -24,6 +24,9 @@ class OptionsLayoutBuilderGtk { void AddOptionGroup(const std::string& title, GtkWidget* content, bool expandable); + // Adds the given widget to an alignment identing it by |kGroupIndent|. + static GtkWidget* IndentWidget(GtkWidget* content); + private: // The parent widget GtkWidget* page_; |