OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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/common/gtk_util.h" | 5 #include "chrome/common/gtk_util.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/linux_util.h" | 9 #include "base/linux_util.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), top, bottom, left, right); | 47 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), top, bottom, left, right); |
48 gtk_container_add(GTK_CONTAINER(alignment), child); | 48 gtk_container_add(GTK_CONTAINER(alignment), child); |
49 gtk_container_add(GTK_CONTAINER(ebox), alignment); | 49 gtk_container_add(GTK_CONTAINER(ebox), alignment); |
50 return ebox; | 50 return ebox; |
51 } | 51 } |
52 | 52 |
53 void RemoveAllChildren(GtkWidget* container) { | 53 void RemoveAllChildren(GtkWidget* container) { |
54 gtk_container_foreach(GTK_CONTAINER(container), RemoveWidget, container); | 54 gtk_container_foreach(GTK_CONTAINER(container), RemoveWidget, container); |
55 } | 55 } |
56 | 56 |
| 57 void InitRCStyles() { |
| 58 static const char kRCText[] = |
| 59 // Make our dialogs styled like the GNOME HIG. |
| 60 // TODO(evanm): content-area-spacing doesn't seem to work -- maybe it |
| 61 // was introduced in a later version of GTK? |
| 62 "style \"gnome-dialog\" {\n" |
| 63 " xthickness = 12\n" |
| 64 " GtkDialog::action-area-border = 0\n" |
| 65 " GtkDialog::button-spacing = 6\n" |
| 66 " GtkDialog::content-area-spacing = 18\n" |
| 67 " GtkDialog::content-area-border = 12\n" |
| 68 "}\n" |
| 69 // Note we set it at the "application" priority, so users can override. |
| 70 "widget \"GtkDialog\" style : application \"gnome-dialog\"\n" |
| 71 |
| 72 // Make our about dialog special. |
| 73 "style \"about-dialog\" {\n" |
| 74 " GtkDialog::action-area-border = 12\n" |
| 75 " GtkDialog::button-spacing = 6\n" |
| 76 " GtkDialog::content-area-spacing = 18\n" |
| 77 " GtkDialog::content-area-border = 0\n" |
| 78 "}\n" |
| 79 // Note we set it at the "application" priority, so users can override. |
| 80 "widget \"about-dialog\" style : application \"about-dialog\"\n"; |
| 81 |
| 82 gtk_rc_parse_string(kRCText); |
| 83 } |
| 84 |
57 } // namespace gtk_util | 85 } // namespace gtk_util |
OLD | NEW |