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

Side by Side Diff: chrome/browser/gtk/options/options_layout_gtk.cc

Issue 274040: More style nits. (Closed)
Patch Set: Created 11 years, 2 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
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/gtk/options/options_layout_gtk.h" 5 #include "chrome/browser/gtk/options/options_layout_gtk.h"
6 6
7 #include "chrome/common/gtk_util.h" 7 #include "chrome/common/gtk_util.h"
8 8
9 namespace { 9 namespace {
10 10
11 // Style for option group titles 11 // Style for option group titles
12 const char kOptionGroupTitleMarkup[] = "<span weight='bold'>%s</span>"; 12 const char kOptionGroupTitleMarkup[] = "<span weight='bold'>%s</span>";
13 13
14 } 14 } // namespace
15 15
16 OptionsLayoutBuilderGtk::OptionsLayoutBuilderGtk() { 16 OptionsLayoutBuilderGtk::OptionsLayoutBuilderGtk() {
17 page_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); 17 page_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing);
18 gtk_container_set_border_width(GTK_CONTAINER(page_), 18 gtk_container_set_border_width(GTK_CONTAINER(page_),
19 gtk_util::kContentAreaBorder); 19 gtk_util::kContentAreaBorder);
20 } 20 }
21 21
22 void OptionsLayoutBuilderGtk::AddOptionGroup(const std::string& title, 22 void OptionsLayoutBuilderGtk::AddOptionGroup(const std::string& title,
23 GtkWidget* content, 23 GtkWidget* content,
24 bool expandable) { 24 bool expandable) {
25 GtkWidget* title_label = gtk_label_new(NULL); 25 GtkWidget* title_label = gtk_label_new(NULL);
26 char* markup = g_markup_printf_escaped(kOptionGroupTitleMarkup, 26 char* markup = g_markup_printf_escaped(kOptionGroupTitleMarkup,
27 title.c_str()); 27 title.c_str());
28 gtk_label_set_markup(GTK_LABEL(title_label), markup); 28 gtk_label_set_markup(GTK_LABEL(title_label), markup);
29 g_free(markup); 29 g_free(markup);
30 30
31 GtkWidget* title_alignment = gtk_alignment_new(0.0, 0.5, 0.0, 0.0); 31 GtkWidget* title_alignment = gtk_alignment_new(0.0, 0.5, 0.0, 0.0);
32 gtk_container_add(GTK_CONTAINER(title_alignment), title_label); 32 gtk_container_add(GTK_CONTAINER(title_alignment), title_label);
33 33
34 GtkWidget* group = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); 34 GtkWidget* group = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
35 gtk_box_pack_start(GTK_BOX(group), title_alignment, FALSE, FALSE, 0); 35 gtk_box_pack_start(GTK_BOX(group), title_alignment, FALSE, FALSE, 0);
36 gtk_container_add(GTK_CONTAINER(group), gtk_util::IndentWidget(content)); 36 gtk_container_add(GTK_CONTAINER(group), gtk_util::IndentWidget(content));
37 37
38 gtk_box_pack_start(GTK_BOX(page_), group, expandable, expandable, 0); 38 gtk_box_pack_start(GTK_BOX(page_), group, expandable, expandable, 0);
39 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698