Add shortcuts

This commit is contained in:
Alex Spataru 2021-02-06 21:58:08 -05:00
parent e3a19ec7c4
commit 6ffb522d86
3 changed files with 77 additions and 1 deletions

View File

@ -94,7 +94,7 @@ Rectangle {
}
//
// Selects all the text
// Selects all the text
//
function selectAll() {
var item = null
@ -105,6 +105,18 @@ Rectangle {
}
}
//
// De-selects all the text
//
function deselect() {
var item = null
for (var i = 0; i < listView.count; ++i) {
item = listView.itemAtIndex(i)
if (item !== null)
item.selected = false
}
}
//
// Updates the caret line location so that its shown in the vertical location of
// the given @a mouse area

View File

@ -81,6 +81,22 @@ Control {
onActivated: Cpp_IO_Console.save()
}
//
// Clear console data shortcut
//
Shortcut {
sequence: StandardKey.Delete
onActivated: Cpp_IO_Console.clear()
}
//
// Deselect text with escape key
//
Shortcut {
sequences: ["escape", "space"]
onActivated: logView.deselect()
}
//
// Right-click context menu
//

View File

@ -128,6 +128,54 @@ ApplicationWindow {
Cpp_IO_Console.append(Cpp_Misc_Translator.welcomeConsoleText())
}
//
// Shortcut to show/hide setup panel
//
Shortcut {
sequence: "Ctrl+,"
onActivated: toolbar.setupClicked()
}
//
// Shortcut to show/hide dashboard
//
Shortcut {
sequence: "Ctrl+d"
onActivated: toolbar.dataClicked()
}
//
// Shortcut to show/hide widgets
//
Shortcut {
sequence: "Ctrl+w"
onActivated: toolbar.widgetsClicked()
}
//
// Shortcut to show/hide terminal
//
Shortcut {
sequence: "Ctrl+t"
onActivated: toolbar.consoleClicked()
}
//
// Shortcut to show/hide terminal
//
Shortcut {
sequence: "F1"
onActivated: about.show()
}
//
// Shortcut to open CSV file
//
Shortcut {
sequence: StandardKey.Open
onActivated: Cpp_CSV_Player.openFile()
}
//
// Startup timer
//