summaryrefslogtreecommitdiffstats
path: root/ui/gfx/gtk_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gfx/gtk_util.cc')
-rw-r--r--ui/gfx/gtk_util.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/ui/gfx/gtk_util.cc b/ui/gfx/gtk_util.cc
index fb5a31d..45ae56a 100644
--- a/ui/gfx/gtk_util.cc
+++ b/ui/gfx/gtk_util.cc
@@ -219,4 +219,33 @@ uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride) {
return new_pixels;
}
+void InitRCStyles() {
+ static const char kRCText[] =
+ // Make our dialogs styled like the GNOME HIG.
+ //
+ // TODO(evanm): content-area-spacing was introduced in a later
+ // version of GTK, so we need to set that manually on all dialogs.
+ // Perhaps it would make sense to have a shared FixupDialog() function.
+ "style \"gnome-dialog\" {\n"
+ " xthickness = 12\n"
+ " GtkDialog::action-area-border = 0\n"
+ " GtkDialog::button-spacing = 6\n"
+ " GtkDialog::content-area-spacing = 18\n"
+ " GtkDialog::content-area-border = 12\n"
+ "}\n"
+ // Note we set it at the "application" priority, so users can override.
+ "widget \"GtkDialog\" style : application \"gnome-dialog\"\n"
+
+ // Make our about dialog special, so the image is flush with the edge.
+ "style \"about-dialog\" {\n"
+ " GtkDialog::action-area-border = 12\n"
+ " GtkDialog::button-spacing = 6\n"
+ " GtkDialog::content-area-spacing = 18\n"
+ " GtkDialog::content-area-border = 0\n"
+ "}\n"
+ "widget \"about-dialog\" style : application \"about-dialog\"\n";
+
+ gtk_rc_parse_string(kRCText);
+}
+
} // namespace gfx