tree: add "r" shortcut for "show widget in session"
This commit is contained in:
parent
03eaab432a
commit
343a18541c
4 changed files with 32 additions and 15 deletions
|
|
@ -101,7 +101,9 @@ Multiple widgets can be edited at once.
|
|||
| ++down++ | Select current widget's next sibling |
|
||||
| ++left++ | Select current widget's parent |
|
||||
| ++right++ | Select current widget's first child |
|
||||
| ++t++ | Show selected widget in the project tree |
|
||||
| ++t++ | Show selected widget(s) in the project tree |
|
||||
| ++r++ | Show selected widget(s) in the session |
|
||||
| ++ctrl+f++ | Focus search input in project tree |
|
||||
| ++"Home"++ | Send selected widget to back |
|
||||
| ++"Page Up"++ | Send selected widget farther |
|
||||
| ++"Page Down"++ | Bring selected widget closer |
|
||||
|
|
@ -142,6 +144,8 @@ Multiple widgets can be edited at once.
|
|||
| ++left++ | Select current widget's parent |
|
||||
| ++right++ | Select current widget's first child |
|
||||
| ++t++ | Show selected widget in the project tree |
|
||||
| ++r++ | Show selected widget(s) in the session |
|
||||
| ++cmd+f++ | Focus search input in project tree |
|
||||
| ++"Home"++ | Send selected widget to back |
|
||||
| ++"Page Up"++ | Send selected widget farther |
|
||||
| ++"Page Down"++ | Bring selected widget closer |
|
||||
|
|
|
|||
|
|
@ -105,20 +105,10 @@ var handleClick = function(event) {
|
|||
label: icon('eye') + ' ' + locales('editor_show_in_session'),
|
||||
action: ()=>{
|
||||
for (let w of editor.selectedWidgets) {
|
||||
var parent = w
|
||||
while (parent !== widgetManager) {
|
||||
if (parent.getProp('type') === 'tab') parent.parent.setValue(parent.parent.children.indexOf(parent), {sync: true, send: true})
|
||||
else if (parent.getProp('type') === 'modal') parent.setValue(1, {sync: true, send: true})
|
||||
parent = parent.parent
|
||||
}
|
||||
w.container.classList.add('editor-blink')
|
||||
w.container.scrollIntoView({block: 'center'})
|
||||
setTimeout(()=>{
|
||||
w.container.classList.remove('editor-blink')
|
||||
}, 800)
|
||||
editor.widgetTree.showWidgetInSession(w)
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
shortcut: 'r'
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ class Editor {
|
|||
'home',
|
||||
'end',
|
||||
't',
|
||||
'r',
|
||||
'f2',
|
||||
'h',
|
||||
'mod + f'
|
||||
|
|
@ -452,7 +453,13 @@ class Editor {
|
|||
if (!this.selectedWidgets.length) return
|
||||
this.widgetTree.showWidget(editor.selectedWidgets[0])
|
||||
this.widgetTree.blinkSelected()
|
||||
|
||||
break
|
||||
case 'r':
|
||||
if (!this.selectedWidgets.length) return
|
||||
for (let w of editor.selectedWidgets) {
|
||||
this.widgetTree.showWidgetInSession(w)
|
||||
}
|
||||
this.widgetTree.showWidget(editor.selectedWidgets[0])
|
||||
break
|
||||
case 'f2':
|
||||
if (!this.selectedWidgets.length) return
|
||||
|
|
|
|||
|
|
@ -240,6 +240,22 @@ class UiTree extends UiWidget {
|
|||
|
||||
}
|
||||
|
||||
showWidgetInSession(widget) {
|
||||
|
||||
var parent = widget
|
||||
while (parent !== widgetManager) {
|
||||
if (parent.getProp('type') === 'tab') parent.parent.setValue(parent.parent.children.indexOf(parent), {sync: true, send: true})
|
||||
else if (parent.getProp('type') === 'modal') parent.setValue(1, {sync: true, send: true})
|
||||
parent = parent.parent
|
||||
}
|
||||
widget.container.classList.add('editor-blink')
|
||||
widget.container.scrollIntoView({block: 'center'})
|
||||
setTimeout(()=>{
|
||||
widget.container.classList.remove('editor-blink')
|
||||
}, 800)
|
||||
|
||||
}
|
||||
|
||||
select() {
|
||||
|
||||
// hint selection in folded containers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue