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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc

Issue 10209037: Add key modifier to minimize/restore button click to minimize/restore-all panels for GTK (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use gtk_get_current_event Created 8 years, 7 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 | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/panels/panel_browser_titlebar_gtk.h" 5 #include "chrome/browser/ui/panels/panel_browser_titlebar_gtk.h"
6 6
7 #include "chrome/browser/ui/gtk/custom_button.h" 7 #include "chrome/browser/ui/gtk/custom_button.h"
8 #include "chrome/browser/ui/panels/panel.h" 8 #include "chrome/browser/ui/panels/panel.h"
9 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h" 9 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void PanelBrowserTitlebarGtk::UpdateMinimizeRestoreButtonVisibility() { 76 void PanelBrowserTitlebarGtk::UpdateMinimizeRestoreButtonVisibility() {
77 if (!unminimize_button_.get() || !minimize_button()) 77 if (!unminimize_button_.get() || !minimize_button())
78 return; 78 return;
79 79
80 Panel* panel = browser_window_->panel(); 80 Panel* panel = browser_window_->panel();
81 gtk_widget_set_visible(minimize_button()->widget(), panel->CanMinimize()); 81 gtk_widget_set_visible(minimize_button()->widget(), panel->CanMinimize());
82 gtk_widget_set_visible(unminimize_button_->widget(), panel->CanRestore()); 82 gtk_widget_set_visible(unminimize_button_->widget(), panel->CanRestore());
83 } 83 }
84 84
85 void PanelBrowserTitlebarGtk::HandleButtonClick(GtkWidget* button) { 85 void PanelBrowserTitlebarGtk::HandleButtonClick(GtkWidget* button) {
86 if (close_button() && close_button()->widget() == button) 86 if (close_button() && close_button()->widget() == button) {
87 browser_window_->panel()->Close(); 87 browser_window_->panel()->Close();
88 else if (minimize_button() && minimize_button()->widget() == button) 88 return;
89 browser_window_->panel()->Minimize(); 89 }
90 else if (unminimize_button_.get() && unminimize_button_->widget() == button) 90
91 browser_window_->panel()->Restore(); 91 GdkEvent* event = gtk_get_current_event();
92 DCHECK(event && event->type == GDK_BUTTON_RELEASE);
93
94 if (minimize_button() && minimize_button()->widget() == button) {
95 browser_window_->panel()->OnMinimizeButtonClicked(
96 (event->button.state & GDK_CONTROL_MASK) ?
97 panel::APPLY_TO_ALL : panel::NO_MODIFIER);
98 } else if (unminimize_button_.get() &&
99 unminimize_button_->widget() == button) {
100 browser_window_->panel()->OnRestoreButtonClicked(
101 (event->button.state & GDK_CONTROL_MASK) ?
102 panel::APPLY_TO_ALL : panel::NO_MODIFIER);
103 }
104
105 gdk_event_free(event);
92 } 106 }
93 107
94 void PanelBrowserTitlebarGtk::ShowFaviconMenu(GdkEventButton* event) { 108 void PanelBrowserTitlebarGtk::ShowFaviconMenu(GdkEventButton* event) {
95 // Favicon menu is not supported in panels. 109 // Favicon menu is not supported in panels.
96 } 110 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698