Settings: cleanup Misc
This commit is contained in:
parent
8b7d5d8b6a
commit
03043b283f
1 changed files with 34 additions and 33 deletions
|
|
@ -1,43 +1,39 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Settings
|
|
||||||
import qs.Components
|
import qs.Components
|
||||||
|
import qs.Settings
|
||||||
|
|
||||||
ScrollView {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
spacing: 0
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
padding: 0
|
anchors.margins: 0
|
||||||
rightPadding: 12
|
|
||||||
clip: true
|
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
||||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: root
|
|
||||||
width: parent.availableWidth
|
|
||||||
spacing: 0
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.margins: 0
|
|
||||||
|
|
||||||
Item {
|
ScrollView {
|
||||||
Layout.fillWidth: true
|
id: scrollView
|
||||||
Layout.preferredHeight: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
padding: 16
|
||||||
|
rightPadding: 12
|
||||||
|
clip: true
|
||||||
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
|
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 4
|
width: scrollView.availableWidth
|
||||||
Layout.fillWidth: true
|
spacing: 0
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "Media"
|
text: "Media"
|
||||||
font.pixelSize: 18 * Theme.uiScale
|
font.pixelSize: 18 * Theme.uiScale
|
||||||
font.bold: true
|
font.bold: true
|
||||||
color: Theme.textPrimary
|
color: Theme.textPrimary
|
||||||
Layout.bottomMargin: 8
|
Layout.bottomMargin: 16 * Theme.uiScale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -60,10 +56,14 @@ ScrollView {
|
||||||
|
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: visualizerTypeComboBox
|
id: visualizerTypeComboBox
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 40
|
Layout.preferredHeight: 40
|
||||||
model: ["radial", "fire", "diamond"]
|
model: ["radial", "fire", "diamond"]
|
||||||
currentIndex: model.indexOf(Settings.settings.visualizerType)
|
currentIndex: model.indexOf(Settings.settings.visualizerType)
|
||||||
|
onActivated: {
|
||||||
|
Settings.settings.visualizerType = model[index];
|
||||||
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: 120
|
implicitWidth: 120
|
||||||
|
|
@ -97,7 +97,7 @@ ScrollView {
|
||||||
y: visualizerTypeComboBox.height
|
y: visualizerTypeComboBox.height
|
||||||
width: visualizerTypeComboBox.width
|
width: visualizerTypeComboBox.width
|
||||||
implicitHeight: contentItem.implicitHeight
|
implicitHeight: contentItem.implicitHeight
|
||||||
padding: 1
|
padding: 8
|
||||||
|
|
||||||
contentItem: ListView {
|
contentItem: ListView {
|
||||||
clip: true
|
clip: true
|
||||||
|
|
@ -105,7 +105,9 @@ ScrollView {
|
||||||
model: visualizerTypeComboBox.popup.visible ? visualizerTypeComboBox.delegateModel : null
|
model: visualizerTypeComboBox.popup.visible ? visualizerTypeComboBox.delegateModel : null
|
||||||
currentIndex: visualizerTypeComboBox.highlightedIndex
|
currentIndex: visualizerTypeComboBox.highlightedIndex
|
||||||
|
|
||||||
ScrollIndicator.vertical: ScrollIndicator {}
|
ScrollIndicator.vertical: ScrollIndicator {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
@ -114,10 +116,13 @@ ScrollView {
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: 16
|
radius: 16
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
width: visualizerTypeComboBox.width
|
width: visualizerTypeComboBox.width
|
||||||
|
highlighted: visualizerTypeComboBox.highlightedIndex === index
|
||||||
|
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
text: modelData.charAt(0).toUpperCase() + modelData.slice(1)
|
text: modelData.charAt(0).toUpperCase() + modelData.slice(1)
|
||||||
font.pixelSize: 13
|
font.pixelSize: 13
|
||||||
|
|
@ -125,23 +130,19 @@ ScrollView {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
highlighted: visualizerTypeComboBox.highlightedIndex === index
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: highlighted ? Theme.accentPrimary.toString().replace(/#/, "#1A") : "transparent"
|
color: highlighted ? Theme.accentPrimary.toString().replace(/#/, "#1A") : "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivated: {
|
|
||||||
Settings.settings.visualizerType = model[index];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue