aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-07-18 21:31:27 +0200
committerAdrian Kummerlaender2015-07-18 21:31:27 +0200
commitdbb98babd5de116609e849bba4382cf9af9458bc (patch)
treeeae368011b47e1609a5fcfc790755b8acad36f9c
parentcdec039fe30ec2bcb75a9a1596b32fa6eeed6b74 (diff)
downloadMetaTerm-dbb98babd5de116609e849bba4382cf9af9458bc.tar
MetaTerm-dbb98babd5de116609e849bba4382cf9af9458bc.tar.gz
MetaTerm-dbb98babd5de116609e849bba4382cf9af9458bc.tar.bz2
MetaTerm-dbb98babd5de116609e849bba4382cf9af9458bc.tar.lz
MetaTerm-dbb98babd5de116609e849bba4382cf9af9458bc.tar.xz
MetaTerm-dbb98babd5de116609e849bba4382cf9af9458bc.tar.zst
MetaTerm-dbb98babd5de116609e849bba4382cf9af9458bc.zip
Added terminal resizing commands
-rw-r--r--qml/TerminalItem.qml10
-rw-r--r--qml/main.qml88
2 files changed, 81 insertions, 17 deletions
diff --git a/qml/TerminalItem.qml b/qml/TerminalItem.qml
index 13a19dd..b417a6b 100644
--- a/qml/TerminalItem.qml
+++ b/qml/TerminalItem.qml
@@ -13,7 +13,7 @@ Item {
height: elementList.height
function select() {
- if ( terminal == null ) {
+ if ( terminal === null ) {
highlighter.select();
} else {
terminal.select();
@@ -21,7 +21,7 @@ Item {
}
function deselect() {
- if ( terminal == null ) {
+ if ( terminal === null ) {
highlighter.deselect();
} else {
terminal.deselect();
@@ -31,7 +31,7 @@ Item {
function forceActiveFocus() {
scope.forceActiveFocus();
- if ( terminal == null ) {
+ if ( terminal === null ) {
scope.forceActiveFocus();
highlighter.select();
highlighter.focus();
@@ -39,7 +39,7 @@ Item {
}
function unfocus() {
- if ( terminal == null ) {
+ if ( terminal === null ) {
highlighter.unfocus();
}
}
@@ -110,7 +110,7 @@ Item {
Layout.fillWidth: true
onAccepted: {
- if ( item.terminal == null ) {
+ if ( item.terminal === null ) {
readOnly = true;
focus = false;
diff --git a/qml/main.qml b/qml/main.qml
index 70110db..3a4bad2 100644
--- a/qml/main.qml
+++ b/qml/main.qml
@@ -97,6 +97,10 @@ ApplicationWindow {
children[activeItem].unfocus();
}
+ function getCurrent() {
+ return children[activeItem];
+ }
+
TerminalItem {
width: terminalListFlickable.width
onExecuted: terminalList.createItem()
@@ -109,12 +113,16 @@ ApplicationWindow {
shortcut: "i"
enabled: false
onTriggered: {
- escapeTerminalAction.enabled = true;
- insertTerminalAction.enabled = false;
- nextTerminalAction.enabled = false;
- prevTerminalAction.enabled = false;
- lastTerminalAction.enabled = false;
- firstTerminalAction.enabled = false;
+ escapeTerminalAction.enabled = true;
+ insertTerminalAction.enabled = false;
+ nextTerminalAction.enabled = false;
+ heightenTerminalAction.enabled = false;
+ shortenTerminalAction.enabled = false;
+ widenTerminalAction.enabled = false;
+ narrowTerminalAction.enabled = false;
+ prevTerminalAction.enabled = false;
+ lastTerminalAction.enabled = false;
+ firstTerminalAction.enabled = false;
terminalList.focusCurrent();
}
@@ -124,12 +132,16 @@ ApplicationWindow {
id: escapeTerminalAction
shortcut: "Shift+ESC"
onTriggered: {
- escapeTerminalAction.enabled = false;
- insertTerminalAction.enabled = true;
- nextTerminalAction.enabled = true;
- prevTerminalAction.enabled = true;
- lastTerminalAction.enabled = true;
- firstTerminalAction.enabled = true;
+ escapeTerminalAction.enabled = false;
+ insertTerminalAction.enabled = true;
+ nextTerminalAction.enabled = true;
+ heightenTerminalAction.enabled = true;
+ shortenTerminalAction.enabled = true;
+ widenTerminalAction.enabled = true;
+ narrowTerminalAction.enabled = true;
+ prevTerminalAction.enabled = true;
+ lastTerminalAction.enabled = true;
+ firstTerminalAction.enabled = true;
terminalList.forceActiveFocus();
terminalList.unfocusCurrent();
@@ -144,6 +156,58 @@ ApplicationWindow {
}
Action {
+ id: heightenTerminalAction
+ shortcut: "Shift+J"
+ enabled: false
+ onTriggered: {
+ var current = terminalList.getCurrent().terminal;
+
+ if ( current !== null ) {
+ current.lines += 1;
+ }
+ }
+ }
+
+ Action {
+ id: shortenTerminalAction
+ shortcut: "Shift+K"
+ enabled: false
+ onTriggered: {
+ var current = terminalList.getCurrent().terminal;
+
+ if ( current !== null ) {
+ current.lines -= 1;
+ }
+ }
+ }
+
+ Action {
+ id: widenTerminalAction
+ shortcut: "Shift+L"
+ enabled: false
+ onTriggered: {
+ var current = terminalList.getCurrent().terminal;
+
+ if ( current !== null ) {
+ current.columns += 1;
+ }
+ }
+ }
+
+ Action {
+ id: narrowTerminalAction
+ shortcut: "Shift+H"
+ enabled: false
+ onTriggered: {
+ var current = terminalList.getCurrent().terminal;
+
+ if ( current !== null ) {
+ current.columns -= 1;
+ }
+ }
+ }
+
+ Action {
id: prevTerminalAction
shortcut: "k"
enabled: false