From b21cf47b23c55aebb2691d460275c21c5b9732e4 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 21 May 2020 05:19:54 +0300 Subject: [PATCH] added optional timeout to status-bar info + now announcing image filters... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui-status.js | 21 +++++++++++++++------ ui (gen4)/features/ui.js | 8 +++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ui (gen4)/features/ui-status.js b/ui (gen4)/features/ui-status.js index f5659541..2ce8faf3 100755 --- a/ui (gen4)/features/ui-status.js +++ b/ui (gen4)/features/ui-status.js @@ -717,16 +717,25 @@ var StatusBarActions = actions.Actions({ // XXX revise... showStatusBarInfo: ['- Interface/', - function(text){ + function(text, timeout){ + // reset clear timeout... + this.__statusbar_info_timeout + && clearTimeout(this.__statusbar_info_timeout) + delete this.__statusbar_info_timeout + var bar = this.dom.find('.state-indicator-container.global-info') - if(text){ + text ? bar.find('.info').text(text) + : bar.find('.info').empty() - } else { - bar.find('.info').empty() - } - }], + // clear after timeout... + timeout + && text && text.trim() != '' + && (this.__statusbar_info_timeout = + setTimeout(function(){ + delete this.__statusbar_info_timeout + this.showStatusBarInfo() }.bind(this), timeout)) }], }) var StatusBar = diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index ffc5b843..a579ed85 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -2174,7 +2174,8 @@ module.PreviewFilters = core.ImageGridFeatures.Feature({ tag: 'ui-preview-filters', depends: [ - 'ui' + 'ui', + 'ui-status-bar', ], config: { @@ -2263,6 +2264,11 @@ module.PreviewFilters = core.ImageGridFeatures.Feature({ handlers: [ ['focusImage', function(){ this.togglePreviewFilter('No filters') }], + ['togglePreviewFilter', + function(res){ + res != 'No filters' ? + this.showStatusBarInfo(res, 1000) + : this.showStatusBarInfo() }], ], })