From 93b73b86bbe6abcda93d135a5bedb29f40d1b2b7 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 21 Aug 2020 10:09:58 -0400 Subject: [PATCH] Add a "table header" to server browser --- TODO.md | 2 +- src/gui/Pages/AddAccount/ServerBrowser.qml | 44 +++++++++++++++++---- src/gui/Pages/AddAccount/ServerDelegate.qml | 1 - 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/TODO.md b/TODO.md index d6982d79..65ec519b 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,6 @@ # TODO -- keep scrollbars auto behavior? +- update nio requirement - improve auto completion delegate - refresh server list button diff --git a/src/gui/Pages/AddAccount/ServerBrowser.qml b/src/gui/Pages/AddAccount/ServerBrowser.qml index 7df85278..7f7097c4 100644 --- a/src/gui/Pages/AddAccount/ServerBrowser.qml +++ b/src/gui/Pages/AddAccount/ServerBrowser.qml @@ -89,13 +89,43 @@ HBox { implicitWidth: theme.controls.box.defaultWidth * 1.25 contentHeight: window.height - header: HLabel { - text: qsTr( - "Choose a homeserver to create an account on, or the " + - "homeserver where you have an account to sign in to:" - ) - wrapMode: HLabel.Wrap - padding: theme.spacing + header: HColumnLayout { + HLabel { + text: qsTr( + "Choose a homeserver to create an account on, or the " + + "homeserver where you have an account to sign in to:" + ) + wrapMode: HLabel.Wrap + padding: theme.spacing + + Layout.fillWidth: true + } + + HRowLayout { + Repeater { + model: [ + qsTr("Ping"), + qsTr("Name & location"), + qsTr("Stability"), + qsTr("Site"), + ] + + HLabel { + text: modelData + elide: HLabel.ElideRight + topPadding: theme.spacing / 2 + bottomPadding: topPadding + leftPadding: theme.spacing / (model.index === 0 ? 2 : 3) + rightPadding: theme.spacing / (model.index === 3 ? 1.5 : 3) + + background: Rectangle { + color: theme.controls.button.background + } + + Layout.fillWidth: model.index === 1 + } + } + } } footer: HLabeledItem { diff --git a/src/gui/Pages/AddAccount/ServerDelegate.qml b/src/gui/Pages/AddAccount/ServerDelegate.qml index 07257695..6676e100 100644 --- a/src/gui/Pages/AddAccount/ServerDelegate.qml +++ b/src/gui/Pages/AddAccount/ServerDelegate.qml @@ -73,7 +73,6 @@ HTile { HButton { icon.name: "server-visit-website" - toolTip.text: qsTr("Visit website") backgroundColor: "transparent" onClicked: Qt.openUrlExternally(model.site_url)