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

Unified Diff: chrome/browser/ui/libgtkui/gtk_util.cc

Issue 2715153002: Gtk3: Refactor GtkButtonImageSource::GetImageForScale (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk_util.h ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtkui/gtk_util.cc
diff --git a/chrome/browser/ui/libgtkui/gtk_util.cc b/chrome/browser/ui/libgtkui/gtk_util.cc
index 23808239b874d3c70d61ee4608c20d3f02f14ccc..6c10b434ad309ddbab917b9f207390ba42f41755 100644
--- a/chrome/browser/ui/libgtkui/gtk_util.cc
+++ b/chrome/browser/ui/libgtkui/gtk_util.cc
@@ -278,6 +278,23 @@ bool GtkVersionCheck(int major, int minor, int micro) {
return false;
}
+GtkStateFlags StateToStateFlags(ui::NativeTheme::State state) {
+ switch (state) {
+ case ui::NativeTheme::kDisabled:
+ return GTK_STATE_FLAG_INSENSITIVE;
+ case ui::NativeTheme::kHovered:
+ return GTK_STATE_FLAG_PRELIGHT;
+ case ui::NativeTheme::kNormal:
+ return GTK_STATE_FLAG_NORMAL;
+ case ui::NativeTheme::kPressed:
+ return static_cast<GtkStateFlags>(GTK_STATE_FLAG_PRELIGHT |
+ GTK_STATE_FLAG_ACTIVE);
+ default:
+ NOTREACHED();
+ return GTK_STATE_FLAG_NORMAL;
+ }
+}
+
ScopedStyleContext AppendCssNodeToStyleContext(GtkStyleContext* context,
const std::string& css_node) {
GtkWidgetPath* path =
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk_util.h ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698