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/browser/gtk/custom_button.h" | 5 #include "chrome/browser/gtk/custom_button.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | |
9 #include "chrome/common/resource_bundle.h" | 8 #include "chrome/common/resource_bundle.h" |
10 #include "chrome/browser/gtk/nine_box.h" | 9 #include "chrome/browser/gtk/nine_box.h" |
11 | 10 |
12 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
13 | 12 |
14 CustomDrawButton::CustomDrawButton(int normal_id, | 13 CustomDrawButton::CustomDrawButton(int normal_id, |
15 int active_id, int highlight_id, int depressed_id) { | 14 int active_id, int highlight_id, int depressed_id) { |
16 widget_ = gtk_button_new(); | 15 widget_ = gtk_button_new(); |
17 | 16 |
18 // Load the button images from the resource bundle. | 17 // Load the button images from the resource bundle. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 132 |
134 // If we return FALSE from the function, the button paints itself. | 133 // If we return FALSE from the function, the button paints itself. |
135 // If we return TRUE, no children are painted. | 134 // If we return TRUE, no children are painted. |
136 // So we return TRUE and send the expose along directly to the child. | 135 // So we return TRUE and send the expose along directly to the child. |
137 gtk_container_propagate_expose(GTK_CONTAINER(widget), | 136 gtk_container_propagate_expose(GTK_CONTAINER(widget), |
138 gtk_bin_get_child(GTK_BIN(widget)), | 137 gtk_bin_get_child(GTK_BIN(widget)), |
139 e); | 138 e); |
140 | 139 |
141 return TRUE; // Prevent normal painting. | 140 return TRUE; // Prevent normal painting. |
142 } | 141 } |
OLD | NEW |