diff options
author | Adrian Kummerlaender | 2015-07-18 22:06:13 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2015-07-18 22:06:13 +0200 |
commit | ee80c422c341068188820a9e5d9757be80735012 (patch) | |
tree | 149dfb5a2adf2ba9aac5d4f53d6f27b346811aed | |
parent | dbb98babd5de116609e849bba4382cf9af9458bc (diff) | |
download | MetaTerm-ee80c422c341068188820a9e5d9757be80735012.tar MetaTerm-ee80c422c341068188820a9e5d9757be80735012.tar.gz MetaTerm-ee80c422c341068188820a9e5d9757be80735012.tar.bz2 MetaTerm-ee80c422c341068188820a9e5d9757be80735012.tar.lz MetaTerm-ee80c422c341068188820a9e5d9757be80735012.tar.xz MetaTerm-ee80c422c341068188820a9e5d9757be80735012.tar.zst MetaTerm-ee80c422c341068188820a9e5d9757be80735012.zip |
Moved terminal resizing methods to `TerminalItem`
-rw-r--r-- | qml/TerminalItem.qml | 24 | ||||
-rw-r--r-- | qml/main.qml | 32 |
2 files changed, 28 insertions, 28 deletions
diff --git a/qml/TerminalItem.qml b/qml/TerminalItem.qml index b417a6b..acc2f8e 100644 --- a/qml/TerminalItem.qml +++ b/qml/TerminalItem.qml @@ -44,6 +44,30 @@ Item { } } + function widen() { + if ( terminal !== null ) { + terminal.columns += 1; + } + } + + function narrow() { + if ( terminal !== null ) { + terminal.columns -= 1; + } + } + + function heighten() { + if ( terminal !== null ) { + terminal.lines += 1; + } + } + + function shorten() { + if ( terminal !== null ) { + terminal.lines -= 1; + } + } + FocusScope { id: scope diff --git a/qml/main.qml b/qml/main.qml index 3a4bad2..a2355e9 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -159,52 +159,28 @@ ApplicationWindow { id: heightenTerminalAction shortcut: "Shift+J" enabled: false - onTriggered: { - var current = terminalList.getCurrent().terminal; - - if ( current !== null ) { - current.lines += 1; - } - } + onTriggered: terminalList.getCurrent().heighten() } Action { id: shortenTerminalAction shortcut: "Shift+K" enabled: false - onTriggered: { - var current = terminalList.getCurrent().terminal; - - if ( current !== null ) { - current.lines -= 1; - } - } + onTriggered: terminalList.getCurrent().shorten() } Action { id: widenTerminalAction shortcut: "Shift+L" enabled: false - onTriggered: { - var current = terminalList.getCurrent().terminal; - - if ( current !== null ) { - current.columns += 1; - } - } + onTriggered: terminalList.getCurrent().widen() } Action { id: narrowTerminalAction shortcut: "Shift+H" enabled: false - onTriggered: { - var current = terminalList.getCurrent().terminal; - - if ( current !== null ) { - current.columns -= 1; - } - } + onTriggered: terminalList.getCurrent().narrow() } Action { |