[gnome-maps] MainWindow: add keybindings for zoom-in/out
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] MainWindow: add keybindings for zoom-in/out
- Date: Sat, 3 Aug 2013 10:20:54 +0000 (UTC)
commit db314d754186530450fcda23866321aa12363642
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Mon Jul 8 13:48:49 2013 +0200
MainWindow: add keybindings for zoom-in/out
https://bugzilla.gnome.org/show_bug.cgi?id=697701
src/mainWindow.js | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index a8031ad..65b5f3f 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -100,6 +100,8 @@ const MainWindow = new Lang.Class({
this._onConfigureEvent.bind(this));
this.window.connect('window-state-event',
this._onWindowStateEvent.bind(this));
+ this.window.connect('key-press-event',
+ this._onKeyPressEvent.bind(this));
this._searchEntry.connect('activate',
this._onSearchActivate.bind(this));
@@ -201,6 +203,22 @@ const MainWindow = new Lang.Class({
Application.settings.set_boolean('window-maximized', maximized);
},
+ _onKeyPressEvent: function(widget, event) {
+ let state = event.get_state()[1];
+
+ if (state & Gdk.ModifierType.CONTROL_MASK) {
+ let keyval = event.get_keyval()[1];
+
+ if (keyval === Gdk.KEY_plus)
+ this.mapView.view.zoom_in();
+
+ if (keyval === Gdk.KEY_minus)
+ this.mapView.view.zoom_out();
+ }
+
+ return false;
+ },
+
_onSearchActivate: function() {
let string = this._searchEntry.get_text();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]