Debian Codegraph @

test-app/test-app.qml

raw
1 import QtQuick 2.0
2 import QMLTermWidget 1.0
3 import QtQuick.Controls 1.2
4
5 Rectangle {
6 width: 640
7 height: 480
8
9 Action{
10 onTriggered: terminal.copyClipboard();
11 shortcut: "Ctrl+Shift+C"
12 }
13
14 Action{
15 onTriggered: terminal.pasteClipboard();
16 shortcut: "Ctrl+Shift+V"
17 }
18
19 Action{
20 onTriggered: searchButton.visible = !searchButton.visible
21 shortcut: "Ctrl+F"
22 }
23
24 Action{
25 onTriggered:{
26 console.log('open new terminal window in:'+mainsession.currentDir)
27 }
28 shortcut: "Ctrl+Shift+T"
29 }
30
31 QMLTermWidget {
32 id: terminal
33 anchors.fill: parent
34 font.family: "Monospace"
35 font.pointSize: 12
36 colorScheme: "cool-retro-term"
37 session: QMLTermSession{
38 id: mainsession
39 initialWorkingDirectory: "$HOME"
40 onMatchFound: {
41 console.log("found at: %1 %2 %3 %4".arg(startColumn).arg(startLine).arg(endColumn).arg(endLine));
42 }
43 onNoMatchFound: {
44 console.log("not found");
45 }
46 }
47 onTerminalUsesMouseChanged: console.log(terminalUsesMouse);
48 onTerminalSizeChanged: console.log(terminalSize);
49 Component.onCompleted: mainsession.startShellProgram();
50
51 QMLTermScrollbar {
52 terminal: terminal
53 width: 20
54 Rectangle {
55 opacity: 0.4
56 anchors.margins: 5
57 radius: width * 0.5
58 anchors.fill: parent
59 }
60 }
61
62 }
63
64 Button {
65 id: searchButton
66 text: "Find version"
67 anchors.bottom: parent.bottom
68 anchors.right: parent.right
69 visible: false
70 onClicked: mainsession.search("version");
71 }
72 Component.onCompleted: terminal.forceActiveFocus();
73 }