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 #ifndef CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ |
6 #define CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 // Make this CustomDrawButton always use the chrome style rendering; it will | 162 // Make this CustomDrawButton always use the chrome style rendering; it will |
163 // never render gtk-like. | 163 // never render gtk-like. |
164 void ForceChromeTheme(); | 164 void ForceChromeTheme(); |
165 | 165 |
166 // Flip the image horizontally. Not to be used for RTL/LTR reasons. (In RTL | 166 // Flip the image horizontally. Not to be used for RTL/LTR reasons. (In RTL |
167 // mode, this will unflip the image.) | 167 // mode, this will unflip the image.) |
168 void set_flipped(bool flipped) { button_base_.set_flipped(flipped); } | 168 void set_flipped(bool flipped) { button_base_.set_flipped(flipped); } |
169 | 169 |
170 GtkWidget* widget() const { return widget_.get(); } | 170 GtkWidget* widget() const { return widget_.get(); } |
171 | 171 |
172 gfx::Rect bounds() const { | 172 // Returns the dimensions of the widget's allocation. |
Evan Stade
2011/11/30 23:02:37
s/dimensions/width
| |
173 return gfx::Rect(widget_->allocation.x, | 173 int WidgetWidth() const; |
174 widget_->allocation.y, | |
175 widget_->allocation.width, | |
176 widget_->allocation.height); | |
177 } | |
178 | |
179 int width() const { return widget_->allocation.width; } | |
180 int height() const { return widget_->allocation.height; } | |
181 | 174 |
182 // Returns the dimensions of the first surface. | 175 // Returns the dimensions of the first surface. |
183 int SurfaceWidth() const; | 176 int SurfaceWidth() const; |
184 int SurfaceHeight() const; | 177 int SurfaceHeight() const; |
185 | 178 |
186 // Set the state to draw. We will paint the widget as if it were in this | 179 // Set the state to draw. We will paint the widget as if it were in this |
187 // state. | 180 // state. |
188 void SetPaintOverride(GtkStateType state); | 181 void SetPaintOverride(GtkStateType state); |
189 | 182 |
190 // Resume normal drawing of the widget's state. | 183 // Resume normal drawing of the widget's state. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 // True if we should never do gtk rendering. | 223 // True if we should never do gtk rendering. |
231 bool forcing_chrome_theme_; | 224 bool forcing_chrome_theme_; |
232 | 225 |
233 // Used to listen for theme change notifications. | 226 // Used to listen for theme change notifications. |
234 content::NotificationRegistrar registrar_; | 227 content::NotificationRegistrar registrar_; |
235 | 228 |
236 DISALLOW_COPY_AND_ASSIGN(CustomDrawButton); | 229 DISALLOW_COPY_AND_ASSIGN(CustomDrawButton); |
237 }; | 230 }; |
238 | 231 |
239 #endif // CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ | 232 #endif // CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ |
OLD | NEW |