Skip to content
Snippets Groups Projects
Verified Commit 805f0a30 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix toggle placement in user settings

parent 2eccec66
No related branches found
No related tags found
No related merge requests found
...@@ -33,15 +33,17 @@ Rectangle { ...@@ -33,15 +33,17 @@ Rectangle {
spacing: Nheko.paddingMedium spacing: Nheko.paddingMedium
width: scroll.availableWidth
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: userSettingsDialog.collapsed ? 0 : (userSettingsDialog.width-userSettingsDialog.collapsePoint) * 0.4 + Nheko.paddingLarge anchors.leftMargin: userSettingsDialog.collapsed ? 0 : (userSettingsDialog.width-userSettingsDialog.collapsePoint) * 0.4 + Nheko.paddingLarge
anchors.rightMargin: anchors.leftMargin anchors.rightMargin: anchors.leftMargin
Repeater { Repeater {
model: UserSettingsModel model: UserSettingsModel
Layout.fillWidth:true
delegate: GridLayout { delegate: GridLayout {
width: scroll.availableWidth
columns: collapsed? 1 : 2 columns: collapsed? 1 : 2
rows: collapsed? 2: 1 rows: collapsed? 2: 1
required property var model required property var model
...@@ -78,7 +80,7 @@ Rectangle { ...@@ -78,7 +80,7 @@ Rectangle {
Layout.columnSpan: (model.type == UserSettingsModel.SectionTitle && !userSettingsDialog.collapsed) ? 2 : 1 Layout.columnSpan: (model.type == UserSettingsModel.SectionTitle && !userSettingsDialog.collapsed) ? 2 : 1
Layout.preferredHeight: child.height Layout.preferredHeight: child.height
Layout.preferredWidth: Math.min(child.implicitWidth, child.width || 1000) Layout.preferredWidth: child.implicitWidth
Layout.maximumWidth: model.type == UserSettingsModel.SectionTitle ? Number.POSITIVE_INFINITY : 400 Layout.maximumWidth: model.type == UserSettingsModel.SectionTitle ? Number.POSITIVE_INFINITY : 400
Layout.fillWidth: model.type == UserSettingsModel.SectionTitle || model.type == UserSettingsModel.Options || model.type == UserSettingsModel.Number Layout.fillWidth: model.type == UserSettingsModel.SectionTitle || model.type == UserSettingsModel.Options || model.type == UserSettingsModel.Number
Layout.rightMargin: model.type == UserSettingsModel.SectionTitle ? 0 : Nheko.paddingMedium Layout.rightMargin: model.type == UserSettingsModel.SectionTitle ? 0 : Nheko.paddingMedium
...@@ -95,9 +97,9 @@ Rectangle { ...@@ -95,9 +97,9 @@ Rectangle {
roleValue: UserSettingsModel.Options roleValue: UserSettingsModel.Options
ComboBox { ComboBox {
anchors.right: parent.right anchors.right: parent.right
width: Math.min(parent.width, implicitWidth)
model: r.model.values model: r.model.values
currentIndex: r.model.value currentIndex: r.model.value
width: Math.min(implicitWidth, scroll.availableWidth - Nheko.paddingMedium)
onCurrentIndexChanged: r.model.value = currentIndex onCurrentIndexChanged: r.model.value = currentIndex
implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted
...@@ -109,7 +111,6 @@ Rectangle { ...@@ -109,7 +111,6 @@ Rectangle {
SpinBox { SpinBox {
anchors.right: parent.right anchors.right: parent.right
width: Math.min(parent.width, implicitWidth)
from: model.valueLowerBound from: model.valueLowerBound
to: model.valueUpperBound to: model.valueUpperBound
stepSize: model.valueStep stepSize: model.valueStep
...@@ -130,7 +131,6 @@ Rectangle { ...@@ -130,7 +131,6 @@ Rectangle {
readonly property int decimals: 2 readonly property int decimals: 2
anchors.right: parent.right anchors.right: parent.right
width: Math.min(parent.width, implicitWidth)
from: model.valueLowerBound * div from: model.valueLowerBound * div
to: model.valueUpperBound * div to: model.valueUpperBound * div
stepSize: model.valueStep * div stepSize: model.valueStep * div
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment