287 lines
9.2 KiB
QML
Raw Normal View History

2026-01-26 14:28:35 +01:00
import QtQuick
import qs
import qs.reusables
import QtQuick.Layouts
import qs.settings
import Quickshell.Widgets
import QtQuick.Dialogs
ClippingWrapperRectangle {
id: root
FontDialog {
id: fontPicker
title: "qs-fontpicker"
flags: FontDialog.NoButtons | FontDialog.MonospacedFonts
onAccepted: {
Settings.config.font = selectedFont.family;
Settings.config.fontSize = selectedFont.pointSize;
Settings.config.fontWeight = selectedFont.weight;
2026-01-26 14:28:35 +01:00
}
onSelectedFontChanged: {
Settings.config.font = selectedFont.family;
Settings.config.fontSize = selectedFont.pointSize;
Settings.config.fontWeight = selectedFont.weight;
2026-01-26 14:28:35 +01:00
}
}
anchors.centerIn: parent
clip: true
2026-02-13 01:41:29 +01:00
color: Colors.base01
2026-01-26 14:28:35 +01:00
radius: 12
margin: 20
ColumnLayout {
id: verticalLayout
2026-01-27 23:47:09 +01:00
anchors.margins: 20
anchors.fill: parent
ClippingWrapperRectangle {
2026-01-26 14:28:35 +01:00
id: fontWrapper
2026-01-28 17:52:15 +01:00
Layout.fillWidth: true
2026-01-27 23:47:09 +01:00
leftMargin: 10
2026-01-28 17:52:15 +01:00
rightMargin: 15
implicitWidth: parent.implicitWidth - 20
2026-01-27 23:47:09 +01:00
topLeftRadius: 12
topRightRadius: 12
bottomRightRadius: 4
bottomLeftRadius: 4
2026-02-13 01:41:29 +01:00
color: Colors.base01
implicitHeight: 30
2026-01-27 23:47:09 +01:00
child: RowLayout {
2026-01-26 14:28:35 +01:00
id: fontLayout
2026-01-27 23:47:09 +01:00
spacing: 40
2026-01-26 14:28:35 +01:00
CustomText {
id: fontText
2026-01-28 17:52:15 +01:00
text: "Current font"
2026-01-27 23:47:09 +01:00
Layout.fillWidth: true
}
CustomButton {
id: fontPickerButton
2026-01-28 17:52:15 +01:00
customText: Settings.config.font
2026-01-27 23:47:09 +01:00
implicitHeight: fontWrapper.implicitHeight - 10
onClicked: fontPicker.open()
2026-01-26 14:28:35 +01:00
}
}
}
2026-01-27 23:47:09 +01:00
ClippingWrapperRectangle {
id: floatingWrapper
2026-01-28 17:52:15 +01:00
Layout.fillWidth: true
2026-01-27 23:47:09 +01:00
leftMargin: 10
2026-01-28 17:52:15 +01:00
rightMargin: 20
implicitHeight: 30
2026-01-28 17:52:15 +01:00
bottomLeftRadius: 4
bottomRightRadius: 4
2026-01-27 23:47:09 +01:00
topRightRadius: 4
topLeftRadius: 4
2026-02-13 01:41:29 +01:00
color: Colors.base01
2026-01-27 23:47:09 +01:00
child: RowLayout {
id: floatingToggleLayout
2026-01-27 23:47:09 +01:00
spacing: 40
CustomText {
id: floatingToggleText
2026-01-28 17:52:15 +01:00
text: "Top bar floating"
Layout.fillWidth: true
}
CustomSwitch {
checked: Settings.config.floating
implicitHeight: floatingWrapper.implicitHeight - 10
implicitWidth: 34
onClicked: {
Settings.config.floating = checked;
}
}
}
}
ClippingWrapperRectangle {
id: screenCornerWrapper
Layout.fillWidth: true
leftMargin: 10
rightMargin: 20
implicitHeight: 30
bottomLeftRadius: 4
bottomRightRadius: 4
topRightRadius: 4
topLeftRadius: 4
2026-02-13 01:41:29 +01:00
color: Colors.base01
2026-01-28 17:52:15 +01:00
child: RowLayout {
id: screenCornerLayout
spacing: 40
CustomText {
id: screenCornerText
text: "Show screen corners"
2026-01-27 23:47:09 +01:00
Layout.fillWidth: true
}
CustomSwitch {
2026-01-28 17:52:15 +01:00
checked: Settings.config.showScreenCorners
2026-01-27 23:47:09 +01:00
implicitHeight: floatingWrapper.implicitHeight - 10
implicitWidth: 34
2026-01-28 17:52:15 +01:00
onClicked: {
Settings.config.showScreenCorners = checked;
}
}
}
}
ClippingWrapperRectangle {
id: screenCornerRadiusWrapper
Layout.fillWidth: true
leftMargin: 10
rightMargin: 15
implicitHeight: 30
bottomLeftRadius: 4
bottomRightRadius: 4
topRightRadius: 4
topLeftRadius: 4
2026-02-13 01:41:29 +01:00
color: Colors.base01
2026-01-28 17:52:15 +01:00
child: RowLayout {
id: screenCornerRadiusLayout
spacing: 5
CustomText {
id: screenCornerRadiusText
text: "Screen corner radius"
Layout.fillWidth: true
}
CustomButton {
implicitHeight: screenCornerRadiusWrapper.implicitHeight - 10
implicitWidth: 20
onClicked: {
Settings.config.screenCornerRadius = Settings.config.screenCornerRadius + 1;
}
customText: "+"
Layout.rightMargin: 0
}
CustomText {
text: Settings.config.screenCornerRadius
}
CustomButton {
implicitHeight: barHeightWrapper.implicitHeight - 10
implicitWidth: 20
onClicked: {
Settings.config.screenCornerRadius = Settings.config.screenCornerRadius - 1;
}
customText: "-"
Layout.rightMargin: 0
}
}
}
ClippingWrapperRectangle {
id: barHeightWrapper
Layout.fillWidth: true
leftMargin: 10
rightMargin: 15
implicitHeight: 30
bottomLeftRadius: 4
bottomRightRadius: 4
topRightRadius: 4
topLeftRadius: 4
2026-02-13 01:41:29 +01:00
color: Colors.base01
2026-01-28 17:52:15 +01:00
child: RowLayout {
id: barControlsLayout
spacing: 5
CustomText {
id: barControlsText
text: "Bar height"
Layout.fillWidth: true
}
CustomButton {
implicitHeight: barHeightWrapper.implicitHeight - 10
implicitWidth: 20
onClicked: {
Settings.config.barHeight = Settings.config.barHeight + 1;
}
customText: "+"
Layout.rightMargin: 0
}
CustomText {
text: Settings.config.barHeight
}
CustomButton {
implicitHeight: barHeightWrapper.implicitHeight - 10
implicitWidth: 20
onClicked: {
Settings.config.barHeight = Settings.config.barHeight - 1;
}
customText: "-"
Layout.rightMargin: 0
}
}
}
ClippingWrapperRectangle {
id: barMarginWrapper
Layout.fillWidth: true
leftMargin: 10
rightMargin: 15
implicitHeight: 30
bottomLeftRadius: 4
bottomRightRadius: 4
topRightRadius: 4
topLeftRadius: 4
2026-02-13 01:41:29 +01:00
color: Colors.base01
2026-01-28 17:52:15 +01:00
child: RowLayout {
id: barMarginLayout
spacing: 5
CustomText {
id: barMarginText
text: "Bar margins"
Layout.fillWidth: true
}
CustomButton {
implicitHeight: barMarginWrapper.implicitHeight - 10
implicitWidth: 20
onClicked: {
Settings.config.margins = Settings.config.margins + 1;
}
customText: "+"
}
CustomText {
text: Settings.config.margins
}
CustomButton {
implicitHeight: barHeightWrapper.implicitHeight - 10
implicitWidth: 20
onClicked: {
Settings.config.margins = Settings.config.margins - 1;
}
customText: "-"
}
}
}
ClippingWrapperRectangle {
id: translucencyWrapper
leftMargin: 10
rightMargin: 10
implicitHeight: 30
bottomLeftRadius: 12
bottomRightRadius: 12
topRightRadius: 4
topLeftRadius: 4
2026-02-13 01:41:29 +01:00
color: Colors.base01
2026-01-28 17:52:15 +01:00
Layout.fillWidth: true
RowLayout {
id: translucencyLayout
CustomText {
id: translucencyText
text: "Bar trasnlucency"
Layout.fillWidth: true
}
CustomSlider {
from: 0.0
to: 1.0
value: Settings.config.translucency
implicitWidth: 100
implicitHeight: translucencyWrapper.implicitHeight - 10
onMoved: {
Settings.config.translucency = position;
2026-01-26 14:28:35 +01:00
}
}
}
}
Item {
id: spring
Layout.fillHeight: true
}
}
}