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

Unified 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, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc
diff --git a/chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc b/chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc
index d1d80dc45a58f66b0b2c1dfecd9890131a07081c..df7083ce5fe04744b359444a1da9969b5c17bfc3 100644
--- a/chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc
+++ b/chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc
@@ -83,12 +83,26 @@ void PanelBrowserTitlebarGtk::UpdateMinimizeRestoreButtonVisibility() {
}
void PanelBrowserTitlebarGtk::HandleButtonClick(GtkWidget* button) {
- if (close_button() && close_button()->widget() == button)
+ if (close_button() && close_button()->widget() == button) {
browser_window_->panel()->Close();
- else if (minimize_button() && minimize_button()->widget() == button)
- browser_window_->panel()->Minimize();
- else if (unminimize_button_.get() && unminimize_button_->widget() == button)
- browser_window_->panel()->Restore();
+ return;
+ }
+
+ GdkEvent* event = gtk_get_current_event();
+ DCHECK(event && event->type == GDK_BUTTON_RELEASE);
+
+ if (minimize_button() && minimize_button()->widget() == button) {
+ browser_window_->panel()->OnMinimizeButtonClicked(
+ (event->button.state & GDK_CONTROL_MASK) ?
+ panel::APPLY_TO_ALL : panel::NO_MODIFIER);
+ } else if (unminimize_button_.get() &&
+ unminimize_button_->widget() == button) {
+ browser_window_->panel()->OnRestoreButtonClicked(
+ (event->button.state & GDK_CONTROL_MASK) ?
+ panel::APPLY_TO_ALL : panel::NO_MODIFIER);
+ }
+
+ gdk_event_free(event);
}
void PanelBrowserTitlebarGtk::ShowFaviconMenu(GdkEventButton* event) {
« 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