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

Unified Diff: chrome/browser/gtk/browser_actions_toolbar_gtk.cc

Issue 2861040: Hide the browser actions gripper when it's not in use. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fix fixme Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/browser_actions_toolbar_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_actions_toolbar_gtk.cc
diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
index b1126bc8e9f81672ef5099466568d3859820abc0..b60489a06ff88649a230e1d1a5ba0bfc660375cc 100644
--- a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
+++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
@@ -350,6 +350,7 @@ BrowserActionsToolbarGtk::BrowserActionsToolbarGtk(Browser* browser)
resize_animation_(this),
desired_width_(0),
start_width_(0),
+ draw_gripper_(false),
method_factory_(this) {
ExtensionsService* extension_service = profile_->GetExtensionsService();
// The |extension_service| can be NULL in Incognito.
@@ -753,6 +754,9 @@ gboolean BrowserActionsToolbarGtk::OnGripperMotionNotify(
gboolean BrowserActionsToolbarGtk::OnGripperExpose(GtkWidget* gripper,
GdkEventExpose* expose) {
+ if (!draw_gripper_)
+ return TRUE;
+
cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(expose->window));
CairoCachedSurface* surface = theme_provider_->GetSurfaceNamed(
@@ -777,13 +781,18 @@ gboolean BrowserActionsToolbarGtk::OnGripperEnterNotify(
GtkWidget* gripper, GdkEventCrossing* event) {
gdk_window_set_cursor(gripper->window,
gtk_util::GetCursor(GDK_SB_H_DOUBLE_ARROW));
+ draw_gripper_ = true;
sky 2010/07/01 16:40:14 How come you don't queue_draw here and @ 793?
Evan Stade 2010/07/01 17:35:08 GtkButtons already queue_draw when the mouse enter
+
return FALSE;
}
gboolean BrowserActionsToolbarGtk::OnGripperLeaveNotify(
GtkWidget* gripper, GdkEventCrossing* event) {
- if (!(event->state & GDK_BUTTON1_MASK))
+ if (!(event->state & GDK_BUTTON1_MASK)) {
gdk_window_set_cursor(gripper->window, NULL);
+ draw_gripper_ = false;
+ }
+
return FALSE;
}
@@ -792,8 +801,11 @@ gboolean BrowserActionsToolbarGtk::OnGripperButtonRelease(
gfx::Rect gripper_rect(0, 0,
gripper->allocation.width, gripper->allocation.height);
gfx::Point release_point(event->x, event->y);
- if (!gripper_rect.Contains(release_point))
+ if (!gripper_rect.Contains(release_point)) {
gdk_window_set_cursor(gripper->window, NULL);
+ draw_gripper_ = false;
+ gtk_widget_queue_draw(gripper);
+ }
// After the user resizes the toolbar, we want to smartly resize it to be
// the perfect size to fit the buttons.
« no previous file with comments | « chrome/browser/gtk/browser_actions_toolbar_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698