[the-board] [ui] Add key shortcuts for alignment and distribution actions



commit 58d5ba4129775823273002d20492f113b7d194b6
Author: Lucas Rocha <lucasr gnome org>
Date:   Thu Mar 17 10:52:05 2011 +0000

    [ui] Add key shortcuts for alignment and distribution actions
    
    Here a new key bindings:
      Ctrl+H - Distribute horizontally
      Ctrl+G - Distribute vertically
      Ctrl+U - Align to the left
      Ctrl+I - Align to the right
      Ctrl+J - Align to the top
      Ctrl+K - Align to the bottom
    
    Those only work on selected items in the page.

 src/js/ui/mainWindow.js |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 362b77b..230fe6d 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -817,6 +817,30 @@ MainWindow.prototype = {
         } else if (isControl && text == 'q') {
             this._quitApp();
             return true;
+        } else if (isControl && text == 'h') {
+            this._currentPage.doAction("distribute",
+                                       { orientation: Page.Orientation.HORIZONTAL });
+            return true;
+        } else if (isControl && text == 'g') {
+            this._currentPage.doAction("distribute",
+                                       { orientation: Page.Orientation.VERTICAL });
+            return true;
+        } else if (isControl && text == 'u') {
+            this._currentPage.doAction("align",
+                                       { alignment: Page.Alignment.LEFT });
+            return true;
+        } else if (isControl && text == 'i') {
+            this._currentPage.doAction("align",
+                                       { alignment: Page.Alignment.RIGHT });
+            return true;
+        } else if (isControl && text == 'j') {
+            this._currentPage.doAction("align",
+                                       { alignment: Page.Alignment.TOP });
+            return true;
+        } else if (isControl && text == 'k') {
+            this._currentPage.doAction("align",
+                                       { alignment: Page.Alignment.BOTTOM });
+            return true;
         }
 
         return false;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]