From 8a9cb736866b5174b80a2b5e8ca28d395644deac Mon Sep 17 00:00:00 2001 From: Henk Kalkwater Date: Wed, 8 Sep 2021 21:57:23 +0200 Subject: [PATCH] SailfishOS: Small user interface improvements * Pressing shuffle will now show a notification indicating it is not implemented. * On the initial setup, the discovered settings are displayed somewhat more neatly. * Disable reloading the main view each time the MainPage gets activated. --- sailfish/qml/components/PlaybackBar.qml | 2 +- sailfish/qml/pages/MainPage.qml | 1 - sailfish/qml/pages/setup/AddServerPage.qml | 46 ++++++++++++++++------ 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/sailfish/qml/components/PlaybackBar.qml b/sailfish/qml/components/PlaybackBar.qml index 03a70aa..60d63ad 100644 --- a/sailfish/qml/components/PlaybackBar.qml +++ b/sailfish/qml/components/PlaybackBar.qml @@ -158,8 +158,8 @@ PanelBackground { verticalCenter: playButton.verticalCenter } icon.source: "image://theme/icon-m-shuffle" - enabled: false opacity: 0 + onClicked: Notices.show(qsTr("Shuffle not yet implemented")) } IconButton { diff --git a/sailfish/qml/pages/MainPage.qml b/sailfish/qml/pages/MainPage.qml index d1eaaff..333a74a 100644 --- a/sailfish/qml/pages/MainPage.qml +++ b/sailfish/qml/pages/MainPage.qml @@ -167,7 +167,6 @@ Page { onStatusChanged: { if (status == PageStatus.Active) { appWindow.itemData = null - loadModels(false) } } diff --git a/sailfish/qml/pages/setup/AddServerPage.qml b/sailfish/qml/pages/setup/AddServerPage.qml index 415bb60..4690125 100644 --- a/sailfish/qml/pages/setup/AddServerPage.qml +++ b/sailfish/qml/pages/setup/AddServerPage.qml @@ -62,20 +62,40 @@ Dialog { description: qsTr("Sailfin will try to search for Jellyfin servers on your local network automatically") menu: ContextMenu { - MenuItem { - // Special values are cool, aren't they? - readonly property string _address: manualAddress.text - readonly property string _name: manualAddress.text - text: qsTr("enter address manually") - } - Repeater { - model: serverModel - delegate: MenuItem { - readonly property string _address: address - readonly property string _name: name - text: qsTr("%1 - %2").arg(name).arg(address) + MenuItem { + // Special values are cool, aren't they? + readonly property string _address: manualAddress.text + readonly property string _name: manualAddress.text + text: qsTr("enter address manually") + } + Repeater { + model: serverModel + delegate: MenuItem { + readonly property string _address: address + readonly property string _name: name + // No, this isn't a clever hack that depends on how ComboBox is + // implemented. It really isn't, trust me! + readonly property string description: address + height: Theme.itemSizeSmall + Theme.paddingSmall * 2 + text: name + topPadding: -description.implicitHeight + + Label { + id: description + text: parent.description + anchors { + verticalCenter: parent.verticalCenter + verticalCenterOffset: parent.implicitHeight + Theme.paddingSmall + } + width: parent.width + horizontalAlignment: parent.horizontalAlignment + verticalAlignment: parent.verticalAlignment + font.pixelSize: Theme.fontSizeExtraSmall + truncationMode: parent.truncationMode + color: Theme.rgba(parent.color, Theme.opacityHigh) + } + } } - } } }