From 2651ed943f71c669640379760187b26df948fe0f Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 23 Nov 2016 16:14:38 +0300 Subject: [PATCH] tweaks + testing... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/keyboard.js | 10 ++++++++++ ui (gen4)/features/ui.js | 19 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ui (gen4)/features/keyboard.js b/ui (gen4)/features/keyboard.js index b9e3df9a..a50682d1 100755 --- a/ui (gen4)/features/keyboard.js +++ b/ui (gen4)/features/keyboard.js @@ -182,6 +182,16 @@ module.GLOBAL_KEYBOARD = { alt: 'browseActions: "/History/" -- Open history menu', }, V: 'flipVertical', + + // tilt... + // XXX experimental, not sure if wee need this with a keyboard... + T: { + default: 'rotateRibbonCCW -- Tilt ribbons counter clock wise', + shift: 'rotateRibbonCW -- Tilt ribbons clock wise', + + alt: 'resetRibbonRotation -- Reset ribbon tilt', + }, + P: { 'ctrl+shift': 'F12', }, diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index f89acb19..9ff3637a 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -176,6 +176,8 @@ module.ViewerActions = actions.Actions({ 'transparent-ribbon', ], + 'ribbon-rotation-step': 10, + // XXX BUG: for some reason this get's shadowed by base.config... 'ribbon-focus-modes': [ 'visual', // select image closest visually @@ -867,10 +869,23 @@ module.ViewerActions = actions.Actions({ return this.ribbons.rotate() || 0 } }], + + // Rotate ribbon CW/CCW... + // + // Rotate ribbon (default step) + // .rotateRibbonCW() + // + // Rotate ribbon by step... + // .rotateRibbonCW(5) + // + // NOTE: default step is set by .config['ribbon-rotation-step'] rotateRibbonCW: ['Interface/Rotate ribbon clockwise', - function(a){ this.ribbonRotation('+='+ (a || 10)) }], + function(a){ + this.ribbonRotation('+='+ (a || this.config['ribbon-rotation-step'] || 10)) }], rotateRibbonCCW: ['Interface/Rotate ribbon coounter clockwise', - function(a){ this.ribbonRotation('-='+ (a || 10)) }], + function(a){ + this.ribbonRotation('-='+ (a || this.config['ribbon-rotation-step'] || 10)) }], + resetRibbonRotation: ['Interface/Reset ribbon rotation', function(){ this.ribbonRotation(0) }],