fix: fix weirdness

This commit is contained in:
ferreo 2025-07-18 16:57:11 +01:00
parent a498671ef1
commit d40709952b
7 changed files with 318 additions and 246 deletions

View file

@ -1,4 +1,4 @@
import QtQuick
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import qs.Settings
@ -6,11 +6,10 @@ import qs.Settings
Rectangle {
id: wallpaperSettingsCard
Layout.fillWidth: true
Layout.preferredHeight: 680
Layout.preferredHeight: 720
color: Theme.surface
radius: 18
ColumnLayout {
anchors.fill: parent
anchors.margins: 18
@ -27,7 +26,7 @@ Rectangle {
color: Theme.accentPrimary
}
Text {
text: "Wallpaper Folder"
text: "Wallpaper Settings"
font.family: Theme.fontFamily
font.pixelSize: 16
font.bold: true
@ -36,39 +35,52 @@ Rectangle {
}
}
// Folder Path Input
Rectangle {
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Layout.preferredHeight: 40
radius: 8
color: Theme.surfaceVariant
border.color: folderInput.activeFocus ? Theme.accentPrimary : Theme.outline
border.width: 1
TextInput {
id: folderInput
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: 12
anchors.rightMargin: 12
anchors.topMargin: 6
anchors.bottomMargin: 6
text: Settings.settings.wallpaperFolder
Text {
text: "Wallpaper Path"
font.family: Theme.fontFamily
font.pixelSize: 13
font.bold: true
color: Theme.textPrimary
verticalAlignment: TextInput.AlignVCenter
clip: true
selectByMouse: true
activeFocusOnTab: true
inputMethodHints: Qt.ImhUrlCharactersOnly
onTextChanged: {
Settings.settings.wallpaperFolder = text
}
MouseArea {
anchors.fill: parent
onClicked: folderInput.forceActiveFocus()
}
// Folder Path Input
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 40
radius: 8
color: Theme.surfaceVariant
border.color: folderInput.activeFocus ? Theme.accentPrimary : Theme.outline
border.width: 1
TextInput {
id: folderInput
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: 12
anchors.rightMargin: 12
anchors.topMargin: 6
anchors.bottomMargin: 6
text: Settings.settings.wallpaperFolder
font.family: Theme.fontFamily
font.pixelSize: 13
color: Theme.textPrimary
verticalAlignment: TextInput.AlignVCenter
clip: true
selectByMouse: true
activeFocusOnTab: true
inputMethodHints: Qt.ImhUrlCharactersOnly
onTextChanged: {
Settings.settings.wallpaperFolder = text;
}
MouseArea {
anchors.fill: parent
onClicked: folderInput.forceActiveFocus()
}
}
}
}
@ -99,7 +111,7 @@ Rectangle {
color: Settings.settings.useSWWW ? Theme.accentPrimary : Theme.surfaceVariant
border.color: Settings.settings.useSWWW ? Theme.accentPrimary : Theme.outline
border.width: 2
Rectangle {
id: swwwThumb
width: 28
@ -110,16 +122,19 @@ Rectangle {
border.width: 1
y: 2
x: Settings.settings.useSWWW ? swwwSwitch.width - width - 2 : 2
Behavior on x {
NumberAnimation { duration: 200; easing.type: Easing.OutCubic }
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
}
MouseArea {
anchors.fill: parent
onClicked: {
Settings.settings.useSWWW = !Settings.settings.useSWWW
Settings.settings.useSWWW = !Settings.settings.useSWWW;
}
}
}
@ -151,7 +166,7 @@ Rectangle {
color: Settings.settings.randomWallpaper ? Theme.accentPrimary : Theme.surfaceVariant
border.color: Settings.settings.randomWallpaper ? Theme.accentPrimary : Theme.outline
border.width: 2
Rectangle {
id: randomWallpaperThumb
width: 28
@ -162,16 +177,19 @@ Rectangle {
border.width: 1
y: 2
x: Settings.settings.randomWallpaper ? randomWallpaperSwitch.width - width - 2 : 2
Behavior on x {
NumberAnimation { duration: 200; easing.type: Easing.OutCubic }
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
}
MouseArea {
anchors.fill: parent
onClicked: {
Settings.settings.randomWallpaper = !Settings.settings.randomWallpaper
Settings.settings.randomWallpaper = !Settings.settings.randomWallpaper;
}
}
}
@ -203,7 +221,7 @@ Rectangle {
color: Settings.settings.useWallpaperTheme ? Theme.accentPrimary : Theme.surfaceVariant
border.color: Settings.settings.useWallpaperTheme ? Theme.accentPrimary : Theme.outline
border.width: 2
Rectangle {
id: wallpaperThemeThumb
width: 28
@ -214,16 +232,19 @@ Rectangle {
border.width: 1
y: 2
x: Settings.settings.useWallpaperTheme ? wallpaperThemeSwitch.width - width - 2 : 2
Behavior on x {
NumberAnimation { duration: 200; easing.type: Easing.OutCubic }
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
}
MouseArea {
anchors.fill: parent
onClicked: {
Settings.settings.useWallpaperTheme = !Settings.settings.useWallpaperTheme
Settings.settings.useWallpaperTheme = !Settings.settings.useWallpaperTheme;
}
}
}
@ -243,18 +264,18 @@ Rectangle {
font.bold: true
color: Theme.textPrimary
}
Item {
Layout.fillWidth: true
}
Text {
text: Settings.settings.wallpaperInterval
font.pixelSize: 13
color: Theme.textPrimary
}
}
Slider {
id: intervalSlider
Layout.fillWidth: true
@ -263,7 +284,7 @@ Rectangle {
stepSize: 10
value: Settings.settings.wallpaperInterval
snapMode: Slider.SnapAlways
background: Rectangle {
x: intervalSlider.leftPadding
y: intervalSlider.topPadding + intervalSlider.availableHeight / 2 - height / 2
@ -273,7 +294,7 @@ Rectangle {
height: implicitHeight
radius: 2
color: Theme.surfaceVariant
Rectangle {
width: intervalSlider.visualPosition * parent.width
height: parent.height
@ -281,7 +302,7 @@ Rectangle {
radius: 2
}
}
handle: Rectangle {
x: intervalSlider.leftPadding + intervalSlider.visualPosition * (intervalSlider.availableWidth - width)
y: intervalSlider.topPadding + intervalSlider.availableHeight / 2 - height / 2
@ -294,11 +315,11 @@ Rectangle {
}
onMoved: {
Settings.settings.wallpaperInterval = Math.round(value)
Settings.settings.wallpaperInterval = Math.round(value);
}
}
}
// Resize Mode Setting
ColumnLayout {
spacing: 12
@ -311,14 +332,14 @@ Rectangle {
font.bold: true
color: Theme.textPrimary
}
ComboBox {
id: resizeComboBox
Layout.fillWidth: true
Layout.preferredHeight: 40
model: ["no", "crop", "fit", "stretch"]
currentIndex: model.indexOf(Settings.settings.wallpaperResize)
background: Rectangle {
implicitWidth: 120
implicitHeight: 40
@ -327,7 +348,7 @@ Rectangle {
border.width: 1
radius: 8
}
contentItem: Text {
leftPadding: 12
rightPadding: resizeComboBox.indicator.width + resizeComboBox.spacing
@ -338,7 +359,7 @@ Rectangle {
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
indicator: Text {
x: resizeComboBox.width - width - 12
y: resizeComboBox.topPadding + (resizeComboBox.availableHeight - height) / 2
@ -347,22 +368,22 @@ Rectangle {
font.pixelSize: 24
color: Theme.textPrimary
}
popup: Popup {
y: resizeComboBox.height
width: resizeComboBox.width
implicitHeight: contentItem.implicitHeight
padding: 1
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: resizeComboBox.popup.visible ? resizeComboBox.delegateModel : null
currentIndex: resizeComboBox.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
ScrollIndicator.vertical: ScrollIndicator {}
}
background: Rectangle {
color: Theme.surfaceVariant
border.color: Theme.outline
@ -370,7 +391,7 @@ Rectangle {
radius: 8
}
}
delegate: ItemDelegate {
width: resizeComboBox.width
contentItem: Text {
@ -382,18 +403,18 @@ Rectangle {
elide: Text.ElideRight
}
highlighted: resizeComboBox.highlightedIndex === index
background: Rectangle {
color: highlighted ? Theme.accentPrimary.toString().replace(/#/, "#1A") : "transparent"
}
}
onActivated: {
Settings.settings.wallpaperResize = model[index]
Settings.settings.wallpaperResize = model[index];
}
}
}
// Transition Type Setting
ColumnLayout {
spacing: 12
@ -406,14 +427,14 @@ Rectangle {
font.bold: true
color: Theme.textPrimary
}
ComboBox {
id: transitionTypeComboBox
Layout.fillWidth: true
Layout.preferredHeight: 40
model: ["none", "simple", "fade", "left", "right", "top", "bottom", "wipe", "wave", "grow", "center", "any", "outer", "random"]
currentIndex: model.indexOf(Settings.settings.transitionType)
background: Rectangle {
implicitWidth: 120
implicitHeight: 40
@ -422,7 +443,7 @@ Rectangle {
border.width: 1
radius: 8
}
contentItem: Text {
leftPadding: 12
rightPadding: transitionTypeComboBox.indicator.width + transitionTypeComboBox.spacing
@ -433,7 +454,7 @@ Rectangle {
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
indicator: Text {
x: transitionTypeComboBox.width - width - 12
y: transitionTypeComboBox.topPadding + (transitionTypeComboBox.availableHeight - height) / 2
@ -442,22 +463,22 @@ Rectangle {
font.pixelSize: 24
color: Theme.textPrimary
}
popup: Popup {
y: transitionTypeComboBox.height
width: transitionTypeComboBox.width
implicitHeight: contentItem.implicitHeight
padding: 1
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: transitionTypeComboBox.popup.visible ? transitionTypeComboBox.delegateModel : null
currentIndex: transitionTypeComboBox.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
ScrollIndicator.vertical: ScrollIndicator {}
}
background: Rectangle {
color: Theme.surfaceVariant
border.color: Theme.outline
@ -465,7 +486,7 @@ Rectangle {
radius: 8
}
}
delegate: ItemDelegate {
width: transitionTypeComboBox.width
contentItem: Text {
@ -477,18 +498,18 @@ Rectangle {
elide: Text.ElideRight
}
highlighted: transitionTypeComboBox.highlightedIndex === index
background: Rectangle {
color: highlighted ? Theme.accentPrimary.toString().replace(/#/, "#1A") : "transparent"
}
}
onActivated: {
Settings.settings.transitionType = model[index]
Settings.settings.transitionType = model[index];
}
}
}
// Transition FPS Setting
ColumnLayout {
spacing: 12
@ -503,18 +524,18 @@ Rectangle {
font.bold: true
color: Theme.textPrimary
}
Item {
Layout.fillWidth: true
}
Text {
text: Settings.settings.transitionFps
font.pixelSize: 13
color: Theme.textPrimary
}
}
Slider {
id: fpsSlider
Layout.fillWidth: true
@ -523,7 +544,7 @@ Rectangle {
stepSize: 5
value: Settings.settings.transitionFps
snapMode: Slider.SnapAlways
background: Rectangle {
x: fpsSlider.leftPadding
y: fpsSlider.topPadding + fpsSlider.availableHeight / 2 - height / 2
@ -533,7 +554,7 @@ Rectangle {
height: implicitHeight
radius: 2
color: Theme.surfaceVariant
Rectangle {
width: fpsSlider.visualPosition * parent.width
height: parent.height
@ -541,7 +562,7 @@ Rectangle {
radius: 2
}
}
handle: Rectangle {
x: fpsSlider.leftPadding + fpsSlider.visualPosition * (fpsSlider.availableWidth - width)
y: fpsSlider.topPadding + fpsSlider.availableHeight / 2 - height / 2
@ -554,11 +575,11 @@ Rectangle {
}
onMoved: {
Settings.settings.transitionFps = Math.round(value)
Settings.settings.transitionFps = Math.round(value);
}
}
}
// Transition Duration Setting
ColumnLayout {
spacing: 12
@ -573,18 +594,18 @@ Rectangle {
font.bold: true
color: Theme.textPrimary
}
Item {
Layout.fillWidth: true
}
Text {
text: Settings.settings.transitionDuration.toFixed(3)
font.pixelSize: 13
color: Theme.textPrimary
}
}
Slider {
id: durationSlider
Layout.fillWidth: true
@ -593,7 +614,7 @@ Rectangle {
stepSize: 0.050
value: Settings.settings.transitionDuration
snapMode: Slider.SnapAlways
background: Rectangle {
x: durationSlider.leftPadding
y: durationSlider.topPadding + durationSlider.availableHeight / 2 - height / 2
@ -603,7 +624,7 @@ Rectangle {
height: implicitHeight
radius: 2
color: Theme.surfaceVariant
Rectangle {
width: durationSlider.visualPosition * parent.width
height: parent.height
@ -611,7 +632,7 @@ Rectangle {
radius: 2
}
}
handle: Rectangle {
x: durationSlider.leftPadding + durationSlider.visualPosition * (durationSlider.availableWidth - width)
y: durationSlider.topPadding + durationSlider.availableHeight / 2 - height / 2
@ -624,9 +645,9 @@ Rectangle {
}
onMoved: {
Settings.settings.transitionDuration = value
Settings.settings.transitionDuration = value;
}
}
}
}
}
}