diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-27 17:27:54 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-27 17:27:54 +0000 |
commit | a947ae340d0054c5f62ecb3ff760e83ba2041c0d (patch) | |
tree | f401f90ddbad69b1eb596ce35ebf7ab9e9548937 /chrome | |
parent | 5f46418438b0cd2570318fdcf03bb2e1e7855d9e (diff) | |
download | chromium_src-a947ae340d0054c5f62ecb3ff760e83ba2041c0d.zip chromium_src-a947ae340d0054c5f62ecb3ff760e83ba2041c0d.tar.gz chromium_src-a947ae340d0054c5f62ecb3ff760e83ba2041c0d.tar.bz2 |
Add keyboard accelerators for IDC_FIND_NEXT and IDC_FIND_PREVIOUS.
Review URL: http://codereview.chromium.org/101007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 43d7c95..c141659a 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -120,13 +120,19 @@ const struct AcceleratorMapping { { GDK_minus, IDC_ZOOM_MINUS, GDK_CONTROL_MASK }, { GDK_underscore, IDC_ZOOM_MINUS, GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, + { GDK_g, IDC_FIND_NEXT, GDK_CONTROL_MASK }, + { GDK_F3, IDC_FIND_NEXT, GdkModifierType(0) }, + { GDK_g, IDC_FIND_PREVIOUS, + GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, + { GDK_F3, IDC_FIND_PREVIOUS, GDK_SHIFT_MASK }, }; -int GetCommandFromKeyval(guint accel_key) { +int GetCommandId(guint accel_key, GdkModifierType modifier) { // Bug 9806: If capslock is on, we will get a capital letter as accel_key. accel_key = gdk_keyval_to_lower(accel_key); for (size_t i = 0; i < arraysize(kAcceleratorMap); ++i) { - if (kAcceleratorMap[i].keyval == accel_key) + if (kAcceleratorMap[i].keyval == accel_key && + kAcceleratorMap[i].modifier_type == modifier) return kAcceleratorMap[i].command_id; } NOTREACHED(); @@ -678,7 +684,7 @@ gboolean BrowserWindowGtk::OnGtkAccelerator(GtkAccelGroup* accel_group, guint keyval, GdkModifierType modifier, BrowserWindowGtk* browser_window) { - int command_id = GetCommandFromKeyval(keyval); + int command_id = GetCommandId(keyval, modifier); // We have to delay certain commands that may try to destroy widgets to which // GTK is currently holding a reference. (For now the only such command is // tab closing.) GTK will hold a reference on the RWHV widget when the |