tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-01-11 20:27:40 +03:00
parent 63ad1dec90
commit b4d7ee058b
2 changed files with 19 additions and 16 deletions

View File

@ -519,8 +519,8 @@ module.SingleImageAutoHideCursor = core.ImageGridFeatures.Feature({
], ],
config: { config: {
'cursor-autohide-single-image-view': 'on', 'cursor-autohide-on-timeout-single-image-view': 'on',
'cursor-autohide-ribbon-view': 'off', 'cursor-autohide-on-timeout-ribbon-view': 'off',
}, },
handlers: [ handlers: [
@ -528,8 +528,8 @@ module.SingleImageAutoHideCursor = core.ImageGridFeatures.Feature({
['load', ['load',
function(){ function(){
var mode = this.toggleSingleImage('?') == 'on' ? var mode = this.toggleSingleImage('?') == 'on' ?
'cursor-autohide-single-image-view' 'cursor-autohide-on-timeout-single-image-view'
: 'cursor-autohide-ribbon-view' : 'cursor-autohide-on-timeout-ribbon-view'
this.toggleAutoHideCursorTimeout(this.config[mode] || 'off') this.toggleAutoHideCursorTimeout(this.config[mode] || 'off')
}], }],
@ -537,8 +537,8 @@ module.SingleImageAutoHideCursor = core.ImageGridFeatures.Feature({
['toggleAutoHideCursorTimeout', ['toggleAutoHideCursorTimeout',
function(){ function(){
var mode = this.toggleSingleImage('?') == 'on' ? var mode = this.toggleSingleImage('?') == 'on' ?
'cursor-autohide-single-image-view' 'cursor-autohide-on-timeout-single-image-view'
: 'cursor-autohide-ribbon-view' : 'cursor-autohide-on-timeout-ribbon-view'
this.config[mode] = this.toggleAutoHideCursorTimeout('?') this.config[mode] = this.toggleAutoHideCursorTimeout('?')
}], }],
@ -546,13 +546,13 @@ module.SingleImageAutoHideCursor = core.ImageGridFeatures.Feature({
['toggleSingleImage', ['toggleSingleImage',
function(){ function(){
if(this.toggleSingleImage('?') == 'on'){ if(this.toggleSingleImage('?') == 'on'){
this.toggleAutoHideCursorTimeout(this.config['cursor-autohide-single-image-view']) this.toggleAutoHideCursorTimeout(this.config['cursor-autohide-on-timeout-single-image-view'])
} else { } else {
this.toggleAutoHideCursorTimeout(this.config['cursor-autohide-ribbon-view']) this.toggleAutoHideCursorTimeout(this.config['cursor-autohide-on-timeout-ribbon-view'])
// XXX for some reason this is not working... // XXX for some reason this is not working...
this.toggleHiddenCursor(this.config['cursor-autohide-ribbon-view']) this.toggleHiddenCursor(this.config['cursor-autohide-on-timeout-ribbon-view'])
} }
}], }],
] ]

View File

@ -1590,7 +1590,6 @@ module.ShiftAnimation = core.ImageGridFeatures.Feature({
// and show it on next timeout/mousemove. // and show it on next timeout/mousemove.
// This will not stop watching the cursor, this setting the prop back // This will not stop watching the cursor, this setting the prop back
// on will re-enable autohide. // on will re-enable autohide.
// XXX needs testing...
// NOTE: chrome 49 + devtools open appears to prevent the cursor from // NOTE: chrome 49 + devtools open appears to prevent the cursor from
// being hidden... // being hidden...
var AutoHideCursor = var AutoHideCursor =
@ -1605,7 +1604,8 @@ module.AutoHideCursor = core.ImageGridFeatures.Feature({
config: { config: {
'cursor-autohide': 'on', 'cursor-autohide': 'on',
'cursor-autohide-on-timeout': 'on', 'cursor-autohide-on-timeout': 'off',
'cursor-autohide-on-keyboard': 'on',
'cursor-autohide-timeout': 1000, 'cursor-autohide-timeout': 1000,
'cursor-show-threshold': 10, 'cursor-show-threshold': 10,
@ -1667,8 +1667,6 @@ module.AutoHideCursor = core.ImageGridFeatures.Feature({
function(state){ function(state){
var that = this var that = this
console.log('!!!!!', state)
var viewer = this.ribbons.viewer var viewer = this.ribbons.viewer
// NOTE: this is handled by the keyboard feature... // NOTE: this is handled by the keyboard feature...
var kb_target = this.__keyboard_event_source || $(window) var kb_target = this.__keyboard_event_source || $(window)
@ -1680,7 +1678,7 @@ module.AutoHideCursor = core.ImageGridFeatures.Feature({
var x, y var x, y
var timer var timer
var timeout = var timeout =
that.config['cursor-autohide-on-timeout'] != 'off' ? that.toggleAutoHideCursorTimeout('?') == 'on' ?
(that.config['cursor-autohide-timeout'] || 1000) (that.config['cursor-autohide-timeout'] || 1000)
: -1 : -1
@ -1693,7 +1691,7 @@ module.AutoHideCursor = core.ImageGridFeatures.Feature({
// hide on timeout... // hide on timeout...
var timeout = var timeout =
that.config['cursor-autohide-on-timeout'] != 'off' ? that.toggleAutoHideCursorTimeout('?') == 'on' ?
(that.config['cursor-autohide-timeout'] || 1000) (that.config['cursor-autohide-timeout'] || 1000)
: -1 : -1
if(timeout && timeout > 0){ if(timeout && timeout > 0){
@ -1727,7 +1725,8 @@ module.AutoHideCursor = core.ImageGridFeatures.Feature({
return return
} }
that.toggleHiddenCursor('on') that.toggleAutoHideCursorKeyboard('?') == 'on'
&& that.toggleHiddenCursor('on')
return true return true
}) })
@ -1765,6 +1764,10 @@ module.AutoHideCursor = core.ImageGridFeatures.Feature({
core.makeConfigToggler('cursor-autohide-on-timeout', core.makeConfigToggler('cursor-autohide-on-timeout',
['on', 'off'], ['on', 'off'],
function(){ this.toggleAutoHideCursor('!') })], function(){ this.toggleAutoHideCursor('!') })],
toggleAutoHideCursorKeyboard: ['Interface/Hide cursor on keyboard',
core.makeConfigToggler('cursor-autohide-on-keyboard',
['on', 'off'],
function(){ this.toggleAutoHideCursor('!') })],
}), }),
handlers: [ handlers: [