OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/gfx/gtk_util.h" | 5 #include "ui/gfx/gtk_util.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 new_pixels[idx] = pixels[idx + 2]; | 212 new_pixels[idx] = pixels[idx + 2]; |
213 new_pixels[idx + 1] = pixels[idx + 1]; | 213 new_pixels[idx + 1] = pixels[idx + 1]; |
214 new_pixels[idx + 2] = pixels[idx]; | 214 new_pixels[idx + 2] = pixels[idx]; |
215 new_pixels[idx + 3] = pixels[idx + 3]; | 215 new_pixels[idx + 3] = pixels[idx + 3]; |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 return new_pixels; | 219 return new_pixels; |
220 } | 220 } |
221 | 221 |
| 222 void InitRCStyles() { |
| 223 static const char kRCText[] = |
| 224 // Make our dialogs styled like the GNOME HIG. |
| 225 // |
| 226 // TODO(evanm): content-area-spacing was introduced in a later |
| 227 // version of GTK, so we need to set that manually on all dialogs. |
| 228 // Perhaps it would make sense to have a shared FixupDialog() function. |
| 229 "style \"gnome-dialog\" {\n" |
| 230 " xthickness = 12\n" |
| 231 " GtkDialog::action-area-border = 0\n" |
| 232 " GtkDialog::button-spacing = 6\n" |
| 233 " GtkDialog::content-area-spacing = 18\n" |
| 234 " GtkDialog::content-area-border = 12\n" |
| 235 "}\n" |
| 236 // Note we set it at the "application" priority, so users can override. |
| 237 "widget \"GtkDialog\" style : application \"gnome-dialog\"\n" |
| 238 |
| 239 // Make our about dialog special, so the image is flush with the edge. |
| 240 "style \"about-dialog\" {\n" |
| 241 " GtkDialog::action-area-border = 12\n" |
| 242 " GtkDialog::button-spacing = 6\n" |
| 243 " GtkDialog::content-area-spacing = 18\n" |
| 244 " GtkDialog::content-area-border = 0\n" |
| 245 "}\n" |
| 246 "widget \"about-dialog\" style : application \"about-dialog\"\n"; |
| 247 |
| 248 gtk_rc_parse_string(kRCText); |
| 249 } |
| 250 |
222 } // namespace gfx | 251 } // namespace gfx |
OLD | NEW |