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 {
spacing: Nheko.paddingMedium
width: scroll.availableWidth
anchors.fill: parent
anchors.leftMargin: userSettingsDialog.collapsed ? 0 : (userSettingsDialog.width-userSettingsDialog.collapsePoint) * 0.4 + Nheko.paddingLarge
anchors.rightMargin: anchors.leftMargin
Repeater {
model: UserSettingsModel
Layout.fillWidth:true
delegate: GridLayout {
width: scroll.availableWidth
columns: collapsed? 1 : 2
rows: collapsed? 2: 1
required property var model
......@@ -78,7 +80,7 @@ Rectangle {
Layout.columnSpan: (model.type == UserSettingsModel.SectionTitle && !userSettingsDialog.collapsed) ? 2 : 1
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.fillWidth: model.type == UserSettingsModel.SectionTitle || model.type == UserSettingsModel.Options || model.type == UserSettingsModel.Number
Layout.rightMargin: model.type == UserSettingsModel.SectionTitle ? 0 : Nheko.paddingMedium
......@@ -95,9 +97,9 @@ Rectangle {
roleValue: UserSettingsModel.Options
ComboBox {
anchors.right: parent.right
width: Math.min(parent.width, implicitWidth)
model: r.model.values
currentIndex: r.model.value
width: Math.min(implicitWidth, scroll.availableWidth - Nheko.paddingMedium)
onCurrentIndexChanged: r.model.value = currentIndex
implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted
......@@ -109,7 +111,6 @@ Rectangle {
SpinBox {
anchors.right: parent.right
width: Math.min(parent.width, implicitWidth)
from: model.valueLowerBound
to: model.valueUpperBound
stepSize: model.valueStep
......@@ -130,7 +131,6 @@ Rectangle {
readonly property int decimals: 2
anchors.right: parent.right
width: Math.min(parent.width, implicitWidth)
from: model.valueLowerBound * div
to: model.valueUpperBound * 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