Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: chrome/browser/gtk/options/fonts_page_gtk.h

Issue 159458: Gtk: Implement font selection options. (Closed)
Patch Set: move the NotifyPrefChanged call into SetFontsFromButton Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // The fonts page of the fonts & languages options dialog, which contains font
6 // family and size settings, as well as the default encoding option.
7
8 #ifndef CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_
9 #define CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_
10
11 #include <gtk/gtk.h>
12
13 #include "chrome/browser/options_page_base.h"
14 #include "chrome/common/pref_member.h"
15
16 class FontsPageGtk : public OptionsPageBase {
17 public:
18 explicit FontsPageGtk(Profile* profile);
19 virtual ~FontsPageGtk();
20
21 GtkWidget* get_page_widget() const {
22 return page_;
23 }
24
25 private:
26 void Init();
27
28 // Overridden from OptionsPageBase.
29 virtual void NotifyPrefChanged(const std::wstring* pref_name);
30
31 // Retrieve the font selection from the button and save it to the prefs. Also
32 // ensure the button(s) are displayed in the proper size, as the
33 // GtkFontSelector returns the value in points not pixels.
34 void SetFontsFromButton(StringPrefMember* name_pref,
35 IntegerPrefMember* size_pref,
36 GtkFontButton* font_button);
37
38 // Callbacks
39 static void OnSerifFontSet(GtkFontButton* font_button,
40 FontsPageGtk* fonts_page);
41 static void OnSansFontSet(GtkFontButton* font_button,
42 FontsPageGtk* fonts_page);
43 static void OnFixedFontSet(GtkFontButton* font_button,
44 FontsPageGtk* fonts_page);
45
46 // The font chooser widgets
47 GtkWidget* serif_font_button_;
48 GtkWidget* sans_font_button_;
49 GtkWidget* fixed_font_button_;
50
51 // The widget containing the options for this page.
52 GtkWidget* page_;
53
54 // Font name preferences.
55 StringPrefMember serif_name_;
56 StringPrefMember sans_serif_name_;
57 StringPrefMember fixed_width_name_;
58
59 // Font size preferences, in pixels.
60 IntegerPrefMember variable_width_size_;
61 IntegerPrefMember fixed_width_size_;
62
63 // Default encoding preference.
64 StringPrefMember default_encoding_;
65
66 DISALLOW_COPY_AND_ASSIGN(FontsPageGtk);
67 };
68
69
70 #endif // #ifndef CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/gtk/options/fonts_languages_window_gtk.cc ('k') | chrome/browser/gtk/options/fonts_page_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698