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

Side by Side Diff: chrome/browser/ui/gtk/gtk_chrome_button.cc

Issue 10456077: ui: Rename the IDR constants to put hot/pressed state before position. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | ui/resources/ui_resources.grd » ('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) 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 "chrome/browser/ui/gtk/gtk_chrome_button.h" 5 #include "chrome/browser/ui/gtk/gtk_chrome_button.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "chrome/browser/ui/gtk/nine_box.h" 8 #include "chrome/browser/ui/gtk/nine_box.h"
9 #include "grit/ui_resources.h" 9 #include "grit/ui_resources.h"
10 #include "ui/gfx/gtk_util.h" 10 #include "ui/gfx/gtk_util.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 " GtkButton::child-displacement-y = 0" 47 " GtkButton::child-displacement-y = 0"
48 " GtkButton::inner-border = { 0, 0, 0, 0 }" 48 " GtkButton::inner-border = { 0, 0, 0, 0 }"
49 "}" 49 "}"
50 "widget_class \"*.<GtkChromeButton>\" style \"chrome-button\""); 50 "widget_class \"*.<GtkChromeButton>\" style \"chrome-button\"");
51 51
52 GtkWidgetClass* widget_class = 52 GtkWidgetClass* widget_class =
53 reinterpret_cast<GtkWidgetClass*>(button_class); 53 reinterpret_cast<GtkWidgetClass*>(button_class);
54 widget_class->expose_event = gtk_chrome_button_expose; 54 widget_class->expose_event = gtk_chrome_button_expose;
55 55
56 g_nine_box_prelight = new NineBox( 56 g_nine_box_prelight = new NineBox(
57 IDR_TEXTBUTTON_TOP_LEFT_H, 57 IDR_TEXTBUTTON_HOT_TOP_LEFT,
oshima 2012/06/01 00:48:07 can you change this to IDR_TEXTBUTTON_HOVER_XXX ?
tfarina 2012/06/02 01:34:48 Done.
58 IDR_TEXTBUTTON_TOP_H, 58 IDR_TEXTBUTTON_HOT_TOP,
59 IDR_TEXTBUTTON_TOP_RIGHT_H, 59 IDR_TEXTBUTTON_HOT_TOP_RIGHT,
60 IDR_TEXTBUTTON_LEFT_H, 60 IDR_TEXTBUTTON_HOT_LEFT,
61 IDR_TEXTBUTTON_CENTER_H, 61 IDR_TEXTBUTTON_HOT_CENTER,
62 IDR_TEXTBUTTON_RIGHT_H, 62 IDR_TEXTBUTTON_HOT_RIGHT,
63 IDR_TEXTBUTTON_BOTTOM_LEFT_H, 63 IDR_TEXTBUTTON_HOT_BOTTOM_LEFT,
64 IDR_TEXTBUTTON_BOTTOM_H, 64 IDR_TEXTBUTTON_HOT_BOTTOM,
65 IDR_TEXTBUTTON_BOTTOM_RIGHT_H); 65 IDR_TEXTBUTTON_HOT_BOTTOM_RIGHT);
66 66
67 g_nine_box_active = new NineBox( 67 g_nine_box_active = new NineBox(
68 IDR_TEXTBUTTON_TOP_LEFT_P, 68 IDR_TEXTBUTTON_PRESSED_TOP_LEFT,
69 IDR_TEXTBUTTON_TOP_P, 69 IDR_TEXTBUTTON_PRESSED_TOP,
70 IDR_TEXTBUTTON_TOP_RIGHT_P, 70 IDR_TEXTBUTTON_PRESSED_TOP_RIGHT,
71 IDR_TEXTBUTTON_LEFT_P, 71 IDR_TEXTBUTTON_PRESSED_LEFT,
72 IDR_TEXTBUTTON_CENTER_P, 72 IDR_TEXTBUTTON_PRESSED_CENTER,
73 IDR_TEXTBUTTON_RIGHT_P, 73 IDR_TEXTBUTTON_PRESSED_RIGHT,
74 IDR_TEXTBUTTON_BOTTOM_LEFT_P, 74 IDR_TEXTBUTTON_PRESSED_BOTTOM_LEFT,
75 IDR_TEXTBUTTON_BOTTOM_P, 75 IDR_TEXTBUTTON_PRESSED_BOTTOM,
76 IDR_TEXTBUTTON_BOTTOM_RIGHT_P); 76 IDR_TEXTBUTTON_PRESSED_BOTTOM_RIGHT);
77 77
78 GObjectClass* gobject_class = G_OBJECT_CLASS(button_class); 78 GObjectClass* gobject_class = G_OBJECT_CLASS(button_class);
79 g_type_class_add_private(gobject_class, sizeof(GtkChromeButtonPrivate)); 79 g_type_class_add_private(gobject_class, sizeof(GtkChromeButtonPrivate));
80 } 80 }
81 81
82 static void gtk_chrome_button_init(GtkChromeButton* button) { 82 static void gtk_chrome_button_init(GtkChromeButton* button) {
83 GtkChromeButtonPrivate* priv = GTK_CHROME_BUTTON_GET_PRIVATE(button); 83 GtkChromeButtonPrivate* priv = GTK_CHROME_BUTTON_GET_PRIVATE(button);
84 priv->paint_state = -1; 84 priv->paint_state = -1;
85 priv->use_gtk_rendering = FALSE; 85 priv->use_gtk_rendering = FALSE;
86 priv->hover_state = -1.0; 86 priv->hover_state = -1.0;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 gdouble state) { 164 gdouble state) {
165 GtkChromeButtonPrivate* priv = GTK_CHROME_BUTTON_GET_PRIVATE(button); 165 GtkChromeButtonPrivate* priv = GTK_CHROME_BUTTON_GET_PRIVATE(button);
166 if (state >= 0.0 && state <= 1.0) 166 if (state >= 0.0 && state <= 1.0)
167 priv->hover_state = state; 167 priv->hover_state = state;
168 else 168 else
169 priv->hover_state = -1.0; 169 priv->hover_state = -1.0;
170 gtk_widget_queue_draw(GTK_WIDGET(button)); 170 gtk_widget_queue_draw(GTK_WIDGET(button));
171 } 171 }
172 172
173 G_END_DECLS 173 G_END_DECLS
OLDNEW
« no previous file with comments | « no previous file | ui/resources/ui_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698