Settings: cleanup of TimeWeather and ScreenRecorder

This commit is contained in:
quadbyte 2025-08-07 11:37:13 -04:00
parent 19431fa6a2
commit a7e40e643b
4 changed files with 76 additions and 288 deletions

View file

@ -100,7 +100,7 @@ PanelWithOverlay {
Component { Component {
id: recordingSettings id: recordingSettings
Recording { ScreenRecorder {
} }
} }

View file

@ -1,8 +1,9 @@
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
Rectangle { Rectangle {
id: root id: root
@ -15,7 +16,6 @@ Rectangle {
property bool useFahrenheit: Settings.settings.useFahrenheit property bool useFahrenheit: Settings.settings.useFahrenheit
Rectangle { Rectangle {
id: slider id: slider
width: parent.width / 2 - 4 * Theme.uiScale width: parent.width / 2 - 4 * Theme.uiScale

View file

@ -16,7 +16,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
padding: 0 padding: 16
rightPadding: 12 rightPadding: 12
clip: true clip: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
@ -687,6 +687,7 @@ ColumnLayout {
spacing: 8 spacing: 8
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 8 Layout.topMargin: 8
Layout.bottomMargin: 16
Text { Text {
text: "Color Range" text: "Color Range"
@ -789,82 +790,14 @@ ColumnLayout {
} }
ColumnLayout { ToggleOption {
spacing: 8 label: "Show Cursor"
Layout.fillWidth: true description: "Record mouse cursor in the video"
Layout.topMargin: 8 value: Settings.settings.showCursor
onToggled: function() {
RowLayout {
spacing: 8
Layout.fillWidth: true
ColumnLayout {
spacing: 4
Layout.fillWidth: true
Text {
text: "Show Cursor"
font.pixelSize: 13 * Theme.uiScale
font.bold: true
color: Theme.textPrimary
}
Text {
text: "Record mouse cursor in the video"
font.pixelSize: 12 * Theme.uiScale
color: Theme.textSecondary
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
}
Rectangle {
id: cursorSwitch
width: 52
height: 32
radius: 16
color: Settings.settings.showCursor ? Theme.accentPrimary : Theme.surfaceVariant
border.color: Settings.settings.showCursor ? Theme.accentPrimary : Theme.outline
border.width: 2
Rectangle {
id: cursorThumb
width: 28
height: 28
radius: 14
color: Theme.surface
border.color: Theme.outline
border.width: 1
y: 2
x: Settings.settings.showCursor ? cursorSwitch.width - width - 2 : 2
Behavior on x {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.showCursor = !Settings.settings.showCursor; Settings.settings.showCursor = !Settings.settings.showCursor;
} }
} }
}
}
}
} }
Item { Item {

View file

@ -5,192 +5,54 @@ import qs.Components
import qs.Settings import qs.Settings
import qs.Widgets.SettingsWindow.Tabs.Components import qs.Widgets.SettingsWindow.Tabs.Components
ScrollView { ColumnLayout {
id: root
spacing: 0
anchors.fill: parent anchors.fill: parent
padding: 0 anchors.margins: 0
ScrollView {
id: scrollView
Layout.fillWidth: true
Layout.fillHeight: true
padding: 16
rightPadding: 12 rightPadding: 12
clip: true clip: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded ScrollBar.vertical.policy: ScrollBar.AsNeeded
ColumnLayout { ColumnLayout {
id: root width: scrollView.availableWidth
width: parent.availableWidth
spacing: 0 spacing: 0
anchors.top: parent.top
anchors.margins: 0
Item {
Layout.fillWidth: true
Layout.preferredHeight: 0
}
ColumnLayout {
spacing: 4
Layout.fillWidth: true
Text { Text {
text: "Time" text: "Time"
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 { ToggleOption {
spacing: 8 label: "Use 12 Hour Clock"
Layout.fillWidth: true description: "Display time in 12-hour format (e.g., 2:30 PM) instead of 24-hour format"
Layout.topMargin: 8 value: Settings.settings.use12HourClock
onToggled: function() {
RowLayout {
spacing: 8
Layout.fillWidth: true
ColumnLayout {
spacing: 4
Layout.fillWidth: true
Text {
text: "Use 12 Hour Clock"
font.pixelSize: 13 * Theme.uiScale
font.bold: true
color: Theme.textPrimary
}
Text {
text: "Display time in 12-hour format (e.g., 2:30 PM) instead of 24-hour format"
font.pixelSize: 12 * Theme.uiScale
color: Theme.textSecondary
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
}
Rectangle {
id: use12HourClockSwitch
width: 52
height: 32
radius: 16
color: Settings.settings.use12HourClock ? Theme.accentPrimary : Theme.surfaceVariant
border.color: Settings.settings.use12HourClock ? Theme.accentPrimary : Theme.outline
border.width: 2
Rectangle {
id: use12HourClockThumb
width: 28
height: 28
radius: 14
color: Theme.surface
border.color: Theme.outline
border.width: 1
y: 2
x: Settings.settings.use12HourClock ? use12HourClockSwitch.width - width - 2 : 2
Behavior on x {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.use12HourClock = !Settings.settings.use12HourClock; Settings.settings.use12HourClock = !Settings.settings.use12HourClock;
} }
} }
} ToggleOption {
label: "US Style Date"
} description: "Display dates in MM/DD/YYYY format instead of DD/MM/YYYY"
value: Settings.settings.reverseDayMonth
} onToggled: function() {
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Layout.topMargin: 8
RowLayout {
spacing: 8
Layout.fillWidth: true
ColumnLayout {
spacing: 4
Layout.fillWidth: true
Text {
text: "US Style Date"
font.pixelSize: 13 * Theme.uiScale
font.bold: true
color: Theme.textPrimary
}
Text {
text: "Display dates in MM/DD/YYYY format instead of DD/MM/YYYY"
font.pixelSize: 12 * Theme.uiScale
color: Theme.textSecondary
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
}
Rectangle {
id: reverseDayMonthSwitch
width: 52
height: 32
radius: 16
color: Settings.settings.reverseDayMonth ? Theme.accentPrimary : Theme.surfaceVariant
border.color: Settings.settings.reverseDayMonth ? Theme.accentPrimary : Theme.outline
border.width: 2
Rectangle {
id: reverseDayMonthThumb
width: 28
height: 28
radius: 14
color: Theme.surface
border.color: Theme.outline
border.width: 1
y: 2
x: Settings.settings.reverseDayMonth ? reverseDayMonthSwitch.width - width - 2 : 2
Behavior on x {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.reverseDayMonth = !Settings.settings.reverseDayMonth; Settings.settings.reverseDayMonth = !Settings.settings.reverseDayMonth;
} }
} }
}
}
}
}
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 26 Layout.topMargin: 26
@ -200,21 +62,18 @@ ScrollView {
opacity: 0.3 opacity: 0.3
} }
ColumnLayout {
spacing: 4
Layout.fillWidth: true
Text { Text {
text: "Weather" text: "Weather"
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
Layout.bottomMargin: 8 * Theme.uiScale
Text { Text {
text: "City" text: "City"
@ -273,8 +132,6 @@ ScrollView {
} }
}
ColumnLayout { ColumnLayout {
spacing: 8 spacing: 8
Layout.fillWidth: true Layout.fillWidth: true
@ -314,8 +171,6 @@ ScrollView {
} }
Item {
Layout.fillWidth: true
Layout.fillHeight: true
} }
} }