more work on external viewer/editor ui...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-01-07 02:34:16 +03:00
parent 9f7e267527
commit 598af58101
3 changed files with 35 additions and 7 deletions

View File

@ -387,6 +387,8 @@ module.WidgetTest = core.ImageGridFeatures.Feature({
// - pretty name
// - shortcut key
// - image type to open
// XXX add root button...
// XXX disable the remove button on "System default"
// XXX move this to a separate feature...
var ExternalEditorActions = actions.Actions({
@ -461,8 +463,6 @@ module.ExternalEditor = core.ImageGridFeatures.Feature({
var ExternalEditorUIActions = actions.Actions({
// XXX add root button...
// XXX disable the remove button on "System default"
listExtenalEditors: ['Edit/List external editors',
function(){
var that = this
@ -529,15 +529,35 @@ var ExternalEditorUIActions = actions.Actions({
// move to top...
['&diams;',
function(p){
var top = this.filter('*', false).first()
var target = this.filter(0, false)
var cur = this.filter('"'+p+'"', false)
var i = _getEditor(p)
if(!top.is(cur)){
top.before(cur)
if(!target.is(cur)){
target.before(cur)
editors.splice(0, 0, editors.splice(i, 1)[0])
that.config['external-editors'] = editors
}
}],
// set secondary editor...
// XXX make a simpler icon....
['<span style="letter-spacing: -4px">&diams;&diams;</span>',
function(p){
var target = this.filter(1, false)
var cur = this.filter('"'+p+'"', false)
var i = _getEditor(p)
if(!target.is(cur)){
if(target.prev().is(cur)){
target.after(cur)
} else {
target.before(cur)
}
editors.splice(1, 0, editors.splice(i, 1)[0])
that.config['external-editors'] = editors
}
}],
@ -582,6 +602,7 @@ var ExternalEditorUIActions = actions.Actions({
})
})
o.client.select(0)
o.client.dom.addClass('editor-list')
return o

View File

@ -125,12 +125,18 @@ body {
.browse-widget.editor-list .list div:first-child .text:after {
content: "(default)";
content: "(primary)";
margin-left: 5px;
opacity: 0.5;
font-style: italic;
}
.browse-widget.editor-list .list div:last-child {
.browse-widget.editor-list .list div:nth-child(2) .text:after {
content: "(secondary)";
margin-left: 5px;
opacity: 0.5;
font-style: italic;
}
.browse-widget.editor-list .list div:last-child .text {
font-style: italic;
}
.browse-widget.editor-list .list div:last-child .button {

View File

@ -230,6 +230,7 @@ module.GLOBAL_KEYBOARD = {
},
E: {
default: 'openInExtenalEditor',
shift: 'openInExtenalEditor: 1',
alt: 'listExtenalEditors',
},
C: 'browseActions: "/Crop/"',