From 779f90865ac61b237043546731992376f6c07d73 Mon Sep 17 00:00:00 2001 From: molan-git Date: Sun, 12 Jul 2020 09:12:34 +0200 Subject: [PATCH] UI improvements & fixes --- qml/pages/ConversationPage.qml | 47 +++++++++++++++++----------- qml/pages/MainPage.qml | 18 +++++------ qml/pages/components/EmojiSelect.qml | 3 +- qml/pages/components/MyList.qml | 21 +++++++++++-- 4 files changed, 57 insertions(+), 32 deletions(-) diff --git a/qml/pages/ConversationPage.qml b/qml/pages/ConversationPage.qml index 6cea652..dfa2b45 100644 --- a/qml/pages/ConversationPage.qml +++ b/qml/pages/ConversationPage.qml @@ -8,20 +8,32 @@ import "./components/" Page { id: conversationPage - property string type - property string username: "" - property string headerTitle: "" - property string suggestedUser: "" property ListModel suggestedModel - property string status_id: "" - property string status_url: "" - property string status_uri: "" + property ListModel mdl property int tootMaxChar: 500 property bool bot: false //otherwise ReferenceError ProfileHeader.qml property bool followed_by: false //otherwise ReferenceError ProfileHeader.qml property bool locked: false //otherwise ReferenceError ProfileHeader.qml property bool group: false //otherwise ReferenceError ProfileHeader.qml - property ListModel mdl + property string type + property string username: "" + property string headerTitle: "" + property string suggestedUser: "" + property string status_id: "" + property string status_url: "" + property string status_uri: "" + property string status_link: + if (status_url === "") { + var test = status_uri.split("/") + console.log(status_uri) + console.log(JSON.stringify(test)) + console.log(JSON.stringify(test.length)) + if (test.length === 8 && (test[7] === "activity")) { + var urialt = status_uri.replace("activity", "") + status_link = urialt + } + else status_link = status_uri + } else status_link = status_url allowedOrientations: Orientation.All onSuggestedUserChanged: { @@ -96,20 +108,17 @@ Page { id: pulleyConversation visible: type === "reply" + MenuItem { + text: qsTr("Open in Browser") + onClicked: { + Qt.openUrlExternally(status_link) + } + } + MenuItem { //: Use the translation of "Copy Link" for a shorter PullDownMenu label text: qsTr("Copy Link to Clipboard") - onClicked: if (status_url === "") { - var test = status_uri.split("/") - console.log(status_uri) - console.log(JSON.stringify(test)) - console.log(JSON.stringify(test.length)) - if (test.length === 8 && (test[7] === "activity")) { - var urialt = status_uri.replace("activity", "") - Clipboard.text = urialt - } - else Clipboard.text = status_uri - } else Clipboard.text = status_url + onClicked: Clipboard.text = status_link } MenuItem { diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index cb47a5c..0ce3be1 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -85,7 +85,7 @@ Page { height: parent.itemHeight onSearchChanged: { console.log(search) - //loader.sourceComponent = loading + loader.sourceComponent = loading if (search.charAt(0) === "@") { loader.sourceComponent = userListComponent } else if (search.charAt(0) === "#") { @@ -119,14 +119,14 @@ Page { } } -// Component { -// id: loading -// BusyIndicator { -// size: BusyIndicatorSize.Large -// anchors.centerIn: parent -// running: true -// } -// } + Component { + id: loading + BusyIndicator { + size: BusyIndicatorSize.Large + anchors.centerIn: parent + running: true + } + } Component { id: tagListComponent diff --git a/qml/pages/components/EmojiSelect.qml b/qml/pages/components/EmojiSelect.qml index 5580d37..7e808e2 100644 --- a/qml/pages/components/EmojiSelect.qml +++ b/qml/pages/components/EmojiSelect.qml @@ -20,8 +20,6 @@ Dialog { width: parent.width height: parent.height - VerticalScrollDecorator { flickable: gridView} - SilicaGridView { id: gridView header: PageHeader { @@ -266,6 +264,7 @@ Dialog { emojiDialog.accept() } } + VerticalScrollDecorator { flickable: gridView } } } } diff --git a/qml/pages/components/MyList.qml b/qml/pages/components/MyList.qml index a4add0b..23ddd73 100644 --- a/qml/pages/components/MyList.qml +++ b/qml/pages/components/MyList.qml @@ -42,15 +42,32 @@ SilicaListView { } BusyLabel { - id: loadStatusList + id: myListBusyLabel running: model.count === 0 anchors { horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter } + + Timer { + interval: 5000 + running: true + onTriggered: { + myListBusyLabel.visible = false + loadStatusPlaceholder.visible = true + } + } + } + + ViewPlaceholder { + id: loadStatusPlaceholder + visible: false + enabled: model.count === 0 + text: qsTr("Nothing found") } PullDownMenu { + id: mainPulleyMenu MenuItem { text: qsTr("Settings") visible: !profilePage @@ -119,7 +136,7 @@ SilicaListView { BusyIndicator { running: loadStarted - visible: loadStatusList.running ? false : true + visible: myListBusyLabel.running ? false : true size: BusyIndicatorSize.Small anchors { verticalCenter: parent.verticalCenter