1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

settings: fix scrollable area in window

This commit is contained in:
bbedward
2025-11-24 11:56:10 -05:00
parent 7fa87125b5
commit b078e23aa1
17 changed files with 882 additions and 978 deletions

View File

@@ -10,12 +10,13 @@ Item {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
StyledRect { StyledRect {

View File

@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Effects
import qs.Common import qs.Common
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -81,7 +80,6 @@ Rectangle {
} }
} }
} }
} }
Rectangle { Rectangle {
@@ -105,11 +103,8 @@ Rectangle {
return PortalService.setProfileImage(""); return PortalService.setProfileImage("");
} }
} }
} }
} }
} }
MouseArea { MouseArea {
@@ -121,7 +116,6 @@ Rectangle {
propagateComposedEvents: true propagateComposedEvents: true
acceptedButtons: Qt.NoButton acceptedButtons: Qt.NoButton
} }
} }
Column { Column {
@@ -145,9 +139,6 @@ Rectangle {
elide: Text.ElideRight elide: Text.ElideRight
width: parent.width width: parent.width
} }
} }
} }
} }

View File

@@ -13,7 +13,7 @@ FocusScope {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: Theme.spacingS anchors.leftMargin: Theme.spacingS
anchors.rightMargin: 0 anchors.rightMargin: (parentModal && parentModal.isCompactMode) ? Theme.spacingS : (32 + Theme.spacingS)
anchors.bottomMargin: 0 anchors.bottomMargin: 0
anchors.topMargin: 0 anchors.topMargin: 0
color: "transparent" color: "transparent"
@@ -30,15 +30,13 @@ FocusScope {
PersonalizationTab { PersonalizationTab {
parentModal: root.parentModal parentModal: root.parentModal
} }
} }
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -49,15 +47,13 @@ FocusScope {
visible: active visible: active
focus: active focus: active
sourceComponent: TimeWeatherTab { sourceComponent: TimeWeatherTab {}
}
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -74,10 +70,9 @@ FocusScope {
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -88,15 +83,13 @@ FocusScope {
visible: active visible: active
focus: active focus: active
sourceComponent: WidgetTweaksTab { sourceComponent: WidgetTweaksTab {}
}
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -108,17 +101,14 @@ FocusScope {
focus: active focus: active
sourceComponent: Component { sourceComponent: Component {
DockTab { DockTab {}
}
} }
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -129,15 +119,13 @@ FocusScope {
visible: active visible: active
focus: active focus: active
sourceComponent: DisplaysTab { sourceComponent: DisplaysTab {}
}
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -148,15 +136,13 @@ FocusScope {
visible: active visible: active
focus: active focus: active
sourceComponent: LauncherTab { sourceComponent: LauncherTab {}
}
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -167,15 +153,13 @@ FocusScope {
visible: active visible: active
focus: active focus: active
sourceComponent: ThemeColorsTab { sourceComponent: ThemeColorsTab {}
}
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -186,15 +170,13 @@ FocusScope {
visible: active visible: active
focus: active focus: active
sourceComponent: PowerSettings { sourceComponent: PowerSettings {}
}
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -211,10 +193,9 @@ FocusScope {
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
Loader { Loader {
@@ -225,17 +206,13 @@ FocusScope {
visible: active visible: active
focus: active focus: active
sourceComponent: AboutTab { sourceComponent: AboutTab {}
}
onActiveChanged: { onActiveChanged: {
if (active && item) { if (active && item) {
Qt.callLater(() => item.forceActiveFocus()) Qt.callLater(() => item.forceActiveFocus());
} }
} }
} }
} }
} }

View File

@@ -234,9 +234,7 @@ FloatingWindow {
SettingsContent { SettingsContent {
id: content id: content
width: Math.min(550, parent.width - Theme.spacingL * 2) anchors.fill: parent
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
parentModal: settingsModal parentModal: settingsModal
currentIndex: settingsModal.currentTabIndex currentIndex: settingsModal.currentTabIndex
} }

View File

@@ -1,7 +1,5 @@
import QtQuick import QtQuick
import QtQuick.Controls
import QtQuick.Effects import QtQuick.Effects
import Quickshell.Widgets
import qs.Common import qs.Common
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -16,50 +14,70 @@ Item {
property bool isLabwc: CompositorService.isLabwc property bool isLabwc: CompositorService.isLabwc
property string compositorName: { property string compositorName: {
if (isHyprland) return "hyprland" if (isHyprland)
if (isSway) return "sway" return "hyprland";
if (isDwl) return "mangowc" if (isSway)
if (isLabwc) return "labwc" return "sway";
return "niri" if (isDwl)
return "mangowc";
if (isLabwc)
return "labwc";
return "niri";
} }
property string compositorLogo: { property string compositorLogo: {
if (isHyprland) return "/assets/hyprland.svg" if (isHyprland)
if (isSway) return "/assets/sway.svg" return "/assets/hyprland.svg";
if (isDwl) return "/assets/mango.png" if (isSway)
if (isLabwc) return "/assets/labwc.png" return "/assets/sway.svg";
return "/assets/niri.svg" if (isDwl)
return "/assets/mango.png";
if (isLabwc)
return "/assets/labwc.png";
return "/assets/niri.svg";
} }
property string compositorUrl: { property string compositorUrl: {
if (isHyprland) return "https://hypr.land" if (isHyprland)
if (isSway) return "https://swaywm.org" return "https://hypr.land";
if (isDwl) return "https://github.com/DreamMaoMao/mangowc" if (isSway)
if (isLabwc) return "https://labwc.github.io/" return "https://swaywm.org";
return "https://github.com/YaLTeR/niri" if (isDwl)
return "https://github.com/DreamMaoMao/mangowc";
if (isLabwc)
return "https://labwc.github.io/";
return "https://github.com/YaLTeR/niri";
} }
property string compositorTooltip: { property string compositorTooltip: {
if (isHyprland) return "Hyprland Website" if (isHyprland)
if (isSway) return "Sway Website" return "Hyprland Website";
if (isDwl) return "mangowc GitHub" if (isSway)
if (isLabwc) return "LabWC Website" return "Sway Website";
return "niri GitHub" if (isDwl)
return "mangowc GitHub";
if (isLabwc)
return "LabWC Website";
return "niri GitHub";
} }
property string dmsDiscordUrl: "https://discord.gg/ppWTpKmPgT" property string dmsDiscordUrl: "https://discord.gg/ppWTpKmPgT"
property string dmsDiscordTooltip: "niri/dms Discord" property string dmsDiscordTooltip: "niri/dms Discord"
property string compositorDiscordUrl: { property string compositorDiscordUrl: {
if (isHyprland) return "https://discord.com/invite/hQ9XvMUjjr" if (isHyprland)
if (isDwl) return "https://discord.gg/CPjbDxesh5" return "https://discord.com/invite/hQ9XvMUjjr";
return "" if (isDwl)
return "https://discord.gg/CPjbDxesh5";
return "";
} }
property string compositorDiscordTooltip: { property string compositorDiscordTooltip: {
if (isHyprland) return "Hyprland Discord Server" if (isHyprland)
if (isDwl) return "mangowc Discord Server" return "Hyprland Discord Server";
return "" if (isDwl)
return "mangowc Discord Server";
return "";
} }
property string redditUrl: "https://reddit.com/r/niri" property string redditUrl: "https://reddit.com/r/niri"
@@ -76,13 +94,14 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
// ASCII Art Header // ASCII Art Header
@@ -91,8 +110,7 @@ Item {
height: asciiSection.implicitHeight + Theme.spacingL * 2 height: asciiSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -157,20 +175,20 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: 24 height: 24
width: { width: {
let baseWidth = compositorButton.width + dmsDiscordButton.width + Theme.spacingM let baseWidth = compositorButton.width + dmsDiscordButton.width + Theme.spacingM;
if (showMatrix) { if (showMatrix) {
baseWidth += matrixButton.width + 4 baseWidth += matrixButton.width + 4;
} }
if (showIrc) { if (showIrc) {
baseWidth += ircButton.width + Theme.spacingM baseWidth += ircButton.width + Theme.spacingM;
} }
if (showCompositorDiscord) { if (showCompositorDiscord) {
baseWidth += compositorDiscordButton.width + Theme.spacingM baseWidth += compositorDiscordButton.width + Theme.spacingM;
} }
if (showReddit) { if (showReddit) {
baseWidth += redditButton.width + Theme.spacingM baseWidth += redditButton.width + Theme.spacingM;
} }
return baseWidth return baseWidth;
} }
Item { Item {
@@ -186,10 +204,7 @@ Item {
Image { Image {
anchors.fill: parent anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace( source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modules/Settings/", "") + compositorLogo
"file://", "").replace(
"/Modules/Settings/",
"") + compositorLogo
sourceSize: Qt.size(24, 24) sourceSize: Qt.size(24, 24)
smooth: true smooth: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
@@ -217,10 +232,7 @@ Item {
Image { Image {
anchors.fill: parent anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace( source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modules/Settings/", "") + "/assets/matrix-logo-white.svg"
"file://", "").replace(
"/Modules/Settings/",
"") + "/assets/matrix-logo-white.svg"
sourceSize: Qt.size(28, 18) sourceSize: Qt.size(28, 18)
smooth: true smooth: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
@@ -238,8 +250,7 @@ Item {
hoverEnabled: true hoverEnabled: true
onEntered: parent.hovered = true onEntered: parent.hovered = true
onExited: parent.hovered = false onExited: parent.hovered = false
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("https://matrix.to/#/#niri:matrix.org")
"https://matrix.to/#/#niri:matrix.org")
} }
} }
@@ -276,9 +287,11 @@ Item {
width: 20 width: 20
height: 20 height: 20
x: { x: {
if (showMatrix) return matrixButton.x + matrixButton.width + Theme.spacingM if (showMatrix)
if (showIrc) return ircButton.x + ircButton.width + Theme.spacingM return matrixButton.x + matrixButton.width + Theme.spacingM;
return compositorButton.x + compositorButton.width + Theme.spacingM if (showIrc)
return ircButton.x + ircButton.width + Theme.spacingM;
return compositorButton.x + compositorButton.width + Theme.spacingM;
} }
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -287,10 +300,7 @@ Item {
Image { Image {
anchors.fill: parent anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace( source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modules/Settings/", "") + "/assets/discord.svg"
"file://", "").replace(
"/Modules/Settings/",
"") + "/assets/discord.svg"
sourceSize: Qt.size(20, 20) sourceSize: Qt.size(20, 20)
smooth: true smooth: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
@@ -319,10 +329,7 @@ Item {
Image { Image {
anchors.fill: parent anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace( source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modules/Settings/", "") + "/assets/discord.svg"
"file://", "").replace(
"/Modules/Settings/",
"") + "/assets/discord.svg"
sourceSize: Qt.size(20, 20) sourceSize: Qt.size(20, 20)
smooth: true smooth: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
@@ -351,10 +358,7 @@ Item {
Image { Image {
anchors.fill: parent anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace( source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modules/Settings/", "") + "/assets/reddit.svg"
"file://", "").replace(
"/Modules/Settings/",
"") + "/assets/reddit.svg"
sourceSize: Qt.size(20, 20) sourceSize: Qt.size(20, 20)
smooth: true smooth: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
@@ -373,15 +377,13 @@ Item {
} }
} }
// Project Information // Project Information
StyledRect { StyledRect {
width: parent.width width: parent.width
height: projectSection.implicitHeight + Theme.spacingL * 2 height: projectSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -438,8 +440,7 @@ Item {
height: techSection.implicitHeight + Theme.spacingL * 2 height: techSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -600,8 +601,7 @@ Item {
height: supportSection.implicitHeight + Theme.spacingL * 2 height: supportSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Row { Row {
@@ -648,7 +648,6 @@ Item {
} }
} }
} }
} }
} }
@@ -659,13 +658,19 @@ Item {
z: 1000 z: 1000
property var hoveredButton: { property var hoveredButton: {
if (compositorButton.hovered) return compositorButton if (compositorButton.hovered)
if (matrixButton.visible && matrixButton.hovered) return matrixButton return compositorButton;
if (ircButton.visible && ircButton.hovered) return ircButton if (matrixButton.visible && matrixButton.hovered)
if (dmsDiscordButton.hovered) return dmsDiscordButton return matrixButton;
if (compositorDiscordButton.visible && compositorDiscordButton.hovered) return compositorDiscordButton if (ircButton.visible && ircButton.hovered)
if (redditButton.visible && redditButton.hovered) return redditButton return ircButton;
return null if (dmsDiscordButton.hovered)
return dmsDiscordButton;
if (compositorDiscordButton.visible && compositorDiscordButton.hovered)
return compositorDiscordButton;
if (redditButton.visible && redditButton.hovered)
return redditButton;
return null;
} }
property string tooltipText: hoveredButton ? hoveredButton.tooltipText : "" property string tooltipText: hoveredButton ? hoveredButton.tooltipText : ""

View File

@@ -1075,12 +1075,13 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
StyledRect { StyledRect {

View File

@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Common import qs.Common
@@ -10,81 +9,88 @@ Item {
id: displaysTab id: displaysTab
function getBarComponentsFromSettings() { function getBarComponentsFromSettings() {
const bars = SettingsData.barConfigs || [] const bars = SettingsData.barConfigs || [];
return bars.map(bar => ({ return bars.map(bar => ({
"id": "bar:" + bar.id, "id": "bar:" + bar.id,
"name": bar.name || "Bar", "name": bar.name || "Bar",
"description": I18n.tr("Individual bar configuration"), "description": I18n.tr("Individual bar configuration"),
"icon": "toolbar", "icon": "toolbar",
"barId": bar.id "barId": bar.id
})) }));
} }
property var variantComponents: getVariantComponentsList() property var variantComponents: getVariantComponentsList()
function getVariantComponentsList() { function getVariantComponentsList() {
return [ return [...getBarComponentsFromSettings(),
...getBarComponentsFromSettings(),
{ {
"id": "dock", "id": "dock",
"name": I18n.tr("Application Dock"), "name": I18n.tr("Application Dock"),
"description": I18n.tr("Bottom dock for pinned and running applications"), "description": I18n.tr("Bottom dock for pinned and running applications"),
"icon": "dock" "icon": "dock"
}, { },
{
"id": "notifications", "id": "notifications",
"name": I18n.tr("Notification Popups"), "name": I18n.tr("Notification Popups"),
"description": I18n.tr("Notification toast popups"), "description": I18n.tr("Notification toast popups"),
"icon": "notifications" "icon": "notifications"
}, { },
{
"id": "wallpaper", "id": "wallpaper",
"name": I18n.tr("Wallpaper"), "name": I18n.tr("Wallpaper"),
"description": I18n.tr("Desktop background images"), "description": I18n.tr("Desktop background images"),
"icon": "wallpaper" "icon": "wallpaper"
}, { },
{
"id": "osd", "id": "osd",
"name": I18n.tr("On-Screen Displays"), "name": I18n.tr("On-Screen Displays"),
"description": I18n.tr("Volume, brightness, and other system OSDs"), "description": I18n.tr("Volume, brightness, and other system OSDs"),
"icon": "picture_in_picture" "icon": "picture_in_picture"
}, { },
{
"id": "toast", "id": "toast",
"name": I18n.tr("Toast Messages"), "name": I18n.tr("Toast Messages"),
"description": I18n.tr("System toast notifications"), "description": I18n.tr("System toast notifications"),
"icon": "campaign" "icon": "campaign"
}, { },
{
"id": "notepad", "id": "notepad",
"name": I18n.tr("Notepad Slideout"), "name": I18n.tr("Notepad Slideout"),
"description": I18n.tr("Quick note-taking slideout panel"), "description": I18n.tr("Quick note-taking slideout panel"),
"icon": "sticky_note_2" "icon": "sticky_note_2"
}, { },
{
"id": "systemTray", "id": "systemTray",
"name": I18n.tr("System Tray"), "name": I18n.tr("System Tray"),
"description": I18n.tr("System tray icons"), "description": I18n.tr("System tray icons"),
"icon": "notifications" "icon": "notifications"
} }
] ];
} }
Connections { Connections {
target: SettingsData target: SettingsData
function onBarConfigsChanged() { function onBarConfigsChanged() {
variantComponents = getVariantComponentsList() variantComponents = getVariantComponentsList();
} }
} }
function getScreenPreferences(componentId) { function getScreenPreferences(componentId) {
if (componentId.startsWith("bar:")) { if (componentId.startsWith("bar:")) {
const barId = componentId.substring(4) const barId = componentId.substring(4);
const barConfig = SettingsData.getBarConfig(barId) const barConfig = SettingsData.getBarConfig(barId);
return barConfig?.screenPreferences || ["all"] return barConfig?.screenPreferences || ["all"];
} }
return SettingsData.screenPreferences && SettingsData.screenPreferences[componentId] || ["all"]; return SettingsData.screenPreferences && SettingsData.screenPreferences[componentId] || ["all"];
} }
function setScreenPreferences(componentId, screenNames) { function setScreenPreferences(componentId, screenNames) {
if (componentId.startsWith("bar:")) { if (componentId.startsWith("bar:")) {
const barId = componentId.substring(4) const barId = componentId.substring(4);
SettingsData.updateBarConfig(barId, { screenPreferences: screenNames }) SettingsData.updateBarConfig(barId, {
return screenPreferences: screenNames
});
return;
} }
var prefs = SettingsData.screenPreferences || {}; var prefs = SettingsData.screenPreferences || {};
var newPrefs = Object.assign({}, prefs); var newPrefs = Object.assign({}, prefs);
@@ -94,18 +100,20 @@ Item {
function getShowOnLastDisplay(componentId) { function getShowOnLastDisplay(componentId) {
if (componentId.startsWith("bar:")) { if (componentId.startsWith("bar:")) {
const barId = componentId.substring(4) const barId = componentId.substring(4);
const barConfig = SettingsData.getBarConfig(barId) const barConfig = SettingsData.getBarConfig(barId);
return barConfig?.showOnLastDisplay ?? true return barConfig?.showOnLastDisplay ?? true;
} }
return SettingsData.showOnLastDisplay && SettingsData.showOnLastDisplay[componentId] || false; return SettingsData.showOnLastDisplay && SettingsData.showOnLastDisplay[componentId] || false;
} }
function setShowOnLastDisplay(componentId, enabled) { function setShowOnLastDisplay(componentId, enabled) {
if (componentId.startsWith("bar:")) { if (componentId.startsWith("bar:")) {
const barId = componentId.substring(4) const barId = componentId.substring(4);
SettingsData.updateBarConfig(barId, { showOnLastDisplay: enabled }) SettingsData.updateBarConfig(barId, {
return showOnLastDisplay: enabled
});
return;
} }
var prefs = SettingsData.showOnLastDisplay || {}; var prefs = SettingsData.showOnLastDisplay || {};
var newPrefs = Object.assign({}, prefs); var newPrefs = Object.assign({}, prefs);
@@ -116,13 +124,14 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
StyledRect { StyledRect {
@@ -169,12 +178,12 @@ Item {
checked: DisplayService.nightModeEnabled checked: DisplayService.nightModeEnabled
enabled: DisplayService.gammaControlAvailable enabled: DisplayService.gammaControlAvailable
onToggled: checked => { onToggled: checked => {
DisplayService.toggleNightMode() DisplayService.toggleNightMode();
} }
Connections { Connections {
function onNightModeEnabledChanged() { function onNightModeEnabledChanged() {
nightModeToggle.checked = DisplayService.nightModeEnabled nightModeToggle.checked = DisplayService.nightModeEnabled;
} }
target: DisplayService target: DisplayService
@@ -194,19 +203,19 @@ Item {
description: I18n.tr("Color temperature for night mode") description: I18n.tr("Color temperature for night mode")
currentValue: SessionData.nightModeTemperature + "K" currentValue: SessionData.nightModeTemperature + "K"
options: { options: {
var temps = [] var temps = [];
for (var i = 2500; i <= 6000; i += 500) { for (var i = 2500; i <= 6000; i += 500) {
temps.push(i + "K") temps.push(i + "K");
} }
return temps return temps;
} }
onValueChanged: value => { onValueChanged: value => {
var temp = parseInt(value.replace("K", "")) var temp = parseInt(value.replace("K", ""));
SessionData.setNightModeTemperature(temp) SessionData.setNightModeTemperature(temp);
if (SessionData.nightModeHighTemperature < temp) { if (SessionData.nightModeHighTemperature < temp) {
SessionData.setNightModeHighTemperature(temp) SessionData.setNightModeHighTemperature(temp);
} }
} }
} }
DankDropdown { DankDropdown {
@@ -215,19 +224,19 @@ Item {
description: I18n.tr("Color temperature for day time") description: I18n.tr("Color temperature for day time")
currentValue: SessionData.nightModeHighTemperature + "K" currentValue: SessionData.nightModeHighTemperature + "K"
options: { options: {
var temps = [] var temps = [];
var minTemp = SessionData.nightModeTemperature var minTemp = SessionData.nightModeTemperature;
for (var i = Math.max(2500, minTemp); i <= 10000; i += 500) { for (var i = Math.max(2500, minTemp); i <= 10000; i += 500) {
temps.push(i + "K") temps.push(i + "K");
} }
return temps return temps;
} }
onValueChanged: value => { onValueChanged: value => {
var temp = parseInt(value.replace("K", "")) var temp = parseInt(value.replace("K", ""));
if (temp >= SessionData.nightModeTemperature) { if (temp >= SessionData.nightModeTemperature) {
SessionData.setNightModeHighTemperature(temp) SessionData.setNightModeHighTemperature(temp);
} }
} }
} }
} }
@@ -239,18 +248,18 @@ Item {
checked: SessionData.nightModeAutoEnabled checked: SessionData.nightModeAutoEnabled
visible: DisplayService.gammaControlAvailable visible: DisplayService.gammaControlAvailable
onToggled: checked => { onToggled: checked => {
if (checked && !DisplayService.nightModeEnabled) { if (checked && !DisplayService.nightModeEnabled) {
DisplayService.toggleNightMode() DisplayService.toggleNightMode();
} else if (!checked && DisplayService.nightModeEnabled) { } else if (!checked && DisplayService.nightModeEnabled) {
DisplayService.toggleNightMode() DisplayService.toggleNightMode();
} }
SessionData.setNightModeAutoEnabled(checked) SessionData.setNightModeAutoEnabled(checked);
} }
Connections { Connections {
target: SessionData target: SessionData
function onNightModeAutoEnabledChanged() { function onNightModeAutoEnabledChanged() {
automaticToggle.checked = SessionData.nightModeAutoEnabled automaticToggle.checked = SessionData.nightModeAutoEnabled;
} }
} }
} }
@@ -264,7 +273,7 @@ Item {
Connections { Connections {
target: SessionData target: SessionData
function onNightModeAutoEnabledChanged() { function onNightModeAutoEnabledChanged() {
automaticSettings.visible = SessionData.nightModeAutoEnabled automaticSettings.visible = SessionData.nightModeAutoEnabled;
} }
} }
@@ -277,29 +286,32 @@ Item {
width: 200 width: 200
height: 45 height: 45
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
model: [{ model: [
{
"text": "Time", "text": "Time",
"icon": "access_time" "icon": "access_time"
}, { },
{
"text": "Location", "text": "Location",
"icon": "place" "icon": "place"
}] }
]
Component.onCompleted: { Component.onCompleted: {
currentIndex = SessionData.nightModeAutoMode === "location" ? 1 : 0 currentIndex = SessionData.nightModeAutoMode === "location" ? 1 : 0;
Qt.callLater(updateIndicator) Qt.callLater(updateIndicator);
} }
onTabClicked: index => { onTabClicked: index => {
DisplayService.setNightModeAutomationMode(index === 1 ? "location" : "time") DisplayService.setNightModeAutomationMode(index === 1 ? "location" : "time");
currentIndex = index currentIndex = index;
} }
Connections { Connections {
target: SessionData target: SessionData
function onNightModeAutoModeChanged() { function onNightModeAutoModeChanged() {
modeTabBarNight.currentIndex = SessionData.nightModeAutoMode === "location" ? 1 : 0 modeTabBarNight.currentIndex = SessionData.nightModeAutoMode === "location" ? 1 : 0;
Qt.callLater(modeTabBarNight.updateIndicator) Qt.callLater(modeTabBarNight.updateIndicator);
} }
} }
} }
@@ -356,30 +368,30 @@ Item {
dropdownWidth: 70 dropdownWidth: 70
currentValue: SessionData.nightModeStartHour.toString() currentValue: SessionData.nightModeStartHour.toString()
options: { options: {
var hours = [] var hours = [];
for (var i = 0; i < 24; i++) { for (var i = 0; i < 24; i++) {
hours.push(i.toString()) hours.push(i.toString());
} }
return hours return hours;
} }
onValueChanged: value => { onValueChanged: value => {
SessionData.setNightModeStartHour(parseInt(value)) SessionData.setNightModeStartHour(parseInt(value));
} }
} }
DankDropdown { DankDropdown {
dropdownWidth: 70 dropdownWidth: 70
currentValue: SessionData.nightModeStartMinute.toString().padStart(2, '0') currentValue: SessionData.nightModeStartMinute.toString().padStart(2, '0')
options: { options: {
var minutes = [] var minutes = [];
for (var i = 0; i < 60; i += 5) { for (var i = 0; i < 60; i += 5) {
minutes.push(i.toString().padStart(2, '0')) minutes.push(i.toString().padStart(2, '0'));
} }
return minutes return minutes;
} }
onValueChanged: value => { onValueChanged: value => {
SessionData.setNightModeStartMinute(parseInt(value)) SessionData.setNightModeStartMinute(parseInt(value));
} }
} }
} }
@@ -399,30 +411,30 @@ Item {
dropdownWidth: 70 dropdownWidth: 70
currentValue: SessionData.nightModeEndHour.toString() currentValue: SessionData.nightModeEndHour.toString()
options: { options: {
var hours = [] var hours = [];
for (var i = 0; i < 24; i++) { for (var i = 0; i < 24; i++) {
hours.push(i.toString()) hours.push(i.toString());
} }
return hours return hours;
} }
onValueChanged: value => { onValueChanged: value => {
SessionData.setNightModeEndHour(parseInt(value)) SessionData.setNightModeEndHour(parseInt(value));
} }
} }
DankDropdown { DankDropdown {
dropdownWidth: 70 dropdownWidth: 70
currentValue: SessionData.nightModeEndMinute.toString().padStart(2, '0') currentValue: SessionData.nightModeEndMinute.toString().padStart(2, '0')
options: { options: {
var minutes = [] var minutes = [];
for (var i = 0; i < 60; i += 5) { for (var i = 0; i < 60; i += 5) {
minutes.push(i.toString().padStart(2, '0')) minutes.push(i.toString().padStart(2, '0'));
} }
return minutes return minutes;
} }
onValueChanged: value => { onValueChanged: value => {
SessionData.setNightModeEndMinute(parseInt(value)) SessionData.setNightModeEndMinute(parseInt(value));
} }
} }
} }
} }
@@ -441,13 +453,13 @@ Item {
description: I18n.tr("Automatically detect location based on IP address") description: I18n.tr("Automatically detect location based on IP address")
checked: SessionData.nightModeUseIPLocation || false checked: SessionData.nightModeUseIPLocation || false
onToggled: checked => { onToggled: checked => {
SessionData.setNightModeUseIPLocation(checked) SessionData.setNightModeUseIPLocation(checked);
} }
Connections { Connections {
target: SessionData target: SessionData
function onNightModeUseIPLocationChanged() { function onNightModeUseIPLocationChanged() {
ipLocationToggle.checked = SessionData.nightModeUseIPLocation ipLocationToggle.checked = SessionData.nightModeUseIPLocation;
} }
} }
} }
@@ -482,9 +494,9 @@ Item {
text: SessionData.latitude.toString() text: SessionData.latitude.toString()
placeholderText: "0.0" placeholderText: "0.0"
onEditingFinished: { onEditingFinished: {
const lat = parseFloat(text) const lat = parseFloat(text);
if (!isNaN(lat) && lat >= -90 && lat <= 90 && lat !== SessionData.latitude) { if (!isNaN(lat) && lat >= -90 && lat <= 90 && lat !== SessionData.latitude) {
SessionData.setLatitude(lat) SessionData.setLatitude(lat);
} }
} }
} }
@@ -505,9 +517,9 @@ Item {
text: SessionData.longitude.toString() text: SessionData.longitude.toString()
placeholderText: "0.0" placeholderText: "0.0"
onEditingFinished: { onEditingFinished: {
const lon = parseFloat(text) const lon = parseFloat(text);
if (!isNaN(lon) && lon >= -180 && lon <= 180 && lon !== SessionData.longitude) { if (!isNaN(lon) && lon >= -180 && lon <= 180 && lon !== SessionData.longitude) {
SessionData.setLongitude(lon) SessionData.setLongitude(lon);
} }
} }
} }
@@ -572,9 +584,7 @@ Item {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
width: parent.width width: parent.width
} }
} }
} }
Column { Column {
@@ -618,15 +628,16 @@ Item {
model: [I18n.tr("Name"), I18n.tr("Model")] model: [I18n.tr("Name"), I18n.tr("Model")]
currentIndex: SettingsData.displayNameMode === "model" ? 1 : 0 currentIndex: SettingsData.displayNameMode === "model" ? 1 : 0
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (!selected) return if (!selected)
SettingsData.displayNameMode = index === 1 ? "model" : "system" return;
SettingsData.saveSettings() SettingsData.displayNameMode = index === 1 ? "model" : "system";
SettingsData.saveSettings();
} }
Connections { Connections {
target: SettingsData target: SettingsData
function onDisplayNameModeChanged() { function onDisplayNameModeChanged() {
displayModeGroup.currentIndex = SettingsData.displayNameMode === "model" ? 1 : 0 displayModeGroup.currentIndex = SettingsData.displayNameMode === "model" ? 1 : 0;
} }
} }
} }
@@ -691,21 +702,13 @@ Item {
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
} }
} }
} }
} }
} }
} }
} }
} }
} }
Column { Column {
@@ -760,9 +763,7 @@ Item {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
width: parent.width width: parent.width
} }
} }
} }
Column { Column {
@@ -787,17 +788,17 @@ Item {
text: I18n.tr("All displays") text: I18n.tr("All displays")
description: I18n.tr("Show on all connected displays") description: I18n.tr("Show on all connected displays")
checked: { checked: {
var prefs = displaysTab.getScreenPreferences(parent.componentId) var prefs = displaysTab.getScreenPreferences(parent.componentId);
return prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all") return prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all");
} }
onToggled: (checked) => { onToggled: checked => {
if (checked) { if (checked) {
displaysTab.setScreenPreferences(parent.componentId, ["all"]) displaysTab.setScreenPreferences(parent.componentId, ["all"]);
} else { } else {
displaysTab.setScreenPreferences(parent.componentId, []) displaysTab.setScreenPreferences(parent.componentId, []);
const cid = parent.componentId const cid = parent.componentId;
if (["dankBar", "dock", "notifications", "osd", "toast"].includes(cid) || cid.startsWith("bar:")) { if (["dankBar", "dock", "notifications", "osd", "toast"].includes(cid) || cid.startsWith("bar:")) {
displaysTab.setShowOnLastDisplay(cid, true) displaysTab.setShowOnLastDisplay(cid, true);
} }
} }
} }
@@ -809,14 +810,14 @@ Item {
description: I18n.tr("Always show when there's only one connected display") description: I18n.tr("Always show when there's only one connected display")
checked: displaysTab.getShowOnLastDisplay(parent.componentId) checked: displaysTab.getShowOnLastDisplay(parent.componentId)
visible: { visible: {
const prefs = displaysTab.getScreenPreferences(parent.componentId) const prefs = displaysTab.getScreenPreferences(parent.componentId);
const isAll = prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all") const isAll = prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all");
const cid = parent.componentId const cid = parent.componentId;
const isRelevantComponent = ["dankBar", "dock", "notifications", "osd", "toast", "notepad", "systemTray"].includes(cid) || cid.startsWith("bar:") const isRelevantComponent = ["dankBar", "dock", "notifications", "osd", "toast", "notepad", "systemTray"].includes(cid) || cid.startsWith("bar:");
return !isAll && isRelevantComponent return !isAll && isRelevantComponent;
} }
onToggled: (checked) => { onToggled: checked => {
displaysTab.setShowOnLastDisplay(parent.componentId, checked) displaysTab.setShowOnLastDisplay(parent.componentId, checked);
} }
} }
@@ -826,8 +827,8 @@ Item {
color: Theme.outline color: Theme.outline
opacity: 0.2 opacity: 0.2
visible: { visible: {
var prefs = displaysTab.getScreenPreferences(parent.componentId) var prefs = displaysTab.getScreenPreferences(parent.componentId);
return !prefs.includes("all") && !(typeof prefs[0] === "string" && prefs[0] === "all") return !prefs.includes("all") && !(typeof prefs[0] === "string" && prefs[0] === "all");
} }
} }
@@ -835,8 +836,8 @@ Item {
width: parent.width width: parent.width
spacing: Theme.spacingXS spacing: Theme.spacingXS
visible: { visible: {
var prefs = displaysTab.getScreenPreferences(parent.componentId) var prefs = displaysTab.getScreenPreferences(parent.componentId);
return !prefs.includes("all") && !(typeof prefs[0] === "string" && prefs[0] === "all") return !prefs.includes("all") && !(typeof prefs[0] === "string" && prefs[0] === "all");
} }
Repeater { Repeater {
@@ -850,50 +851,41 @@ Item {
text: SettingsData.getScreenDisplayName(screenData) text: SettingsData.getScreenDisplayName(screenData)
description: screenData.width + "×" + screenData.height + " • " + (SettingsData.displayNameMode === "system" ? (screenData.model || "Unknown Model") : screenData.name) description: screenData.width + "×" + screenData.height + " • " + (SettingsData.displayNameMode === "system" ? (screenData.model || "Unknown Model") : screenData.name)
checked: { checked: {
var prefs = displaysTab.getScreenPreferences(componentId) var prefs = displaysTab.getScreenPreferences(componentId);
if (typeof prefs[0] === "string" && prefs[0] === "all") return false if (typeof prefs[0] === "string" && prefs[0] === "all")
return SettingsData.isScreenInPreferences(screenData, prefs) return false;
return SettingsData.isScreenInPreferences(screenData, prefs);
} }
onToggled: (checked) => { onToggled: checked => {
var currentPrefs = displaysTab.getScreenPreferences(componentId) var currentPrefs = displaysTab.getScreenPreferences(componentId);
if (typeof currentPrefs[0] === "string" && currentPrefs[0] === "all") { if (typeof currentPrefs[0] === "string" && currentPrefs[0] === "all") {
currentPrefs = [] currentPrefs = [];
} }
var newPrefs = currentPrefs.filter(pref => { var newPrefs = currentPrefs.filter(pref => {
if (typeof pref === "string") return false if (typeof pref === "string")
return pref.name !== screenData.name || pref.model !== screenData.model return false;
}) return pref.name !== screenData.name || pref.model !== screenData.model;
});
if (checked) { if (checked) {
newPrefs.push({ newPrefs.push({
name: screenData.name, name: screenData.name,
model: screenData.model || "" model: screenData.model || ""
}) });
} }
displaysTab.setScreenPreferences(componentId, newPrefs) displaysTab.setScreenPreferences(componentId, newPrefs);
} }
} }
} }
} }
} }
} }
} }
} }
} }
} }
} }
} }
}
}

View File

@@ -1,6 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import Quickshell.Widgets
import qs.Common import qs.Common
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -11,12 +9,13 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
// Dock Position // Dock Position
@@ -25,8 +24,7 @@ Item {
height: dockPositionSection.implicitHeight + Theme.spacingL * 2 height: dockPositionSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -67,20 +65,33 @@ Item {
model: ["Top", "Bottom", "Left", "Right"] model: ["Top", "Bottom", "Left", "Right"]
currentIndex: { currentIndex: {
switch (SettingsData.dockPosition) { switch (SettingsData.dockPosition) {
case SettingsData.Position.Top: return 0 case SettingsData.Position.Top:
case SettingsData.Position.Bottom: return 1 return 0;
case SettingsData.Position.Left: return 2 case SettingsData.Position.Bottom:
case SettingsData.Position.Right: return 3 return 1;
default: return 1 case SettingsData.Position.Left:
return 2;
case SettingsData.Position.Right:
return 3;
default:
return 1;
} }
} }
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (selected) { if (selected) {
switch (index) { switch (index) {
case 0: SettingsData.setDockPosition(SettingsData.Position.Top); break case 0:
case 1: SettingsData.setDockPosition(SettingsData.Position.Bottom); break SettingsData.setDockPosition(SettingsData.Position.Top);
case 2: SettingsData.setDockPosition(SettingsData.Position.Left); break break;
case 3: SettingsData.setDockPosition(SettingsData.Position.Right); break case 1:
SettingsData.setDockPosition(SettingsData.Position.Bottom);
break;
case 2:
SettingsData.setDockPosition(SettingsData.Position.Left);
break;
case 3:
SettingsData.setDockPosition(SettingsData.Position.Right);
break;
} }
} }
} }
@@ -95,8 +106,7 @@ Item {
height: dockVisibilitySection.implicitHeight + Theme.spacingL * 2 height: dockVisibilitySection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -118,8 +128,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - enableToggle.width - Theme.spacingM
- enableToggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -145,8 +154,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.showDock checked: SettingsData.showDock
onToggled: checked => { onToggled: checked => {
SettingsData.setShowDock(checked) SettingsData.setShowDock(checked);
} }
} }
} }
@@ -172,8 +181,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - autoHideToggle.width - Theme.spacingM
- autoHideToggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -199,8 +207,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dockAutoHide checked: SettingsData.dockAutoHide
onToggled: checked => { onToggled: checked => {
SettingsData.set("dockAutoHide", checked) SettingsData.set("dockAutoHide", checked);
} }
} }
Behavior on opacity { Behavior on opacity {
@@ -232,8 +240,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - overviewToggle.width - Theme.spacingM
- overviewToggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -259,8 +266,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dockOpenOnOverview checked: SettingsData.dockOpenOnOverview
onToggled: checked => { onToggled: checked => {
SettingsData.set("dockOpenOnOverview", checked) SettingsData.set("dockOpenOnOverview", checked);
} }
} }
} }
} }
@@ -272,8 +279,7 @@ Item {
height: groupByAppSection.implicitHeight + Theme.spacingL * 2 height: groupByAppSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -295,8 +301,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - groupByAppToggle.width - Theme.spacingM
- groupByAppToggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -322,8 +327,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dockGroupByApp checked: SettingsData.dockGroupByApp
onToggled: checked => { onToggled: checked => {
SettingsData.set("dockGroupByApp", checked) SettingsData.set("dockGroupByApp", checked);
} }
} }
} }
} }
@@ -335,8 +340,7 @@ Item {
height: indicatorStyleSection.implicitHeight + Theme.spacingL * 2 height: indicatorStyleSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -378,7 +382,7 @@ Item {
currentIndex: SettingsData.dockIndicatorStyle === "circle" ? 0 : 1 currentIndex: SettingsData.dockIndicatorStyle === "circle" ? 0 : 1
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (selected) { if (selected) {
SettingsData.set("dockIndicatorStyle", index === 0 ? "circle" : "line") SettingsData.set("dockIndicatorStyle", index === 0 ? "circle" : "line");
} }
} }
} }
@@ -392,8 +396,7 @@ Item {
height: iconSizeSection.implicitHeight + Theme.spacingL * 2 height: iconSizeSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -437,7 +440,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
SettingsData.set("dockIconSize", 48) SettingsData.set("dockIconSize", 48);
} }
} }
} }
@@ -453,8 +456,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("dockIconSize", newValue) SettingsData.set("dockIconSize", newValue);
} }
} }
} }
} }
@@ -465,8 +468,7 @@ Item {
height: dockSpacingSection.implicitHeight + Theme.spacingL * 2 height: dockSpacingSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -533,7 +535,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
SettingsData.set("dockSpacing", 8) SettingsData.set("dockSpacing", 8);
} }
} }
@@ -554,9 +556,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("dockSpacing", SettingsData.set("dockSpacing", newValue);
newValue) }
}
} }
} }
@@ -597,7 +598,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
SettingsData.set("dockBottomGap", 0) SettingsData.set("dockBottomGap", 0);
} }
} }
@@ -618,9 +619,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("dockBottomGap", SettingsData.set("dockBottomGap", newValue);
newValue) }
}
} }
} }
@@ -661,7 +661,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
SettingsData.set("dockMargin", 0) SettingsData.set("dockMargin", 0);
} }
} }
@@ -682,8 +682,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("dockMargin", newValue) SettingsData.set("dockMargin", newValue);
} }
} }
} }
} }
@@ -695,8 +695,7 @@ Item {
height: transparencySection.implicitHeight + Theme.spacingL * 2 height: transparencySection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -740,7 +739,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
SettingsData.set("dockTransparency", 0.85) SettingsData.set("dockTransparency", 0.85);
} }
} }
} }
@@ -756,9 +755,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("dockTransparency", SettingsData.set("dockTransparency", newValue / 100);
newValue / 100) }
}
} }
} }
} }

View File

@@ -1,9 +1,5 @@
import QtQuick import QtQuick
import QtQuick.Controls
import Quickshell
import Quickshell.Widgets
import qs.Common import qs.Common
import qs.Modals
import qs.Modals.FileBrowser import qs.Modals.FileBrowser
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -18,19 +14,20 @@ Item {
browserType: "generic" browserType: "generic"
filterExtensions: ["*.svg", "*.png", "*.jpg", "*.jpeg", "*.webp"] filterExtensions: ["*.svg", "*.png", "*.jpg", "*.jpeg", "*.webp"]
onFileSelected: path => { onFileSelected: path => {
SettingsData.set("launcherLogoCustomPath", path.replace("file://", "")) SettingsData.set("launcherLogoCustomPath", path.replace("file://", ""));
} }
} }
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
StyledRect { StyledRect {
@@ -38,8 +35,7 @@ Item {
height: launcherLogoSection.implicitHeight + Theme.spacingL * 2 height: launcherLogoSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -85,41 +81,47 @@ Item {
id: logoModeGroup id: logoModeGroup
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
model: { model: {
const modes = [I18n.tr("Apps Icon"), I18n.tr("OS Logo"), I18n.tr("Dank")] const modes = [I18n.tr("Apps Icon"), I18n.tr("OS Logo"), I18n.tr("Dank")];
if (CompositorService.isNiri) { if (CompositorService.isNiri) {
modes.push("niri") modes.push("niri");
} else if (CompositorService.isHyprland) { } else if (CompositorService.isHyprland) {
modes.push("Hyprland") modes.push("Hyprland");
} else if (CompositorService.isDwl) { } else if (CompositorService.isDwl) {
modes.push("mango") modes.push("mango");
} else if (CompositorService.isSway) { } else if (CompositorService.isSway) {
modes.push("Sway") modes.push("Sway");
} else { } else {
modes.push(I18n.tr("Compositor")) modes.push(I18n.tr("Compositor"));
} }
modes.push(I18n.tr("Custom")) modes.push(I18n.tr("Custom"));
return modes return modes;
} }
currentIndex: { currentIndex: {
if (SettingsData.launcherLogoMode === "apps") return 0 if (SettingsData.launcherLogoMode === "apps")
if (SettingsData.launcherLogoMode === "os") return 1 return 0;
if (SettingsData.launcherLogoMode === "dank") return 2 if (SettingsData.launcherLogoMode === "os")
if (SettingsData.launcherLogoMode === "compositor") return 3 return 1;
if (SettingsData.launcherLogoMode === "custom") return 4 if (SettingsData.launcherLogoMode === "dank")
return 0 return 2;
if (SettingsData.launcherLogoMode === "compositor")
return 3;
if (SettingsData.launcherLogoMode === "custom")
return 4;
return 0;
} }
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (!selected) return if (!selected)
return;
if (index === 0) { if (index === 0) {
SettingsData.set("launcherLogoMode", "apps") SettingsData.set("launcherLogoMode", "apps");
} else if (index === 1) { } else if (index === 1) {
SettingsData.set("launcherLogoMode", "os") SettingsData.set("launcherLogoMode", "os");
} else if (index === 2) { } else if (index === 2) {
SettingsData.set("launcherLogoMode", "dank") SettingsData.set("launcherLogoMode", "dank");
} else if (index === 3) { } else if (index === 3) {
SettingsData.set("launcherLogoMode", "compositor") SettingsData.set("launcherLogoMode", "compositor");
} else if (index === 4) { } else if (index === 4) {
SettingsData.set("launcherLogoMode", "custom") SettingsData.set("launcherLogoMode", "custom");
} }
} }
} }
@@ -200,25 +202,29 @@ Item {
id: colorModeGroup id: colorModeGroup
model: [I18n.tr("Default"), I18n.tr("Primary"), I18n.tr("Surface"), I18n.tr("Custom")] model: [I18n.tr("Default"), I18n.tr("Primary"), I18n.tr("Surface"), I18n.tr("Custom")]
currentIndex: { currentIndex: {
const override = SettingsData.launcherLogoColorOverride const override = SettingsData.launcherLogoColorOverride;
if (override === "") return 0 if (override === "")
if (override === "primary") return 1 return 0;
if (override === "surface") return 2 if (override === "primary")
return 3 return 1;
if (override === "surface")
return 2;
return 3;
} }
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (!selected) return if (!selected)
return;
if (index === 0) { if (index === 0) {
SettingsData.set("launcherLogoColorOverride", "") SettingsData.set("launcherLogoColorOverride", "");
} else if (index === 1) { } else if (index === 1) {
SettingsData.set("launcherLogoColorOverride", "primary") SettingsData.set("launcherLogoColorOverride", "primary");
} else if (index === 2) { } else if (index === 2) {
SettingsData.set("launcherLogoColorOverride", "surface") SettingsData.set("launcherLogoColorOverride", "surface");
} else if (index === 3) { } else if (index === 3) {
const currentOverride = SettingsData.launcherLogoColorOverride const currentOverride = SettingsData.launcherLogoColorOverride;
const isPreset = currentOverride === "" || currentOverride === "primary" || currentOverride === "surface" const isPreset = currentOverride === "" || currentOverride === "primary" || currentOverride === "surface";
if (isPreset) { if (isPreset) {
SettingsData.set("launcherLogoColorOverride", "#ffffff") SettingsData.set("launcherLogoColorOverride", "#ffffff");
} }
} }
} }
@@ -226,18 +232,18 @@ Item {
Rectangle { Rectangle {
visible: { visible: {
const override = SettingsData.launcherLogoColorOverride const override = SettingsData.launcherLogoColorOverride;
return override !== "" && override !== "primary" && override !== "surface" return override !== "" && override !== "primary" && override !== "surface";
} }
width: 36 width: 36
height: 36 height: 36
radius: 18 radius: 18
color: { color: {
const override = SettingsData.launcherLogoColorOverride const override = SettingsData.launcherLogoColorOverride;
if (override !== "" && override !== "primary" && override !== "surface") { if (override !== "" && override !== "primary" && override !== "surface") {
return override return override;
} }
return "#ffffff" return "#ffffff";
} }
border.color: Theme.outline border.color: Theme.outline
border.width: 1 border.width: 1
@@ -248,12 +254,12 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (PopoutService.colorPickerModal) { if (PopoutService.colorPickerModal) {
PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride;
PopoutService.colorPickerModal.pickerTitle = I18n.tr("Choose Launcher Logo Color") PopoutService.colorPickerModal.pickerTitle = I18n.tr("Choose Launcher Logo Color");
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) { PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
SettingsData.set("launcherLogoColorOverride", selectedColor) SettingsData.set("launcherLogoColorOverride", selectedColor);
} };
PopoutService.colorPickerModal.show() PopoutService.colorPickerModal.show();
} }
} }
} }
@@ -290,7 +296,7 @@ Item {
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("launcherLogoSizeOffset", newValue) SettingsData.set("launcherLogoSizeOffset", newValue);
} }
} }
} }
@@ -300,8 +306,8 @@ Item {
width: parent.width width: parent.width
height: customControlsFlow.height height: customControlsFlow.height
visible: { visible: {
const override = SettingsData.launcherLogoColorOverride const override = SettingsData.launcherLogoColorOverride;
return override !== "" && override !== "primary" && override !== "surface" return override !== "" && override !== "primary" && override !== "surface";
} }
opacity: visible ? 1 : 0 opacity: visible ? 1 : 0
@@ -341,7 +347,7 @@ Item {
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("launcherLogoBrightness", newValue / 100) SettingsData.set("launcherLogoBrightness", newValue / 100);
} }
} }
} }
@@ -370,7 +376,7 @@ Item {
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("launcherLogoContrast", newValue / 100) SettingsData.set("launcherLogoContrast", newValue / 100);
} }
} }
} }
@@ -393,7 +399,7 @@ Item {
checked: SettingsData.launcherLogoColorInvertOnMode checked: SettingsData.launcherLogoColorInvertOnMode
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onToggled: checked => { onToggled: checked => {
SettingsData.set("launcherLogoColorInvertOnMode", checked) SettingsData.set("launcherLogoColorInvertOnMode", checked);
} }
} }
} }
@@ -408,8 +414,7 @@ Item {
height: launchPrefixSection.implicitHeight + Theme.spacingL * 2 height: launchPrefixSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -452,7 +457,7 @@ Item {
text: SettingsData.launchPrefix text: SettingsData.launchPrefix
placeholderText: I18n.tr("Enter launch prefix (e.g., 'uwsm-app')") placeholderText: I18n.tr("Enter launch prefix (e.g., 'uwsm-app')")
onTextEdited: { onTextEdited: {
SettingsData.set("launchPrefix", text) SettingsData.set("launchPrefix", text);
} }
} }
} }
@@ -463,8 +468,7 @@ Item {
height: sortingSection.implicitHeight + Theme.spacingL * 2 height: sortingSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -494,9 +498,7 @@ Item {
} }
Item { Item {
width: parent.width - parent.children[0].width width: parent.width - parent.children[0].width - parent.children[1].width - sortToggle.width - Theme.spacingM * 3
- parent.children[1].width
- sortToggle.width - Theme.spacingM * 3
height: 1 height: 1
} }
@@ -508,7 +510,7 @@ Item {
checked: SettingsData.sortAppsAlphabetically checked: SettingsData.sortAppsAlphabetically
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onToggled: checked => { onToggled: checked => {
SettingsData.set("sortAppsAlphabetically", checked) SettingsData.set("sortAppsAlphabetically", checked);
} }
} }
} }
@@ -528,8 +530,7 @@ Item {
height: gridColumnsSection.implicitHeight + Theme.spacingL * 2 height: gridColumnsSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -584,7 +585,7 @@ Item {
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.set("appLauncherGridColumns", newValue) SettingsData.set("appLauncherGridColumns", newValue);
} }
} }
} }
@@ -596,8 +597,7 @@ Item {
height: niriOverviewSection.implicitHeight + Theme.spacingL * 2 height: niriOverviewSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
visible: CompositorService.isNiri visible: CompositorService.isNiri
@@ -628,9 +628,7 @@ Item {
} }
Item { Item {
width: parent.width - parent.children[0].width width: parent.width - parent.children[0].width - parent.children[1].width - niriOverviewToggle.width - Theme.spacingM * 3
- parent.children[1].width
- niriOverviewToggle.width - Theme.spacingM * 3
height: 1 height: 1
} }
@@ -642,7 +640,7 @@ Item {
checked: SettingsData.spotlightCloseNiriOverview checked: SettingsData.spotlightCloseNiriOverview
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onToggled: checked => { onToggled: checked => {
SettingsData.set("spotlightCloseNiriOverview", checked) SettingsData.set("spotlightCloseNiriOverview", checked);
} }
} }
} }
@@ -662,36 +660,33 @@ Item {
height: recentlyUsedSection.implicitHeight + Theme.spacingL * 2 height: recentlyUsedSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
id: recentlyUsedSection id: recentlyUsedSection
property var rankedAppsModel: { property var rankedAppsModel: {
var apps = [] var apps = [];
for (var appId in (AppUsageHistoryData.appUsageRanking for (var appId in (AppUsageHistoryData.appUsageRanking || {})) {
|| {})) { var appData = (AppUsageHistoryData.appUsageRanking || {})[appId];
var appData = (AppUsageHistoryData.appUsageRanking
|| {})[appId]
apps.push({ apps.push({
"id": appId, "id": appId,
"name": appData.name, "name": appData.name,
"exec": appData.exec, "exec": appData.exec,
"icon": appData.icon, "icon": appData.icon,
"comment": appData.comment, "comment": appData.comment,
"usageCount": appData.usageCount, "usageCount": appData.usageCount,
"lastUsed": appData.lastUsed "lastUsed": appData.lastUsed
}) });
} }
apps.sort(function (a, b) { apps.sort(function (a, b) {
if (a.usageCount !== b.usageCount) if (a.usageCount !== b.usageCount)
return b.usageCount - a.usageCount return b.usageCount - a.usageCount;
return a.name.localeCompare(b.name) return a.name.localeCompare(b.name);
}) });
return apps.slice(0, 20) return apps.slice(0, 20);
} }
anchors.fill: parent anchors.fill: parent
@@ -718,9 +713,7 @@ Item {
} }
Item { Item {
width: parent.width - parent.children[0].width width: parent.width - parent.children[0].width - parent.children[1].width - clearAllButton.width - Theme.spacingM * 3
- parent.children[1].width
- clearAllButton.width - Theme.spacingM * 3
height: 1 height: 1
} }
@@ -732,8 +725,8 @@ Item {
iconColor: Theme.error iconColor: Theme.error
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
AppUsageHistoryData.appUsageRanking = {} AppUsageHistoryData.appUsageRanking = {};
AppUsageHistoryData.saveSettings() AppUsageHistoryData.saveSettings();
} }
} }
} }
@@ -759,12 +752,8 @@ Item {
width: rankedAppsList.width width: rankedAppsList.width
height: 48 height: 48
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.3)
Theme.surfaceContainer.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
Theme.surfaceContainer.b, 0.3)
border.color: Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.1)
border.width: 0 border.width: 0
Row { Row {
@@ -792,7 +781,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onStatusChanged: { onStatusChanged: {
if (status === Image.Error) if (status === Image.Error)
source = "image://icon/application-x-executable" source = "image://icon/application-x-executable";
} }
} }
@@ -801,8 +790,7 @@ Item {
spacing: 2 spacing: 2
StyledText { StyledText {
text: modelData.name text: modelData.name || "Unknown App"
|| "Unknown App"
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium font.weight: Font.Medium
color: Theme.surfaceText color: Theme.surfaceText
@@ -811,37 +799,27 @@ Item {
StyledText { StyledText {
text: { text: {
if (!modelData.lastUsed) if (!modelData.lastUsed)
return "Never used" return "Never used";
var date = new Date(modelData.lastUsed) var date = new Date(modelData.lastUsed);
var now = new Date() var now = new Date();
var diffMs = now - date var diffMs = now - date;
var diffMins = Math.floor( var diffMins = Math.floor(diffMs / (1000 * 60));
diffMs / (1000 * 60)) var diffHours = Math.floor(diffMs / (1000 * 60 * 60));
var diffHours = Math.floor( var diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
diffMs / (1000 * 60 * 60))
var diffDays = Math.floor(
diffMs / (1000 * 60 * 60 * 24))
if (diffMins < 1) if (diffMins < 1)
return I18n.tr("Last launched just now") return I18n.tr("Last launched just now");
if (diffMins < 60) if (diffMins < 60)
return I18n.tr("Last launched %1 minute%2 ago") return I18n.tr("Last launched %1 minute%2 ago").arg(diffMins).arg(diffMins === 1 ? "" : "s");
.arg(diffMins)
.arg(diffMins === 1 ? "" : "s")
if (diffHours < 24) if (diffHours < 24)
return I18n.tr("Last launched %1 hour%2 ago") return I18n.tr("Last launched %1 hour%2 ago").arg(diffHours).arg(diffHours === 1 ? "" : "s");
.arg(diffHours)
.arg(diffHours === 1 ? "" : "s")
if (diffDays < 7) if (diffDays < 7)
return I18n.tr("Last launched %1 day%2 ago") return I18n.tr("Last launched %1 day%2 ago").arg(diffDays).arg(diffDays === 1 ? "" : "s");
.arg(diffDays)
.arg(diffDays === 1 ? "" : "s")
return I18n.tr("Last launched %1") return I18n.tr("Last launched %1").arg(date.toLocaleDateString());
.arg(date.toLocaleDateString())
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
@@ -858,13 +836,10 @@ Item {
iconSize: 16 iconSize: 16
iconColor: Theme.error iconColor: Theme.error
onClicked: { onClicked: {
var currentRanking = Object.assign( var currentRanking = Object.assign({}, AppUsageHistoryData.appUsageRanking || {});
{}, delete currentRanking[modelData.id];
AppUsageHistoryData.appUsageRanking AppUsageHistoryData.appUsageRanking = currentRanking;
|| {}) AppUsageHistoryData.saveSettings();
delete currentRanking[modelData.id]
AppUsageHistoryData.appUsageRanking = currentRanking
AppUsageHistoryData.saveSettings()
} }
} }
} }
@@ -872,8 +847,7 @@ Item {
StyledText { StyledText {
width: parent.width width: parent.width
text: recentlyUsedSection.rankedAppsModel.length text: recentlyUsedSection.rankedAppsModel.length === 0 ? "No apps have been launched yet." : ""
=== 0 ? "No apps have been launched yet." : ""
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter

View File

@@ -66,13 +66,14 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
// Wallpaper Section // Wallpaper Section

View File

@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import qs.Common import qs.Common
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -15,10 +14,10 @@ StyledRect {
property string pluginId: pluginData ? pluginData.id : "" property string pluginId: pluginData ? pluginData.id : ""
property string pluginDirectoryName: { property string pluginDirectoryName: {
if (pluginData && pluginData.pluginDirectory) { if (pluginData && pluginData.pluginDirectory) {
var path = pluginData.pluginDirectory var path = pluginData.pluginDirectory;
return path.substring(path.lastIndexOf('/') + 1) return path.substring(path.lastIndexOf('/') + 1);
} }
return pluginId return pluginId;
} }
property string pluginName: pluginData ? (pluginData.name || pluginData.id) : "" property string pluginName: pluginData ? (pluginData.name || pluginData.id) : ""
property string pluginVersion: pluginData ? (pluginData.version || "1.0.0") : "" property string pluginVersion: pluginData ? (pluginData.version || "1.0.0") : ""
@@ -44,7 +43,7 @@ StyledRect {
cursorShape: root.hasSettings ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: root.hasSettings ? Qt.PointingHandCursor : Qt.ArrowCursor
enabled: root.hasSettings enabled: root.hasSettings
onClicked: { onClicked: {
root.expandedPluginId = root.expandedPluginId === root.pluginId ? "" : root.pluginId root.expandedPluginId = root.expandedPluginId === root.pluginId ? "" : root.pluginId;
} }
} }
@@ -127,32 +126,32 @@ StyledRect {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
const currentPluginName = root.pluginName const currentPluginName = root.pluginName;
const currentPluginId = root.pluginId const currentPluginId = root.pluginId;
DMSService.update(currentPluginName, response => { DMSService.update(currentPluginName, response => {
if (response.error) { if (response.error) {
ToastService.showError("Update failed: " + response.error) ToastService.showError("Update failed: " + response.error);
} else { } else {
ToastService.showInfo("Plugin updated: " + currentPluginName) ToastService.showInfo("Plugin updated: " + currentPluginName);
PluginService.forceRescanPlugin(currentPluginId) PluginService.forceRescanPlugin(currentPluginId);
if (DMSService.apiVersion >= 8) { if (DMSService.apiVersion >= 8) {
DMSService.listInstalled() DMSService.listInstalled();
} }
} }
}) });
} }
onEntered: { onEntered: {
tooltipLoader.active = true tooltipLoader.active = true;
if (tooltipLoader.item) { if (tooltipLoader.item) {
const p = mapToItem(null, width / 2, 0) const p = mapToItem(null, width / 2, 0);
tooltipLoader.item.show(I18n.tr("Update Plugin"), p.x, p.y - 40, null) tooltipLoader.item.show(I18n.tr("Update Plugin"), p.x, p.y - 40, null);
} }
} }
onExited: { onExited: {
if (tooltipLoader.item) { if (tooltipLoader.item) {
tooltipLoader.item.hide() tooltipLoader.item.hide();
} }
tooltipLoader.active = false tooltipLoader.active = false;
} }
} }
} }
@@ -177,31 +176,31 @@ StyledRect {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
const currentPluginName = root.pluginName const currentPluginName = root.pluginName;
DMSService.uninstall(currentPluginName, response => { DMSService.uninstall(currentPluginName, response => {
if (response.error) { if (response.error) {
ToastService.showError("Uninstall failed: " + response.error) ToastService.showError("Uninstall failed: " + response.error);
} else { } else {
ToastService.showInfo("Plugin uninstalled: " + currentPluginName) ToastService.showInfo("Plugin uninstalled: " + currentPluginName);
PluginService.scanPlugins() PluginService.scanPlugins();
if (root.isExpanded) { if (root.isExpanded) {
root.expandedPluginId = "" root.expandedPluginId = "";
} }
} }
}) });
} }
onEntered: { onEntered: {
tooltipLoader.active = true tooltipLoader.active = true;
if (tooltipLoader.item) { if (tooltipLoader.item) {
const p = mapToItem(null, width / 2, 0) const p = mapToItem(null, width / 2, 0);
tooltipLoader.item.show(I18n.tr("Uninstall Plugin"), p.x, p.y - 40, null) tooltipLoader.item.show(I18n.tr("Uninstall Plugin"), p.x, p.y - 40, null);
} }
} }
onExited: { onExited: {
if (tooltipLoader.item) { if (tooltipLoader.item) {
tooltipLoader.item.hide() tooltipLoader.item.hide();
} }
tooltipLoader.active = false tooltipLoader.active = false;
} }
} }
} }
@@ -226,28 +225,28 @@ StyledRect {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
const currentPluginId = root.pluginId const currentPluginId = root.pluginId;
const currentPluginName = root.pluginName const currentPluginName = root.pluginName;
root.isReloading = true root.isReloading = true;
if (PluginService.reloadPlugin(currentPluginId)) { if (PluginService.reloadPlugin(currentPluginId)) {
ToastService.showInfo("Plugin reloaded: " + currentPluginName) ToastService.showInfo("Plugin reloaded: " + currentPluginName);
} else { } else {
ToastService.showError("Failed to reload plugin: " + currentPluginName) ToastService.showError("Failed to reload plugin: " + currentPluginName);
root.isReloading = false root.isReloading = false;
} }
} }
onEntered: { onEntered: {
tooltipLoader.active = true tooltipLoader.active = true;
if (tooltipLoader.item) { if (tooltipLoader.item) {
const p = mapToItem(null, width / 2, 0) const p = mapToItem(null, width / 2, 0);
tooltipLoader.item.show(I18n.tr("Reload Plugin"), p.x, p.y - 40, null) tooltipLoader.item.show(I18n.tr("Reload Plugin"), p.x, p.y - 40, null);
} }
} }
onExited: { onExited: {
if (tooltipLoader.item) { if (tooltipLoader.item) {
tooltipLoader.item.hide() tooltipLoader.item.hide();
} }
tooltipLoader.active = false tooltipLoader.active = false;
} }
} }
} }
@@ -257,25 +256,25 @@ StyledRect {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: PluginService.isPluginLoaded(root.pluginId) checked: PluginService.isPluginLoaded(root.pluginId)
onToggled: isChecked => { onToggled: isChecked => {
const currentPluginId = root.pluginId const currentPluginId = root.pluginId;
const currentPluginName = root.pluginName const currentPluginName = root.pluginName;
if (isChecked) { if (isChecked) {
if (PluginService.enablePlugin(currentPluginId)) { if (PluginService.enablePlugin(currentPluginId)) {
ToastService.showInfo("Plugin enabled: " + currentPluginName) ToastService.showInfo("Plugin enabled: " + currentPluginName);
} else { } else {
ToastService.showError("Failed to enable plugin: " + currentPluginName) ToastService.showError("Failed to enable plugin: " + currentPluginName);
checked = false checked = false;
} }
} else { } else {
if (PluginService.disablePlugin(currentPluginId)) { if (PluginService.disablePlugin(currentPluginId)) {
ToastService.showInfo("Plugin disabled: " + currentPluginName) ToastService.showInfo("Plugin disabled: " + currentPluginName);
if (root.isExpanded) { if (root.isExpanded) {
root.expandedPluginId = "" root.expandedPluginId = "";
} }
} else { } else {
ToastService.showError("Failed to disable plugin: " + currentPluginName) ToastService.showError("Failed to disable plugin: " + currentPluginName);
checked = true checked = true;
} }
} }
} }
@@ -330,7 +329,7 @@ StyledRect {
focus: root.isExpanded && root.hasSettings focus: root.isExpanded && root.hasSettings
Keys.onPressed: event => { Keys.onPressed: event => {
event.accepted = true event.accepted = true;
} }
Rectangle { Rectangle {
@@ -350,38 +349,34 @@ StyledRect {
source: { source: {
if (active && root.pluginSettingsPath) { if (active && root.pluginSettingsPath) {
var path = root.pluginSettingsPath var path = root.pluginSettingsPath;
if (!path.startsWith("file://")) { if (!path.startsWith("file://")) {
path = "file://" + path path = "file://" + path;
} }
return path return path;
} }
return "" return "";
} }
onLoaded: { onLoaded: {
if (item && typeof PluginService !== "undefined") { if (item && typeof PluginService !== "undefined") {
item.pluginService = PluginService item.pluginService = PluginService;
} }
if (item && typeof PopoutService !== "undefined" && "popoutService" in item) { if (item && typeof PopoutService !== "undefined" && "popoutService" in item) {
item.popoutService = PopoutService item.popoutService = PopoutService;
} }
if (item) { if (item) {
Qt.callLater(() => { Qt.callLater(() => {
settingsContainer.focus = true settingsContainer.focus = true;
item.forceActiveFocus() item.forceActiveFocus();
}) });
} }
} }
} }
StyledText { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: !PluginService.isPluginLoaded(root.pluginId) ? text: !PluginService.isPluginLoaded(root.pluginId) ? "Enable plugin to access settings" : (settingsLoader.status === Loader.Error ? "Failed to load settings" : "No configurable settings")
"Enable plugin to access settings" :
(settingsLoader.status === Loader.Error ?
"Failed to load settings" :
"No configurable settings")
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
visible: root.isExpanded && (!settingsLoader.active || settingsLoader.status === Loader.Error) visible: root.isExpanded && (!settingsLoader.active || settingsLoader.status === Loader.Error)

View File

@@ -1,8 +1,5 @@
import QtQuick import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import qs.Common import qs.Common
import qs.Modals.Common
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -20,13 +17,14 @@ FocusScope {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
StyledRect { StyledRect {
@@ -126,7 +124,7 @@ FocusScope {
iconName: "store" iconName: "store"
enabled: DMSService.dmsAvailable enabled: DMSService.dmsAvailable
onClicked: { onClicked: {
pluginBrowserModal.show() pluginBrowserModal.show();
} }
} }
@@ -134,12 +132,12 @@ FocusScope {
text: I18n.tr("Scan") text: I18n.tr("Scan")
iconName: "refresh" iconName: "refresh"
onClicked: { onClicked: {
pluginsTab.isRefreshingPlugins = true pluginsTab.isRefreshingPlugins = true;
PluginService.scanPlugins() PluginService.scanPlugins();
if (DMSService.dmsAvailable) { if (DMSService.dmsAvailable) {
DMSService.listInstalled() DMSService.listInstalled();
} }
pluginsTab.refreshPluginList() pluginsTab.refreshPluginList();
} }
} }
@@ -147,8 +145,8 @@ FocusScope {
text: I18n.tr("Create Dir") text: I18n.tr("Create Dir")
iconName: "create_new_folder" iconName: "create_new_folder"
onClicked: { onClicked: {
PluginService.createPluginDirectory() PluginService.createPluginDirectory();
ToastService.showInfo("Created plugin directory: " + PluginService.pluginDirectory) ToastService.showInfo("Created plugin directory: " + PluginService.pluginDirectory);
} }
} }
} }
@@ -226,15 +224,16 @@ FocusScope {
pluginData: modelData pluginData: modelData
expandedPluginId: pluginsTab.expandedPluginId expandedPluginId: pluginsTab.expandedPluginId
hasUpdate: { hasUpdate: {
if (DMSService.apiVersion < 8) return false if (DMSService.apiVersion < 8)
return pluginsTab.installedPluginsData[pluginId] || pluginsTab.installedPluginsData[pluginName] || false return false;
return pluginsTab.installedPluginsData[pluginId] || pluginsTab.installedPluginsData[pluginName] || false;
} }
isReloading: pluginsTab.isReloading isReloading: pluginsTab.isReloading
onExpandedPluginIdChanged: { onExpandedPluginIdChanged: {
pluginsTab.expandedPluginId = expandedPluginId pluginsTab.expandedPluginId = expandedPluginId;
} }
onIsReloadingChanged: { onIsReloadingChanged: {
pluginsTab.isReloading = isReloading pluginsTab.isReloading = isReloading;
} }
} }
} }
@@ -255,69 +254,69 @@ FocusScope {
function refreshPluginList() { function refreshPluginList() {
Qt.callLater(() => { Qt.callLater(() => {
var plugins = PluginService.getAvailablePlugins() var plugins = PluginService.getAvailablePlugins();
pluginRepeater.model = null pluginRepeater.model = null;
pluginRepeater.model = plugins pluginRepeater.model = plugins;
pluginsTab.isRefreshingPlugins = false pluginsTab.isRefreshingPlugins = false;
}) });
} }
Connections { Connections {
target: PluginService target: PluginService
function onPluginLoaded() { function onPluginLoaded() {
refreshPluginList() refreshPluginList();
if (isReloading) { if (isReloading) {
isReloading = false isReloading = false;
} }
} }
function onPluginUnloaded() { function onPluginUnloaded() {
refreshPluginList() refreshPluginList();
if (!isReloading && pluginsTab.expandedPluginId !== "" && !PluginService.isPluginLoaded(pluginsTab.expandedPluginId)) { if (!isReloading && pluginsTab.expandedPluginId !== "" && !PluginService.isPluginLoaded(pluginsTab.expandedPluginId)) {
pluginsTab.expandedPluginId = "" pluginsTab.expandedPluginId = "";
} }
} }
function onPluginListUpdated() { function onPluginListUpdated() {
if (DMSService.apiVersion >= 8) { if (DMSService.apiVersion >= 8) {
DMSService.listInstalled() DMSService.listInstalled();
} }
refreshPluginList() refreshPluginList();
} }
} }
Connections { Connections {
target: DMSService target: DMSService
function onPluginsListReceived(plugins) { function onPluginsListReceived(plugins) {
pluginBrowserModal.isLoading = false pluginBrowserModal.isLoading = false;
pluginBrowserModal.allPlugins = plugins pluginBrowserModal.allPlugins = plugins;
pluginBrowserModal.updateFilteredPlugins() pluginBrowserModal.updateFilteredPlugins();
} }
function onInstalledPluginsReceived(plugins) { function onInstalledPluginsReceived(plugins) {
var pluginMap = {} var pluginMap = {};
for (var i = 0; i < plugins.length; i++) { for (var i = 0; i < plugins.length; i++) {
var plugin = plugins[i] var plugin = plugins[i];
var hasUpdate = plugin.hasUpdate || false var hasUpdate = plugin.hasUpdate || false;
if (plugin.id) { if (plugin.id) {
pluginMap[plugin.id] = hasUpdate pluginMap[plugin.id] = hasUpdate;
} }
if (plugin.name) { if (plugin.name) {
pluginMap[plugin.name] = hasUpdate pluginMap[plugin.name] = hasUpdate;
} }
} }
installedPluginsData = pluginMap installedPluginsData = pluginMap;
Qt.callLater(refreshPluginList) Qt.callLater(refreshPluginList);
} }
function onOperationSuccess(message) { function onOperationSuccess(message) {
ToastService.showInfo(message) ToastService.showInfo(message);
} }
function onOperationError(error) { function onOperationError(error) {
ToastService.showError(error) ToastService.showError(error);
} }
} }
Component.onCompleted: { Component.onCompleted: {
pluginBrowserModal.parentModal = pluginsTab.parentModal pluginBrowserModal.parentModal = pluginsTab.parentModal;
if (DMSService.dmsAvailable && DMSService.apiVersion >= 8) { if (DMSService.dmsAvailable && DMSService.apiVersion >= 8) {
DMSService.listInstalled() DMSService.listInstalled();
} }
} }

View File

@@ -16,7 +16,7 @@ Column {
spacing: expanded ? Theme.spacingM : 0 spacing: expanded ? Theme.spacingM : 0
Component.onCompleted: { Component.onCompleted: {
if (!collapsible) if (!collapsible)
expanded = true expanded = true;
} }
MouseArea { MouseArea {
@@ -26,15 +26,12 @@ Column {
hoverEnabled: collapsible hoverEnabled: collapsible
onClicked: { onClicked: {
if (collapsible) if (collapsible)
expanded = !expanded expanded = !expanded;
} }
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: parent.containsMouse ? Qt.rgba(Theme.primary.r, color: parent.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : "transparent"
Theme.primary.g,
Theme.primary.b,
0.08) : "transparent"
radius: Theme.radiusS radius: Theme.radiusS
} }

View File

@@ -59,13 +59,14 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
// Theme Color // Theme Color

View File

@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import QtQuick.Effects import QtQuick.Effects
import QtQuick.Layouts import QtQuick.Layouts
import qs.Common import qs.Common
@@ -12,13 +11,14 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
StyledRect { StyledRect {
@@ -26,8 +26,7 @@ Item {
height: timeSection.implicitHeight + Theme.spacingL * 2 height: timeSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -49,8 +48,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - toggle.width - Theme.spacingM
- toggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -76,9 +74,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.use24HourClock checked: SettingsData.use24HourClock
onToggled: checked => { onToggled: checked => {
return SettingsData.set("use24HourClock", return SettingsData.set("use24HourClock", checked);
checked) }
}
} }
} }
} }
@@ -89,8 +86,7 @@ Item {
height: timeSection.implicitHeight + Theme.spacingL * 2 height: timeSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -112,8 +108,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - toggle.width - Theme.spacingM
- toggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -139,9 +134,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.showSeconds checked: SettingsData.showSeconds
onToggled: checked => { onToggled: checked => {
return SettingsData.set("showSeconds", return SettingsData.set("showSeconds", checked);
checked) }
}
} }
} }
} }
@@ -152,8 +146,7 @@ Item {
height: dateSection.implicitHeight + Theme.spacingL * 2 height: dateSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -189,60 +182,67 @@ Item {
description: "Preview: " + (SettingsData.clockDateFormat ? new Date().toLocaleDateString(Qt.locale(), SettingsData.clockDateFormat) : new Date().toLocaleDateString(Qt.locale(), "ddd d")) description: "Preview: " + (SettingsData.clockDateFormat ? new Date().toLocaleDateString(Qt.locale(), SettingsData.clockDateFormat) : new Date().toLocaleDateString(Qt.locale(), "ddd d"))
currentValue: { currentValue: {
if (!SettingsData.clockDateFormat || SettingsData.clockDateFormat.length === 0) { if (!SettingsData.clockDateFormat || SettingsData.clockDateFormat.length === 0) {
return "System Default" return "System Default";
} }
const presets = [{ const presets = [
"format": "ddd d", {
"label": "Day Date" "format": "ddd d",
}, { "label": "Day Date"
"format": "ddd MMM d", },
"label": "Day Month Date" {
}, { "format": "ddd MMM d",
"format": "MMM d", "label": "Day Month Date"
"label": "Month Date" },
}, { {
"format": "M/d", "format": "MMM d",
"label": "Numeric (M/D)" "label": "Month Date"
}, { },
"format": "d/M", {
"label": "Numeric (D/M)" "format": "M/d",
}, { "label": "Numeric (M/D)"
"format": "ddd d MMM yyyy", },
"label": "Full with Year" {
}, { "format": "d/M",
"format": "yyyy-MM-dd", "label": "Numeric (D/M)"
"label": "ISO Date" },
}, { {
"format": "dddd, MMMM d", "format": "ddd d MMM yyyy",
"label": "Full Day & Month" "label": "Full with Year"
}] },
{
"format": "yyyy-MM-dd",
"label": "ISO Date"
},
{
"format": "dddd, MMMM d",
"label": "Full Day & Month"
}
];
const match = presets.find(p => { const match = presets.find(p => {
return p.format return p.format === SettingsData.clockDateFormat;
=== SettingsData.clockDateFormat });
}) return match ? match.label : I18n.tr("Custom: ") + SettingsData.clockDateFormat;
return match ? match.label: I18n.tr("Custom: ") + SettingsData.clockDateFormat
} }
options: ["System Default", "Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."] options: ["System Default", "Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
onValueChanged: value => { onValueChanged: value => {
const formatMap = { const formatMap = {
"System Default": "", "System Default": "",
"Day Date": "ddd d", "Day Date": "ddd d",
"Day Month Date": "ddd MMM d", "Day Month Date": "ddd MMM d",
"Month Date": "MMM d", "Month Date": "MMM d",
"Numeric (M/D)": "M/d", "Numeric (M/D)": "M/d",
"Numeric (D/M)": "d/M", "Numeric (D/M)": "d/M",
"Full with Year": "ddd d MMM yyyy", "Full with Year": "ddd d MMM yyyy",
"ISO Date": "yyyy-MM-dd", "ISO Date": "yyyy-MM-dd",
"Full Day & Month": "dddd, MMMM d" "Full Day & Month": "dddd, MMMM d"
} };
if (value === "Custom...") { if (value === "Custom...") {
customFormatInput.visible = true customFormatInput.visible = true;
} else { } else {
customFormatInput.visible = false customFormatInput.visible = false;
SettingsData.set("clockDateFormat", SettingsData.set("clockDateFormat", formatMap[value]);
formatMap[value]) }
} }
}
} }
DankDropdown { DankDropdown {
@@ -251,60 +251,67 @@ Item {
description: "Preview: " + (SettingsData.lockDateFormat ? new Date().toLocaleDateString(Qt.locale(), SettingsData.lockDateFormat) : new Date().toLocaleDateString(Qt.locale(), Locale.LongFormat)) description: "Preview: " + (SettingsData.lockDateFormat ? new Date().toLocaleDateString(Qt.locale(), SettingsData.lockDateFormat) : new Date().toLocaleDateString(Qt.locale(), Locale.LongFormat))
currentValue: { currentValue: {
if (!SettingsData.lockDateFormat || SettingsData.lockDateFormat.length === 0) { if (!SettingsData.lockDateFormat || SettingsData.lockDateFormat.length === 0) {
return "System Default" return "System Default";
} }
const presets = [{ const presets = [
"format": "ddd d", {
"label": "Day Date" "format": "ddd d",
}, { "label": "Day Date"
"format": "ddd MMM d", },
"label": "Day Month Date" {
}, { "format": "ddd MMM d",
"format": "MMM d", "label": "Day Month Date"
"label": "Month Date" },
}, { {
"format": "M/d", "format": "MMM d",
"label": "Numeric (M/D)" "label": "Month Date"
}, { },
"format": "d/M", {
"label": "Numeric (D/M)" "format": "M/d",
}, { "label": "Numeric (M/D)"
"format": "ddd d MMM yyyy", },
"label": "Full with Year" {
}, { "format": "d/M",
"format": "yyyy-MM-dd", "label": "Numeric (D/M)"
"label": "ISO Date" },
}, { {
"format": "dddd, MMMM d", "format": "ddd d MMM yyyy",
"label": "Full Day & Month" "label": "Full with Year"
}] },
{
"format": "yyyy-MM-dd",
"label": "ISO Date"
},
{
"format": "dddd, MMMM d",
"label": "Full Day & Month"
}
];
const match = presets.find(p => { const match = presets.find(p => {
return p.format return p.format === SettingsData.lockDateFormat;
=== SettingsData.lockDateFormat });
}) return match ? match.label : I18n.tr("Custom: ") + SettingsData.lockDateFormat;
return match ? match.label: I18n.tr("Custom: ") + SettingsData.lockDateFormat
} }
options: ["System Default", "Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."] options: ["System Default", "Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
onValueChanged: value => { onValueChanged: value => {
const formatMap = { const formatMap = {
"System Default": "", "System Default": "",
"Day Date": "ddd d", "Day Date": "ddd d",
"Day Month Date": "ddd MMM d", "Day Month Date": "ddd MMM d",
"Month Date": "MMM d", "Month Date": "MMM d",
"Numeric (M/D)": "M/d", "Numeric (M/D)": "M/d",
"Numeric (D/M)": "d/M", "Numeric (D/M)": "d/M",
"Full with Year": "ddd d MMM yyyy", "Full with Year": "ddd d MMM yyyy",
"ISO Date": "yyyy-MM-dd", "ISO Date": "yyyy-MM-dd",
"Full Day & Month": "dddd, MMMM d" "Full Day & Month": "dddd, MMMM d"
} };
if (value === "Custom...") { if (value === "Custom...") {
customLockFormatInput.visible = true customLockFormatInput.visible = true;
} else { } else {
customLockFormatInput.visible = false customLockFormatInput.visible = false;
SettingsData.set("lockDateFormat", SettingsData.set("lockDateFormat", formatMap[value]);
formatMap[value]) }
} }
}
} }
DankTextField { DankTextField {
@@ -316,7 +323,7 @@ Item {
text: SettingsData.clockDateFormat text: SettingsData.clockDateFormat
onTextChanged: { onTextChanged: {
if (visible && text) if (visible && text)
SettingsData.set("clockDateFormat", text) SettingsData.set("clockDateFormat", text);
} }
} }
@@ -329,7 +336,7 @@ Item {
text: SettingsData.lockDateFormat text: SettingsData.lockDateFormat
onTextChanged: { onTextChanged: {
if (visible && text) if (visible && text)
SettingsData.set("lockDateFormat", text) SettingsData.set("lockDateFormat", text);
} }
} }
@@ -338,8 +345,7 @@ Item {
height: formatHelp.implicitHeight + Theme.spacingM * 2 height: formatHelp.implicitHeight + Theme.spacingM * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
Theme.outline.b, 0.1)
border.width: 0 border.width: 0
Column { Column {
@@ -440,8 +446,7 @@ Item {
height: enableWeatherSection.implicitHeight + Theme.spacingL * 2 height: enableWeatherSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -463,8 +468,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - enableToggle.width - Theme.spacingM
- enableToggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -490,9 +494,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.weatherEnabled checked: SettingsData.weatherEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.set("weatherEnabled", return SettingsData.set("weatherEnabled", checked);
checked) }
}
} }
} }
} }
@@ -503,8 +506,7 @@ Item {
height: temperatureSection.implicitHeight + Theme.spacingL * 2 height: temperatureSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
visible: SettingsData.weatherEnabled visible: SettingsData.weatherEnabled
opacity: visible ? 1 : 0 opacity: visible ? 1 : 0
@@ -528,8 +530,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - temperatureToggle.width - Theme.spacingM
- temperatureToggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -555,9 +556,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.useFahrenheit checked: SettingsData.useFahrenheit
onToggled: checked => { onToggled: checked => {
return SettingsData.set("useFahrenheit", return SettingsData.set("useFahrenheit", checked);
checked) }
}
} }
} }
} }
@@ -575,8 +575,7 @@ Item {
height: locationSection.implicitHeight + Theme.spacingL * 2 height: locationSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
visible: SettingsData.weatherEnabled visible: SettingsData.weatherEnabled
opacity: visible ? 1 : 0 opacity: visible ? 1 : 0
@@ -600,8 +599,7 @@ Item {
} }
Column { Column {
width: parent.width - Theme.iconSize - Theme.spacingM width: parent.width - Theme.iconSize - Theme.spacingM - autoLocationToggle.width - Theme.spacingM
- autoLocationToggle.width - Theme.spacingM
spacing: Theme.spacingXS spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -627,9 +625,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.useAutoLocation checked: SettingsData.useAutoLocation
onToggled: checked => { onToggled: checked => {
return SettingsData.set("useAutoLocation", return SettingsData.set("useAutoLocation", checked);
checked) }
}
} }
} }
@@ -653,113 +650,113 @@ Item {
} }
Row { Row {
width: parent.width width: parent.width
spacing: Theme.spacingM spacing: Theme.spacingM
Column { Column {
width: (parent.width - Theme.spacingM) / 2 width: (parent.width - Theme.spacingM) / 2
spacing: Theme.spacingXS spacing: Theme.spacingXS
StyledText { StyledText {
text: I18n.tr("Latitude") text: I18n.tr("Latitude")
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
}
DankTextField {
id: latitudeInput
width: parent.width
height: 48
placeholderText: "40.7128"
backgroundColor: Theme.surfaceVariant
normalBorderColor: Theme.primarySelected
focusedBorderColor: Theme.primary
keyNavigationTab: longitudeInput
Component.onCompleted: {
if (SettingsData.weatherCoordinates) {
const coords = SettingsData.weatherCoordinates.split(',')
if (coords.length > 0) {
text = coords[0].trim()
}
}
}
Connections {
target: SettingsData
function onWeatherCoordinatesChanged() {
if (SettingsData.weatherCoordinates) {
const coords = SettingsData.weatherCoordinates.split(',')
if (coords.length > 0) {
latitudeInput.text = coords[0].trim()
}
}
}
}
onTextEdited: {
if (text && longitudeInput.text) {
const coords = text + "," + longitudeInput.text
SettingsData.weatherCoordinates = coords
SettingsData.saveSettings()
}
}
}
} }
Column { DankTextField {
width: (parent.width - Theme.spacingM) / 2 id: latitudeInput
spacing: Theme.spacingXS width: parent.width
height: 48
placeholderText: "40.7128"
backgroundColor: Theme.surfaceVariant
normalBorderColor: Theme.primarySelected
focusedBorderColor: Theme.primary
keyNavigationTab: longitudeInput
StyledText { Component.onCompleted: {
text: I18n.tr("Longitude") if (SettingsData.weatherCoordinates) {
font.pixelSize: Theme.fontSizeSmall const coords = SettingsData.weatherCoordinates.split(',');
color: Theme.surfaceVariantText if (coords.length > 0) {
text = coords[0].trim();
}
}
} }
DankTextField { Connections {
id: longitudeInput target: SettingsData
width: parent.width function onWeatherCoordinatesChanged() {
height: 48
placeholderText: "-74.0060"
backgroundColor: Theme.surfaceVariant
normalBorderColor: Theme.primarySelected
focusedBorderColor: Theme.primary
keyNavigationTab: locationSearchInput
keyNavigationBacktab: latitudeInput
Component.onCompleted: {
if (SettingsData.weatherCoordinates) { if (SettingsData.weatherCoordinates) {
const coords = SettingsData.weatherCoordinates.split(',') const coords = SettingsData.weatherCoordinates.split(',');
if (coords.length > 1) { if (coords.length > 0) {
text = coords[1].trim() latitudeInput.text = coords[0].trim();
} }
} }
} }
}
Connections { onTextEdited: {
target: SettingsData if (text && longitudeInput.text) {
function onWeatherCoordinatesChanged() { const coords = text + "," + longitudeInput.text;
if (SettingsData.weatherCoordinates) { SettingsData.weatherCoordinates = coords;
const coords = SettingsData.weatherCoordinates.split(',') SettingsData.saveSettings();
if (coords.length > 1) {
longitudeInput.text = coords[1].trim()
}
}
}
}
onTextEdited: {
if (text && latitudeInput.text) {
const coords = latitudeInput.text + "," + text
SettingsData.weatherCoordinates = coords
SettingsData.saveSettings()
}
} }
} }
} }
} }
Column {
width: (parent.width - Theme.spacingM) / 2
spacing: Theme.spacingXS
StyledText {
text: I18n.tr("Longitude")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
DankTextField {
id: longitudeInput
width: parent.width
height: 48
placeholderText: "-74.0060"
backgroundColor: Theme.surfaceVariant
normalBorderColor: Theme.primarySelected
focusedBorderColor: Theme.primary
keyNavigationTab: locationSearchInput
keyNavigationBacktab: latitudeInput
Component.onCompleted: {
if (SettingsData.weatherCoordinates) {
const coords = SettingsData.weatherCoordinates.split(',');
if (coords.length > 1) {
text = coords[1].trim();
}
}
}
Connections {
target: SettingsData
function onWeatherCoordinatesChanged() {
if (SettingsData.weatherCoordinates) {
const coords = SettingsData.weatherCoordinates.split(',');
if (coords.length > 1) {
longitudeInput.text = coords[1].trim();
}
}
}
}
onTextEdited: {
if (text && latitudeInput.text) {
const coords = latitudeInput.text + "," + text;
SettingsData.weatherCoordinates = coords;
SettingsData.saveSettings();
}
}
}
}
}
Column { Column {
width: parent.width width: parent.width
spacing: Theme.spacingXS spacing: Theme.spacingXS
@@ -778,14 +775,14 @@ Item {
placeholderText: I18n.tr("New York, NY") placeholderText: I18n.tr("New York, NY")
keyNavigationBacktab: longitudeInput keyNavigationBacktab: longitudeInput
onLocationSelected: (displayName, coordinates) => { onLocationSelected: (displayName, coordinates) => {
SettingsData.setWeatherLocation(displayName, coordinates) SettingsData.setWeatherLocation(displayName, coordinates);
const coords = coordinates.split(',') const coords = coordinates.split(',');
if (coords.length >= 2) { if (coords.length >= 2) {
latitudeInput.text = coords[0].trim() latitudeInput.text = coords[0].trim();
longitudeInput.text = coords[1].trim() longitudeInput.text = coords[1].trim();
} }
} }
} }
} }
} }
@@ -804,8 +801,7 @@ Item {
height: weatherDisplaySection.implicitHeight + Theme.spacingL * 2 height: weatherDisplaySection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
visible: SettingsData.weatherEnabled visible: SettingsData.weatherEnabled
opacity: visible ? 1 : 0 opacity: visible ? 1 : 0
@@ -882,9 +878,9 @@ Item {
hoverEnabled: true hoverEnabled: true
cursorShape: parent.enabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor cursorShape: parent.enabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
onClicked: { onClicked: {
refreshButton.isRefreshing = true refreshButton.isRefreshing = true;
WeatherService.forceRefresh() WeatherService.forceRefresh();
refreshTimer.restart() refreshTimer.restart();
} }
enabled: parent.enabled enabled: parent.enabled
} }
@@ -965,7 +961,7 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (WeatherService.weather.available) { if (WeatherService.weather.available) {
SettingsData.set("useFahrenheit", !SettingsData.useFahrenheit) SettingsData.set("useFahrenheit", !SettingsData.useFahrenheit);
} }
} }
enabled: WeatherService.weather.available enabled: WeatherService.weather.available
@@ -1185,14 +1181,16 @@ Item {
StyledText { StyledText {
text: { text: {
if (!WeatherService.weather.wind) return "--" if (!WeatherService.weather.wind)
const windKmh = parseFloat(WeatherService.weather.wind) return "--";
if (isNaN(windKmh)) return WeatherService.weather.wind const windKmh = parseFloat(WeatherService.weather.wind);
if (isNaN(windKmh))
return WeatherService.weather.wind;
if (SettingsData.useFahrenheit) { if (SettingsData.useFahrenheit) {
const windMph = Math.round(windKmh * 0.621371) const windMph = Math.round(windKmh * 0.621371);
return windMph + " mph" return windMph + " mph";
} }
return WeatherService.weather.wind return WeatherService.weather.wind;
} }
font.pixelSize: Theme.fontSizeSmall + 1 font.pixelSize: Theme.fontSizeSmall + 1
color: Theme.surfaceText color: Theme.surfaceText
@@ -1241,13 +1239,14 @@ Item {
StyledText { StyledText {
text: { text: {
if (!WeatherService.weather.pressure) return "--" if (!WeatherService.weather.pressure)
const pressureHpa = WeatherService.weather.pressure return "--";
const pressureHpa = WeatherService.weather.pressure;
if (SettingsData.useFahrenheit) { if (SettingsData.useFahrenheit) {
const pressureInHg = (pressureHpa * 0.02953).toFixed(2) const pressureInHg = (pressureHpa * 0.02953).toFixed(2);
return pressureInHg + " inHg" return pressureInHg + " inHg";
} }
return pressureHpa + " hPa" return pressureHpa + " hPa";
} }
font.pixelSize: Theme.fontSizeSmall + 1 font.pixelSize: Theme.fontSizeSmall + 1
color: Theme.surfaceText color: Theme.surfaceText

View File

@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import qs.Common import qs.Common
import qs.Modals.Common import qs.Modals.Common
import qs.Widgets import qs.Widgets

View File

@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import qs.Common import qs.Common
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -10,12 +9,13 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height + Theme.spacingXL
contentWidth: width contentWidth: width
Column { Column {
id: mainColumn id: mainColumn
width: parent.width width: Math.min(550, parent.width - Theme.spacingL * 2)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingXL spacing: Theme.spacingXL
StyledRect { StyledRect {
@@ -23,8 +23,7 @@ Item {
height: workspaceSection.implicitHeight + Theme.spacingL * 2 height: workspaceSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -60,9 +59,8 @@ Item {
description: I18n.tr("Show workspace index numbers in the top bar workspace switcher") description: I18n.tr("Show workspace index numbers in the top bar workspace switcher")
checked: SettingsData.showWorkspaceIndex checked: SettingsData.showWorkspaceIndex
onToggled: checked => { onToggled: checked => {
return SettingsData.set("showWorkspaceIndex", return SettingsData.set("showWorkspaceIndex", checked);
checked) }
}
} }
DankToggle { DankToggle {
width: parent.width width: parent.width
@@ -70,9 +68,8 @@ Item {
description: I18n.tr("Always show a minimum of 3 workspaces, even if fewer are available") description: I18n.tr("Always show a minimum of 3 workspaces, even if fewer are available")
checked: SettingsData.showWorkspacePadding checked: SettingsData.showWorkspacePadding
onToggled: checked => { onToggled: checked => {
return SettingsData.set("showWorkspacePadding", return SettingsData.set("showWorkspacePadding", checked);
checked) }
}
} }
DankToggle { DankToggle {
@@ -82,12 +79,11 @@ Item {
checked: SettingsData.showWorkspaceApps checked: SettingsData.showWorkspaceApps
visible: CompositorService.isNiri || CompositorService.isHyprland visible: CompositorService.isNiri || CompositorService.isHyprland
onToggled: checked => { onToggled: checked => {
return SettingsData.set("showWorkspaceApps", return SettingsData.set("showWorkspaceApps", checked);
checked) }
}
} }
Row { Row {
width: parent.width - Theme.spacingL width: parent.width - Theme.spacingL
spacing: Theme.spacingL spacing: Theme.spacingL
visible: SettingsData.showWorkspaceApps visible: SettingsData.showWorkspaceApps
@@ -116,7 +112,7 @@ Item {
topPadding: Theme.spacingXS topPadding: Theme.spacingXS
bottomPadding: Theme.spacingXS bottomPadding: Theme.spacingXS
onEditingFinished: { onEditingFinished: {
SettingsData.set("maxWorkspaceIcons", parseInt(text, 10)) SettingsData.set("maxWorkspaceIcons", parseInt(text, 10));
} }
} }
} }
@@ -157,8 +153,7 @@ Item {
height: mediaSection.implicitHeight + Theme.spacingL * 2 height: mediaSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -290,8 +285,8 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onPressed: mouse => { onPressed: mouse => {
updaterCustomCommand.forceActiveFocus() updaterCustomCommand.forceActiveFocus();
mouse.accepted = false mouse.accepted = false;
} }
} }
} }
@@ -337,8 +332,8 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onPressed: mouse => { onPressed: mouse => {
updaterTerminalCustomClass.forceActiveFocus() updaterTerminalCustomClass.forceActiveFocus();
mouse.accepted = false mouse.accepted = false;
} }
} }
} }
@@ -352,8 +347,7 @@ Item {
height: runningAppsSection.implicitHeight + Theme.spacingL * 2 height: runningAppsSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
visible: CompositorService.isNiri || CompositorService.isHyprland visible: CompositorService.isNiri || CompositorService.isHyprland
@@ -390,9 +384,8 @@ Item {
description: I18n.tr("Show only apps running in current workspace") description: I18n.tr("Show only apps running in current workspace")
checked: SettingsData.runningAppsCurrentWorkspace checked: SettingsData.runningAppsCurrentWorkspace
onToggled: checked => { onToggled: checked => {
return SettingsData.set("runningAppsCurrentWorkspace", return SettingsData.set("runningAppsCurrentWorkspace", checked);
checked) }
}
} }
} }
} }
@@ -402,8 +395,7 @@ Item {
height: workspaceIconsSection.implicitHeight + Theme.spacingL * 2 height: workspaceIconsSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
visible: SettingsData.hasNamedWorkspaces() visible: SettingsData.hasNamedWorkspaces()
@@ -449,12 +441,8 @@ Item {
width: parent.width width: parent.width
height: workspaceIconRow.implicitHeight + Theme.spacingM height: workspaceIconRow.implicitHeight + Theme.spacingM
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.5)
Theme.surfaceContainer.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
Theme.surfaceContainer.b, 0.5)
border.color: Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.3)
border.width: 0 border.width: 0
Row { Row {
@@ -482,35 +470,28 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
Component.onCompleted: { Component.onCompleted: {
var iconData = SettingsData.getWorkspaceNameIcon( var iconData = SettingsData.getWorkspaceNameIcon(modelData);
modelData)
if (iconData) { if (iconData) {
setIcon(iconData.value, setIcon(iconData.value, iconData.type);
iconData.type)
} }
} }
onIconSelected: (iconName, iconType) => { onIconSelected: (iconName, iconType) => {
SettingsData.setWorkspaceNameIcon( SettingsData.setWorkspaceNameIcon(modelData, {
modelData, { "type": iconType,
"type": iconType, "value": iconName
"value": iconName });
}) setIcon(iconName, iconType);
setIcon(iconName, }
iconType)
}
Connections { Connections {
target: SettingsData target: SettingsData
function onWorkspaceIconsUpdated() { function onWorkspaceIconsUpdated() {
var iconData = SettingsData.getWorkspaceNameIcon( var iconData = SettingsData.getWorkspaceNameIcon(modelData);
modelData)
if (iconData) { if (iconData) {
iconPicker.setIcon( iconPicker.setIcon(iconData.value, iconData.type);
iconData.value,
iconData.type)
} else { } else {
iconPicker.setIcon("", "icon") iconPicker.setIcon("", "icon");
} }
} }
} }
@@ -539,8 +520,7 @@ Item {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
SettingsData.removeWorkspaceNameIcon( SettingsData.removeWorkspaceNameIcon(modelData);
modelData)
} }
} }
} }
@@ -560,8 +540,7 @@ Item {
height: notificationSection.implicitHeight + Theme.spacingL * 2 height: notificationSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -603,41 +582,41 @@ Item {
description: I18n.tr("Choose where notification popups appear on screen") description: I18n.tr("Choose where notification popups appear on screen")
currentValue: { currentValue: {
if (SettingsData.notificationPopupPosition === -1) { if (SettingsData.notificationPopupPosition === -1) {
return "Top Center" return "Top Center";
} }
switch (SettingsData.notificationPopupPosition) { switch (SettingsData.notificationPopupPosition) {
case SettingsData.Position.Top: case SettingsData.Position.Top:
return "Top Right" return "Top Right";
case SettingsData.Position.Bottom: case SettingsData.Position.Bottom:
return "Bottom Left" return "Bottom Left";
case SettingsData.Position.Left: case SettingsData.Position.Left:
return "Top Left" return "Top Left";
case SettingsData.Position.Right: case SettingsData.Position.Right:
return "Bottom Right" return "Bottom Right";
default: default:
return "Top Right" return "Top Right";
} }
} }
options: ["Top Right", "Top Left", "Top Center", "Bottom Right", "Bottom Left"] options: ["Top Right", "Top Left", "Top Center", "Bottom Right", "Bottom Left"]
onValueChanged: value => { onValueChanged: value => {
switch (value) { switch (value) {
case "Top Right": case "Top Right":
SettingsData.set("notificationPopupPosition", SettingsData.Position.Top) SettingsData.set("notificationPopupPosition", SettingsData.Position.Top);
break break;
case "Top Left": case "Top Left":
SettingsData.set("notificationPopupPosition", SettingsData.Position.Left) SettingsData.set("notificationPopupPosition", SettingsData.Position.Left);
break break;
case "Top Center": case "Top Center":
SettingsData.set("notificationPopupPosition", -1) SettingsData.set("notificationPopupPosition", -1);
break break;
case "Bottom Right": case "Bottom Right":
SettingsData.set("notificationPopupPosition", SettingsData.Position.Right) SettingsData.set("notificationPopupPosition", SettingsData.Position.Right);
break break;
case "Bottom Left": case "Bottom Left":
SettingsData.set("notificationPopupPosition", SettingsData.Position.Bottom) SettingsData.set("notificationPopupPosition", SettingsData.Position.Bottom);
break break;
} }
SettingsData.sendTestNotifications() SettingsData.sendTestNotifications();
} }
} }
} }
@@ -649,8 +628,7 @@ Item {
height: osdRow.implicitHeight + Theme.spacingL * 2 height: osdRow.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Row { Row {
@@ -694,8 +672,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.osdAlwaysShowValue checked: SettingsData.osdAlwaysShowValue
onToggleCompleted: checked => { onToggleCompleted: checked => {
SettingsData.set("osdAlwaysShowValue", checked) SettingsData.set("osdAlwaysShowValue", checked);
} }
} }
} }
} }
@@ -705,8 +683,7 @@ Item {
height: osdSection.implicitHeight + Theme.spacingL * 2 height: osdSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Theme.outline.b, 0.2)
border.width: 0 border.width: 0
Column { Column {
@@ -749,52 +726,52 @@ Item {
currentValue: { currentValue: {
switch (SettingsData.osdPosition) { switch (SettingsData.osdPosition) {
case SettingsData.Position.Top: case SettingsData.Position.Top:
return "Top Right" return "Top Right";
case SettingsData.Position.Left: case SettingsData.Position.Left:
return "Top Left" return "Top Left";
case SettingsData.Position.TopCenter: case SettingsData.Position.TopCenter:
return "Top Center" return "Top Center";
case SettingsData.Position.Right: case SettingsData.Position.Right:
return "Bottom Right" return "Bottom Right";
case SettingsData.Position.Bottom: case SettingsData.Position.Bottom:
return "Bottom Left" return "Bottom Left";
case SettingsData.Position.BottomCenter: case SettingsData.Position.BottomCenter:
return "Bottom Center" return "Bottom Center";
case SettingsData.Position.LeftCenter: case SettingsData.Position.LeftCenter:
return "Left Center" return "Left Center";
case SettingsData.Position.RightCenter: case SettingsData.Position.RightCenter:
return "Right Center" return "Right Center";
default: default:
return "Bottom Center" return "Bottom Center";
} }
} }
options: ["Top Right", "Top Left", "Top Center", "Bottom Right", "Bottom Left", "Bottom Center", "Left Center", "Right Center"] options: ["Top Right", "Top Left", "Top Center", "Bottom Right", "Bottom Left", "Bottom Center", "Left Center", "Right Center"]
onValueChanged: value => { onValueChanged: value => {
switch (value) { switch (value) {
case "Top Right": case "Top Right":
SettingsData.set("osdPosition", SettingsData.Position.Top) SettingsData.set("osdPosition", SettingsData.Position.Top);
break break;
case "Top Left": case "Top Left":
SettingsData.set("osdPosition", SettingsData.Position.Left) SettingsData.set("osdPosition", SettingsData.Position.Left);
break break;
case "Top Center": case "Top Center":
SettingsData.set("osdPosition", SettingsData.Position.TopCenter) SettingsData.set("osdPosition", SettingsData.Position.TopCenter);
break break;
case "Bottom Right": case "Bottom Right":
SettingsData.set("osdPosition", SettingsData.Position.Right) SettingsData.set("osdPosition", SettingsData.Position.Right);
break break;
case "Bottom Left": case "Bottom Left":
SettingsData.set("osdPosition", SettingsData.Position.Bottom) SettingsData.set("osdPosition", SettingsData.Position.Bottom);
break break;
case "Bottom Center": case "Bottom Center":
SettingsData.set("osdPosition", SettingsData.Position.BottomCenter) SettingsData.set("osdPosition", SettingsData.Position.BottomCenter);
break break;
case "Left Center": case "Left Center":
SettingsData.set("osdPosition", SettingsData.Position.LeftCenter) SettingsData.set("osdPosition", SettingsData.Position.LeftCenter);
break break;
case "Right Center": case "Right Center":
SettingsData.set("osdPosition", SettingsData.Position.RightCenter) SettingsData.set("osdPosition", SettingsData.Position.RightCenter);
break break;
} }
} }
} }
@@ -806,18 +783,17 @@ Item {
description: I18n.tr("Show on-screen display when volume changes") description: I18n.tr("Show on-screen display when volume changes")
checked: SettingsData.osdVolumeEnabled checked: SettingsData.osdVolumeEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.set("osdVolumeEnabled", checked) return SettingsData.set("osdVolumeEnabled", checked);
} }
} }
DankToggle { DankToggle {
width: parent.width width: parent.width
text: I18n.tr("Media Volume OSD") text: I18n.tr("Media Volume OSD")
description: I18n.tr("Show on-screen display when media player volume changes") description: I18n.tr("Show on-screen display when media player volume changes")
checked: SettingsData.osdMediaVolumeEnabled checked: SettingsData.osdMediaVolumeEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.set("osdMediaVolumeEnabled", checked) return SettingsData.set("osdMediaVolumeEnabled", checked);
} }
} }
@@ -827,7 +803,7 @@ Item {
description: I18n.tr("Show on-screen display when brightness changes") description: I18n.tr("Show on-screen display when brightness changes")
checked: SettingsData.osdBrightnessEnabled checked: SettingsData.osdBrightnessEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.set("osdBrightnessEnabled", checked) return SettingsData.set("osdBrightnessEnabled", checked);
} }
} }
@@ -837,7 +813,7 @@ Item {
description: I18n.tr("Show on-screen display when idle inhibitor state changes") description: I18n.tr("Show on-screen display when idle inhibitor state changes")
checked: SettingsData.osdIdleInhibitorEnabled checked: SettingsData.osdIdleInhibitorEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.set("osdIdleInhibitorEnabled", checked) return SettingsData.set("osdIdleInhibitorEnabled", checked);
} }
} }
@@ -847,7 +823,7 @@ Item {
description: I18n.tr("Show on-screen display when microphone is muted/unmuted") description: I18n.tr("Show on-screen display when microphone is muted/unmuted")
checked: SettingsData.osdMicMuteEnabled checked: SettingsData.osdMicMuteEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.set("osdMicMuteEnabled", checked) return SettingsData.set("osdMicMuteEnabled", checked);
} }
} }
@@ -857,7 +833,7 @@ Item {
description: I18n.tr("Show on-screen display when caps lock state changes") description: I18n.tr("Show on-screen display when caps lock state changes")
checked: SettingsData.osdCapsLockEnabled checked: SettingsData.osdCapsLockEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.set("osdCapsLockEnabled", checked) return SettingsData.set("osdCapsLockEnabled", checked);
} }
} }
@@ -867,7 +843,7 @@ Item {
description: I18n.tr("Show on-screen display when power profile changes") description: I18n.tr("Show on-screen display when power profile changes")
checked: SettingsData.osdPowerProfileEnabled checked: SettingsData.osdPowerProfileEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.set("osdPowerProfileEnabled", checked) return SettingsData.set("osdPowerProfileEnabled", checked);
} }
} }
} }