diff options
author | Adrian Kummerlaender | 2015-08-19 11:13:35 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2015-08-19 11:13:35 +0200 |
commit | 4cb435f2a7bbeafb53f067d95ec83e0b3a1a17f8 (patch) | |
tree | ad308460ab5f47f498b4d2432e36c7511c5e9aab /src/list/TerminalList.qml | |
parent | 90da724a56c2ff20617d3e231a6ef877928df482 (diff) | |
download | MetaTerm-4cb435f2a7bbeafb53f067d95ec83e0b3a1a17f8.tar MetaTerm-4cb435f2a7bbeafb53f067d95ec83e0b3a1a17f8.tar.gz MetaTerm-4cb435f2a7bbeafb53f067d95ec83e0b3a1a17f8.tar.bz2 MetaTerm-4cb435f2a7bbeafb53f067d95ec83e0b3a1a17f8.tar.lz MetaTerm-4cb435f2a7bbeafb53f067d95ec83e0b3a1a17f8.tar.xz MetaTerm-4cb435f2a7bbeafb53f067d95ec83e0b3a1a17f8.tar.zst MetaTerm-4cb435f2a7bbeafb53f067d95ec83e0b3a1a17f8.zip |
Extract all settings into `SettingsHandler` object
This enables the user to straight forwardly change all application settings via command mode.
During the implementation of this change I discovered that the way I was passing around `StateHandler` and `SettingsHandler` instances using properties was unnecessary. If all object instances are created in a common hierarchy they can access each other by their `id` property - i.e. `settings` and `mode` are available to the whole application without property trickery.
Diffstat (limited to 'src/list/TerminalList.qml')
-rw-r--r-- | src/list/TerminalList.qml | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/list/TerminalList.qml b/src/list/TerminalList.qml index 6c6465b..9c1636f 100644 --- a/src/list/TerminalList.qml +++ b/src/list/TerminalList.qml @@ -4,12 +4,13 @@ import QtQuick.Layouts 1.1 Item { id: item - property StateHandler state : null - property int activeItem : 0 - property int itemIndex : 0 + property int activeItem : 0 + property int itemIndex : 0 property alias children : column.children + property Component terminalItem : Component { TerminalItem { } } + function onItemExecuted(index) { if ( index === (children.length - 1) ) { createItem(); @@ -17,11 +18,10 @@ Item { } function createItem() { - var terminalItem = Qt.createComponent("qrc:/TerminalItem.qml"); var instantiateTerminal = function() { var instance = terminalItem.createObject(column, { - "index": itemIndex, - "width": flickable.width + "index" : itemIndex, + "width" : flickable.width }); instance.onExecuted.connect(onItemExecuted); @@ -67,7 +67,7 @@ Item { if ( activeItem < (children.length - 1) ) { selectItem(activeItem + 1); } else { - state.enterInsertMode(); + mode.enterInsertMode(); } } |