Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/gtk/custom_button.h

Issue 113970: Paint a focus indication on LinkButtonGtk buttons.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/gtk/custom_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_GTK_CUSTOM_BUTTON_H_ 5 #ifndef CHROME_BROWSER_GTK_CUSTOM_BUTTON_H_
6 #define CHROME_BROWSER_GTK_CUSTOM_BUTTON_H_ 6 #define CHROME_BROWSER_GTK_CUSTOM_BUTTON_H_
7 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 int width() const { return widget_.get()->allocation.width; } 71 int width() const { return widget_.get()->allocation.width; }
72 72
73 // Set the state to draw. We will paint the widget as if it were in this 73 // Set the state to draw. We will paint the widget as if it were in this
74 // state. 74 // state.
75 void SetPaintOverride(GtkStateType state); 75 void SetPaintOverride(GtkStateType state);
76 76
77 // Resume normal drawing of the widget's state. 77 // Resume normal drawing of the widget's state.
78 void UnsetPaintOverride(); 78 void UnsetPaintOverride();
79 79
80 // This is a convenience function for creating a widget that closes 80 // Returns a standard close button.
81 // a bar (find bar, download shelf, info bars). The button will be packed in 81 static CustomDrawButton* CloseButton();
82 // |hbox|.
83 // The caller is responsible for destroying the returned CustomDrawButton.
84 static CustomDrawButton* AddBarCloseButton(GtkWidget* hbox, int padding);
85 82
86 private: 83 private:
87 // Callback for expose, used to draw the custom graphics. 84 // Callback for expose, used to draw the custom graphics.
88 static gboolean OnExpose(GtkWidget* widget, 85 static gboolean OnExpose(GtkWidget* widget,
89 GdkEventExpose* e, 86 GdkEventExpose* e,
90 CustomDrawButton* obj); 87 CustomDrawButton* obj);
91 88
92 // The actual button widget. 89 // The actual button widget.
93 OwnedWidgetGtk widget_; 90 OwnedWidgetGtk widget_;
94 91
95 CustomDrawButtonBase button_base_; 92 CustomDrawButtonBase button_base_;
96 93
97 DISALLOW_COPY_AND_ASSIGN(CustomDrawButton); 94 DISALLOW_COPY_AND_ASSIGN(CustomDrawButton);
98 }; 95 };
99 96
100 #endif // CHROME_BROWSER_GTK_CUSTOM_BUTTON_H_ 97 #endif // CHROME_BROWSER_GTK_CUSTOM_BUTTON_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gtk/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698