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

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

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 | « chrome/browser/gtk/find_bar_gtk.cc ('k') | chrome/browser/gtk/infobar_gtk.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 #include "chrome/browser/gtk/gtk_chrome_button.h" 5 #include "chrome/browser/gtk/gtk_chrome_button.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "chrome/browser/gtk/nine_box.h" 8 #include "chrome/browser/gtk/nine_box.h"
9 9
10 #include "grit/app_resources.h" 10 #include "grit/app_resources.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 IDR_TEXTBUTTON_BOTTOM_RIGHT_P); 62 IDR_TEXTBUTTON_BOTTOM_RIGHT_P);
63 63
64 g_type_class_add_private(gobject_class, sizeof(GtkChromeButtonPrivate)); 64 g_type_class_add_private(gobject_class, sizeof(GtkChromeButtonPrivate));
65 } 65 }
66 66
67 static void gtk_chrome_button_init(GtkChromeButton* button) { 67 static void gtk_chrome_button_init(GtkChromeButton* button) {
68 GtkChromeButtonPrivate *priv = GTK_CHROME_BUTTON_GET_PRIVATE(button); 68 GtkChromeButtonPrivate *priv = GTK_CHROME_BUTTON_GET_PRIVATE(button);
69 priv->paint_state = -1; 69 priv->paint_state = -1;
70 70
71 gtk_widget_set_app_paintable(GTK_WIDGET(button), TRUE); 71 gtk_widget_set_app_paintable(GTK_WIDGET(button), TRUE);
72
73 GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
72 } 74 }
73 75
74 static gboolean gtk_chrome_button_expose(GtkWidget* widget, 76 static gboolean gtk_chrome_button_expose(GtkWidget* widget,
75 GdkEventExpose* event) { 77 GdkEventExpose* event) {
76 GtkChromeButtonPrivate *priv = GTK_CHROME_BUTTON_GET_PRIVATE(widget); 78 GtkChromeButtonPrivate *priv = GTK_CHROME_BUTTON_GET_PRIVATE(widget);
77 int paint_state = priv->paint_state < 0 ? 79 int paint_state = priv->paint_state < 0 ?
78 GTK_WIDGET_STATE(widget) : priv->paint_state; 80 GTK_WIDGET_STATE(widget) : priv->paint_state;
79 81
80 NineBox* nine_box = NULL; 82 NineBox* nine_box = NULL;
81 if (paint_state == GTK_STATE_PRELIGHT) 83 if (paint_state == GTK_STATE_PRELIGHT)
(...skipping 30 matching lines...) Expand all
112 g_return_if_fail(GTK_IS_CHROME_BUTTON(button)); 114 g_return_if_fail(GTK_IS_CHROME_BUTTON(button));
113 115
114 GtkChromeButtonPrivate *priv = GTK_CHROME_BUTTON_GET_PRIVATE(button); 116 GtkChromeButtonPrivate *priv = GTK_CHROME_BUTTON_GET_PRIVATE(button);
115 priv->paint_state = -1; 117 priv->paint_state = -1;
116 118
117 gtk_widget_queue_draw(GTK_WIDGET(button)); 119 gtk_widget_queue_draw(GTK_WIDGET(button));
118 } 120 }
119 121
120 G_END_DECLS 122 G_END_DECLS
121 123
OLDNEW
« no previous file with comments | « chrome/browser/gtk/find_bar_gtk.cc ('k') | chrome/browser/gtk/infobar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698