Files
dms-gamebar/GameBarSettings.qml
T
2026-09-21 21:50:32 +02:00

123 lines
3.4 KiB
QML

import QtQuick
import qs.Common
import qs.Modules.Plugins
import qs.Widgets
PluginSettings {
id: settings
pluginId: "gameBar"
Rectangle {
width: parent.width
height: hintColumn.implicitHeight + Theme.spacingM * 2
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Theme.outlineMedium
border.width: Theme.layerOutlineWidth
Column {
id: hintColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: Theme.spacingM
spacing: Theme.spacingXS
StyledText {
text: "Keybind setup"
font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium
color: Theme.surfaceText
}
StyledText {
width: parent.width
text: "Commands: dms ipc call gameBar toggle / open / close / widget <audio|apps|media|home|system> / resetLayout"
font.pixelSize: Theme.fontSizeSmall
font.family: Theme.monoFontFamily
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
}
}
}
SliderSetting {
settingKey: "backdropOpacity"
label: "Background dimming"
description: "How much the desktop behind the overlay is darkened"
defaultValue: 70
minimum: 0
maximum: 95
unit: "%"
leftIcon: "light_mode"
rightIcon: "dark_mode"
}
StringSetting {
settingKey: "haUrl"
label: "Home Assistant URL"
description: "e.g. http://homeassistant.local:8123"
placeholder: "http://homeassistant.local:8123"
}
StringSetting {
settingKey: "haToken"
label: "Long-lived access token"
description: "Home Assistant profile page, bottom of Security tab"
placeholder: "eyJhbGciOi..."
}
SliderSetting {
settingKey: "haPollInterval"
label: "Home Assistant refresh interval"
description: "How often entity states are polled while the Home widget is open"
defaultValue: 5
minimum: 2
maximum: 30
unit: "s"
leftIcon: "speed"
rightIcon: "schedule"
}
GameBarHomeSettings {
width: parent.width
settings: settings
}
Item {
width: parent.width
height: resetColumn.implicitHeight
Column {
id: resetColumn
anchors.left: parent.left
anchors.right: parent.right
spacing: Theme.spacingXS
StyledText {
text: "Widget layout"
font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium
color: Theme.surfaceText
}
StyledText {
width: parent.width
text: "Widget positions are saved per monitor. Reset them to the default arrangement."
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
}
DankButton {
text: "Reset widget positions"
iconName: "restart_alt"
onClicked: settings.saveValue("layout", {})
}
}
}
}