UI improvements & fixes

This commit is contained in:
molan-git 2020-07-12 09:12:34 +02:00
parent bc8bcf39e5
commit 779f90865a
4 changed files with 57 additions and 32 deletions

View file

@ -8,20 +8,32 @@ import "./components/"
Page { Page {
id: conversationPage id: conversationPage
property string type
property string username: ""
property string headerTitle: ""
property string suggestedUser: ""
property ListModel suggestedModel property ListModel suggestedModel
property string status_id: "" property ListModel mdl
property string status_url: ""
property string status_uri: ""
property int tootMaxChar: 500 property int tootMaxChar: 500
property bool bot: false //otherwise ReferenceError ProfileHeader.qml property bool bot: false //otherwise ReferenceError ProfileHeader.qml
property bool followed_by: false //otherwise ReferenceError ProfileHeader.qml property bool followed_by: false //otherwise ReferenceError ProfileHeader.qml
property bool locked: false //otherwise ReferenceError ProfileHeader.qml property bool locked: false //otherwise ReferenceError ProfileHeader.qml
property bool group: 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 allowedOrientations: Orientation.All
onSuggestedUserChanged: { onSuggestedUserChanged: {
@ -96,20 +108,17 @@ Page {
id: pulleyConversation id: pulleyConversation
visible: type === "reply" visible: type === "reply"
MenuItem {
text: qsTr("Open in Browser")
onClicked: {
Qt.openUrlExternally(status_link)
}
}
MenuItem { MenuItem {
//: Use the translation of "Copy Link" for a shorter PullDownMenu label //: Use the translation of "Copy Link" for a shorter PullDownMenu label
text: qsTr("Copy Link to Clipboard") text: qsTr("Copy Link to Clipboard")
onClicked: if (status_url === "") { onClicked: Clipboard.text = status_link
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
} }
MenuItem { MenuItem {

View file

@ -85,7 +85,7 @@ Page {
height: parent.itemHeight height: parent.itemHeight
onSearchChanged: { onSearchChanged: {
console.log(search) console.log(search)
//loader.sourceComponent = loading loader.sourceComponent = loading
if (search.charAt(0) === "@") { if (search.charAt(0) === "@") {
loader.sourceComponent = userListComponent loader.sourceComponent = userListComponent
} else if (search.charAt(0) === "#") { } else if (search.charAt(0) === "#") {
@ -119,14 +119,14 @@ Page {
} }
} }
// Component { Component {
// id: loading id: loading
// BusyIndicator { BusyIndicator {
// size: BusyIndicatorSize.Large size: BusyIndicatorSize.Large
// anchors.centerIn: parent anchors.centerIn: parent
// running: true running: true
// } }
// } }
Component { Component {
id: tagListComponent id: tagListComponent

View file

@ -20,8 +20,6 @@ Dialog {
width: parent.width width: parent.width
height: parent.height height: parent.height
VerticalScrollDecorator { flickable: gridView}
SilicaGridView { SilicaGridView {
id: gridView id: gridView
header: PageHeader { header: PageHeader {
@ -266,6 +264,7 @@ Dialog {
emojiDialog.accept() emojiDialog.accept()
} }
} }
VerticalScrollDecorator { flickable: gridView }
} }
} }
} }

View file

@ -42,15 +42,32 @@ SilicaListView {
} }
BusyLabel { BusyLabel {
id: loadStatusList id: myListBusyLabel
running: model.count === 0 running: model.count === 0
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter 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 { PullDownMenu {
id: mainPulleyMenu
MenuItem { MenuItem {
text: qsTr("Settings") text: qsTr("Settings")
visible: !profilePage visible: !profilePage
@ -119,7 +136,7 @@ SilicaListView {
BusyIndicator { BusyIndicator {
running: loadStarted running: loadStarted
visible: loadStatusList.running ? false : true visible: myListBusyLabel.running ? false : true
size: BusyIndicatorSize.Small size: BusyIndicatorSize.Small
anchors { anchors {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter