From 166a8206a3747628182a97acbc25bf393e78eac9 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Sat, 15 Apr 2017 16:08:40 +0200 Subject: Handle joining of channels, tab UI, probably some other things --- main.qml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'main.qml') diff --git a/main.qml b/main.qml index e1052fd..9623c04 100644 --- a/main.qml +++ b/main.qml @@ -27,18 +27,20 @@ ApplicationWindow { id: channel_tabs objectName: "channel_tabs" TabButton { - text: "a" + objectName: "channel-status" + text: "status" } - function add_channel(channel){ + function add_channel(channel) { var newTab = tabButton.createObject(channel_tabs, {"text": channel}) - channel_tabs.addItem(newTab) - var newChannel = Qt.createComponent("Page1.qml").createObject(swipeView, {"objectName": "channel"+channel}) - + channel_tabs.insertItem(channel_tabs.count, newTab) + var newChannel = Qt.createComponent("IrcChannel.qml").createObject(swipeView, {"objectName": "channel-"+channel}) + channel_tabs.currentIndex = channel_tabs.count-1 + for (var i = 0; i < newChannel.children.length; ++i) { + if (newChannel.children[i].objectName === "input") { + newChannel.children[i].focus = true + } + } } - - - } - } -- cgit v1.2.3