diff --git a/qml.qrc b/qml.qrc
index 8c93240..3b115e1 100755
--- a/qml.qrc
+++ b/qml.qrc
@@ -142,6 +142,8 @@
resources/settings/selected.svg
resources/settings/GitHub.svg
+ resources/settings/ok.svg
+ resources/settings/question.svg
resources/covers/favorite.svg
diff --git a/qml/DownloadPanel.qml b/qml/DownloadPanel.qml
index 26590f3..dc322f5 100644
--- a/qml/DownloadPanel.qml
+++ b/qml/DownloadPanel.qml
@@ -68,10 +68,8 @@ FloatingPanel {
Icon {
id: _icon
anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 10
- width: 20
- height: 20
+ anchors.horizontalCenter: parent.left
+ anchors.horizontalCenterOffset: 18
color: _mouse.containsMouse? Style.panel.text.sellectedColor : Style.panel.text.unsellectedColor
src: icon
@@ -80,8 +78,9 @@ FloatingPanel {
DText {
anchors.verticalCenter: parent.verticalCenter
anchors.left: _icon.right
- anchors.leftMargin: 10
+ anchors.leftMargin: 13
+ font.pointSize: 10
color: _mouse.containsMouse? Style.panel.text.sellectedColor : Style.panel.text.unsellectedColor
text: title
}
@@ -89,8 +88,9 @@ FloatingPanel {
DText {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
- anchors.rightMargin: 10
+ anchors.rightMargin: 13
+ font.pointSize: 10
color: Style.panel.text.darkColor
text: shortcut
}
diff --git a/qml/StyleSingleton.qml b/qml/StyleSingleton.qml
index 7744301..bc3a2be 100755
--- a/qml/StyleSingleton.qml
+++ b/qml/StyleSingleton.qml
@@ -44,6 +44,8 @@ QtObject {
property QtObject normal: QtObject {
property color color: darkTheme? "#C1C1C1" : c40
property color hoverColor: darkTheme? white : "#808080"
+ property color pressedColor: darkTheme? Qt.darker(color, 1.25) : Qt.lighter(color, 1.25)
+ property color unavailableColor: darkTheme? "#808080" : "#C1C1C1"
}
property QtObject accent: QtObject {
property color color: window.accent
diff --git a/qml/components/DTextBox.qml b/qml/components/DTextBox.qml
index 543bca4..8b8664b 100755
--- a/qml/components/DTextBox.qml
+++ b/qml/components/DTextBox.qml
@@ -17,6 +17,8 @@ Rectangle {
property bool clearButton: false
+ property real textRightPadding: 0
+
property QtObject style: Style.panel.textBox
MouseArea {
@@ -31,7 +33,7 @@ Rectangle {
TextInput {
id: _input
anchors.fill: parent
- anchors.rightMargin: (clearButton && contentWidth > parent.width - _clear.width * 2)? _clear.width : 0
+ anchors.rightMargin: ((clearButton && contentWidth > parent.width - _clear.width * 2)? _clear.width : 0) + root.textRightPadding
verticalAlignment: Text.AlignVCenter
horizontalAlignment: root.style.text.hAlign
clip: true
@@ -47,6 +49,7 @@ Rectangle {
anchors.fill: _input
verticalAlignment: Text.AlignVCenter
horizontalAlignment: root.style.text.hAlign
+ anchors.rightMargin: root.textRightPadding
visible: _input.text == ""
@@ -59,6 +62,7 @@ Rectangle {
MouseArea {
id: _clear
anchors.right: parent.right
+ anchors.rightMargin: root.textRightPadding
visible: clearButton && root.text !== ""
height: parent.height
width: height
diff --git a/qml/components/FloatingPanel.qml b/qml/components/FloatingPanel.qml
index 4fc29c5..4ec9a14 100755
--- a/qml/components/FloatingPanel.qml
+++ b/qml/components/FloatingPanel.qml
@@ -8,8 +8,10 @@ Item {
property color color: Style.panel.background
property var triangleCenter: root.horizontalCenter
property var triangleTop: root.bottom
+ property var triangleBottom: root.top
property real triangleOffset: 0
property real triangleRotation: 0
+ property bool triangleOnTop: false
opacity: 0
@@ -32,9 +34,10 @@ Item {
Triangle {
id: _triangle
anchors.horizontalCenter: root.triangleCenter
- anchors.top: root.triangleTop
+ anchors.top: triangleOnTop? undefined : root.triangleTop
+ anchors.bottom: triangleOnTop? root.triangleBottom : undefined
anchors.horizontalCenterOffset: root.triangleOffset
- rotation: root.triangleRotation
+ rotation: root.triangleRotation + (triangleOnTop? 180 : 0)
color: root.color
}
diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml
index ac12f0d..73864bb 100644
--- a/qml/pages/SettingsPage.qml
+++ b/qml/pages/SettingsPage.qml
@@ -61,7 +61,7 @@ DPage {
Layout.maximumWidth: 250
spacing: 20
- AccountsSettingsBlock {}
+ AccountsSettingsBlock { rootComponent: _scroll }
ColorSettingsBlock {}
}
@@ -117,7 +117,7 @@ DPage {
Layout.preferredWidth: 215
spacing: 20
- AccountsSettingsBlock {}
+ AccountsSettingsBlock { rootComponent: _scroll }
ColorSettingsBlock {}
}
}
diff --git a/qml/pages/settings/AccountsSettingsBlock.qml b/qml/pages/settings/AccountsSettingsBlock.qml
index 98f9ca3..6a6397d 100644
--- a/qml/pages/settings/AccountsSettingsBlock.qml
+++ b/qml/pages/settings/AccountsSettingsBlock.qml
@@ -6,9 +6,12 @@ import ".."
import "../../components"
SettingsBlock {
+ id: root
title: qsTr("Accounts")
Layout.fillWidth: true
+ property var rootComponent
+
ColumnLayout {
spacing: 10
Layout.maximumWidth: 250
@@ -57,6 +60,7 @@ SettingsBlock {
id: _YandexMusic_login
Item {
+ id: _YandexMusic_login_root
width: _text1.width + _text2.width
height: Math.max(_text1.height, _text2.height)
@@ -98,16 +102,51 @@ SettingsBlock {
FloatingPanel {
id: _ymLoginPanel
- width: 220
+ width: 250
height: 30
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.bottom
- anchors.topMargin: 10 - _ppc.shift
+ parent: root.rootComponent
+ x: _YandexMusic_login_root.mapToItem(root.rootComponent, _YandexMusic_login_root.width / 2 - width / 2, 0).x
+ y: _YandexMusic_login_root.mapToItem(root.rootComponent, 0, _YandexMusic_login_root.height).y + 10 - _ppc.shift
+ triangleOnTop: true
Item {
anchors.fill: parent
-
+ DTextBox {
+ id: _token
+ anchors.fill: parent
+ anchors.margins: 5
+ anchors.rightMargin: 30
+ textRightPadding: 20
+
+ hint: qsTr("Token")
+
+ IconButton {
+ width: 20
+ height: 20
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+
+ style: Style.window.icon.normal
+ src: "qrc:resources/settings/question.svg"
+ onClicked: Qt.openUrlExternally("https://github.com/MarshalX/yandex-music-api/discussions/513")
+ }
+ }
+
+ IconButton {
+ width: 20
+ height: 20
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: _token.right
+ anchors.leftMargin: 5
+
+ style: Style.window.icon.normal
+ src: "qrc:resources/settings/ok.svg"
+ onClicked: {
+ Config.ym_token = _token.text
+ _ppc.opened = false
+ }
+ }
}
}
}
diff --git a/resources/player/delete.svg b/resources/player/delete.svg
index 3fe34fa..6c7bbf4 100644
--- a/resources/player/delete.svg
+++ b/resources/player/delete.svg
@@ -1,53 +1,3 @@
-
-