diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index f6037b2e..10c4bd0a 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -497,7 +497,7 @@ Singleton { property int fontWeight: Font.Normal property real fontScale: 1.0 property real dankBarFontScale: 1.0 - property int textRenderType: SettingsData.TextRenderType.Native + property int textRenderType: SettingsData.TextRenderType.Qt property int textRenderQuality: SettingsData.TextRenderQuality.Default property bool notepadUseMonospace: true diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index 340b5d78..d919e6a7 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -242,7 +242,7 @@ var SPEC = { monoFontFamily: { def: "Fira Code" }, fontWeight: { def: 400 }, fontScale: { def: 1.0 }, - textRenderType: { def: 1 }, + textRenderType: { def: 0 }, textRenderQuality: { def: 0 }, notepadUseMonospace: { def: true }, diff --git a/quickshell/Modals/Common/InputModal.qml b/quickshell/Modals/Common/InputModal.qml index c65f3e09..fcacb8aa 100644 --- a/quickshell/Modals/Common/InputModal.qml +++ b/quickshell/Modals/Common/InputModal.qml @@ -29,7 +29,7 @@ DankModal { confirmButtonText = "Confirm"; cancelButtonText = "Cancel"; confirmButtonColor = Theme.primary; - onConfirm = onConfirmCallback || ((text) => {}); + onConfirm = onConfirmCallback || (text => {}); onCancel = onCancelCallback || (() => {}); selectedButton = -1; keyboardNavigation = false; @@ -44,7 +44,7 @@ DankModal { confirmButtonText = options.confirmText || "Confirm"; cancelButtonText = options.cancelText || "Cancel"; confirmButtonColor = options.confirmColor || Theme.primary; - onConfirm = options.onConfirm || ((text) => {}); + onConfirm = options.onConfirm || (text => {}); onCancel = options.onCancel || (() => {}); selectedButton = -1; keyboardNavigation = false; diff --git a/quickshell/Modals/DankLauncherV2/GridItem.qml b/quickshell/Modals/DankLauncherV2/GridItem.qml index 5d812ae1..b04a0c0e 100644 --- a/quickshell/Modals/DankLauncherV2/GridItem.qml +++ b/quickshell/Modals/DankLauncherV2/GridItem.qml @@ -70,7 +70,7 @@ Rectangle { materialIconSizeAdjustment: root.computedIconSize * 0.3 } - Text { + StyledText { width: parent.width text: root.item?._hName ?? root.item?.name ?? "" textFormat: root.item?._hRich ? Text.RichText : Text.PlainText diff --git a/quickshell/Modals/DankLauncherV2/ResultItem.qml b/quickshell/Modals/DankLauncherV2/ResultItem.qml index 83d44eb5..8f078842 100644 --- a/quickshell/Modals/DankLauncherV2/ResultItem.qml +++ b/quickshell/Modals/DankLauncherV2/ResultItem.qml @@ -95,7 +95,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter height: nameText.implicitHeight + (subText.visible ? subText.height + 2 : 0) - Text { + StyledText { id: nameText anchors.left: parent.left anchors.right: parent.right @@ -128,7 +128,7 @@ Rectangle { return e.endsWith("…") ? e.length - 1 : e.length; } - Text { + StyledText { id: subText anchors.left: parent.left anchors.right: parent.right diff --git a/quickshell/Modals/DankLauncherV2/SectionHeader.qml b/quickshell/Modals/DankLauncherV2/SectionHeader.qml index ee366c75..f1bdd505 100644 --- a/quickshell/Modals/DankLauncherV2/SectionHeader.qml +++ b/quickshell/Modals/DankLauncherV2/SectionHeader.qml @@ -72,7 +72,9 @@ Rectangle { readonly property var iconMap: { const cats = root.controller?.appCategories ?? []; const m = {}; - cats.forEach(c => { m[c] = AppSearchService.getCategoryIcon(c); }); + cats.forEach(c => { + m[c] = AppSearchService.getCategoryIcon(c); + }); return m; } @@ -137,7 +139,9 @@ Rectangle { dim: false closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside - background: Rectangle { color: "transparent" } + background: Rectangle { + color: "transparent" + } contentItem: Rectangle { radius: Theme.cornerRadius diff --git a/quickshell/Modals/DankLauncherV2/TileItem.qml b/quickshell/Modals/DankLauncherV2/TileItem.qml index d4837412..b8110c43 100644 --- a/quickshell/Modals/DankLauncherV2/TileItem.qml +++ b/quickshell/Modals/DankLauncherV2/TileItem.qml @@ -114,7 +114,7 @@ Rectangle { color: Theme.withAlpha(Theme.surfaceContainer, 0.85) visible: root.item?.name?.length > 0 - Text { + StyledText { id: labelText anchors.fill: parent anchors.margins: Theme.spacingXS diff --git a/quickshell/Modals/FileBrowser/FileBrowserNavigation.qml b/quickshell/Modals/FileBrowser/FileBrowserNavigation.qml index 61ce7b69..06fab596 100644 --- a/quickshell/Modals/FileBrowser/FileBrowserNavigation.qml +++ b/quickshell/Modals/FileBrowser/FileBrowserNavigation.qml @@ -13,7 +13,7 @@ Row { property bool pathEditMode: false property bool pathInputHasFocus: false - signal navigateUp() + signal navigateUp signal navigateTo(string path) signal pathInputFocusChanged(bool hasFocus) @@ -80,9 +80,9 @@ Row { anchors.fill: parent cursorShape: Qt.IBeamCursor onClicked: { - pathEditMode = true - pathInput.text = currentPath.replace("file://", "") - Qt.callLater(() => pathInput.forceActiveFocus()) + pathEditMode = true; + pathInput.text = currentPath.replace("file://", ""); + Qt.callLater(() => pathInput.forceActiveFocus()); } } } @@ -94,22 +94,22 @@ Row { topPadding: Theme.spacingXS bottomPadding: Theme.spacingXS onAccepted: { - const newPath = text.trim() + const newPath = text.trim(); if (newPath !== "") { - navigation.navigateTo(newPath) + navigation.navigateTo(newPath); } - pathEditMode = false + pathEditMode = false; } Keys.onEscapePressed: { - pathEditMode = false + pathEditMode = false; } Keys.onDownPressed: { - pathEditMode = false + pathEditMode = false; } onActiveFocusChanged: { - navigation.pathInputFocusChanged(activeFocus) + navigation.pathInputFocusChanged(activeFocus); if (!activeFocus && pathEditMode) { - pathEditMode = false + pathEditMode = false; } } } diff --git a/quickshell/Modals/FileBrowser/FileBrowserOverwriteDialog.qml b/quickshell/Modals/FileBrowser/FileBrowserOverwriteDialog.qml index a664be55..4b686041 100644 --- a/quickshell/Modals/FileBrowser/FileBrowserOverwriteDialog.qml +++ b/quickshell/Modals/FileBrowser/FileBrowserOverwriteDialog.qml @@ -9,17 +9,17 @@ Item { property string pendingFilePath: "" signal confirmed(string filePath) - signal cancelled() + signal cancelled visible: showDialog focus: showDialog Keys.onEscapePressed: { - cancelled() + cancelled(); } Keys.onReturnPressed: { - confirmed(pendingFilePath) + confirmed(pendingFilePath); } Rectangle { @@ -30,7 +30,7 @@ Item { MouseArea { anchors.fill: parent onClicked: { - cancelled() + cancelled(); } } } @@ -92,7 +92,7 @@ Item { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - cancelled() + cancelled(); } } } @@ -117,7 +117,7 @@ Item { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - confirmed(pendingFilePath) + confirmed(pendingFilePath); } } } diff --git a/quickshell/Modals/FileBrowser/FileBrowserSaveRow.qml b/quickshell/Modals/FileBrowser/FileBrowserSaveRow.qml index 6360c7fe..a47f4b50 100644 --- a/quickshell/Modals/FileBrowser/FileBrowserSaveRow.qml +++ b/quickshell/Modals/FileBrowser/FileBrowserSaveRow.qml @@ -29,15 +29,15 @@ Row { Component.onCompleted: { if (saveMode) Qt.callLater(() => { - forceActiveFocus() - }) + forceActiveFocus(); + }); } onAccepted: { if (text.trim() !== "") { - var basePath = currentPath.replace(/^file:\/\//, '') - var fullPath = basePath + "/" + text.trim() - fullPath = fullPath.replace(/\/+/g, '/') - saveRequested(fullPath) + var basePath = currentPath.replace(/^file:\/\//, ''); + var fullPath = basePath + "/" + text.trim(); + fullPath = fullPath.replace(/\/+/g, '/'); + saveRequested(fullPath); } } } @@ -63,10 +63,10 @@ Row { enabled: fileNameInput.text.trim() !== "" onClicked: { if (fileNameInput.text.trim() !== "") { - var basePath = currentPath.replace(/^file:\/\//, '') - var fullPath = basePath + "/" + fileNameInput.text.trim() - fullPath = fullPath.replace(/\/+/g, '/') - saveRequested(fullPath) + var basePath = currentPath.replace(/^file:\/\//, ''); + var fullPath = basePath + "/" + fileNameInput.text.trim(); + fullPath = fullPath.replace(/\/+/g, '/'); + saveRequested(fullPath); } } } diff --git a/quickshell/Modals/FileBrowser/FileBrowserSortMenu.qml b/quickshell/Modals/FileBrowser/FileBrowserSortMenu.qml index e1886f9f..961dc258 100644 --- a/quickshell/Modals/FileBrowser/FileBrowserSortMenu.qml +++ b/quickshell/Modals/FileBrowser/FileBrowserSortMenu.qml @@ -36,19 +36,24 @@ StyledRect { } Repeater { - model: [{ + model: [ + { "name": "Name", "value": "name" - }, { + }, + { "name": "Size", "value": "size" - }, { + }, + { "name": "Modified", "value": "modified" - }, { + }, + { "name": "Type", "value": "type" - }] + } + ] StyledRect { width: sortColumn?.width ?? 0 @@ -83,8 +88,8 @@ StyledRect { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - sortMenu.sortBySelected(modelData?.value ?? "name") - sortMenu.visible = false + sortMenu.sortBySelected(modelData?.value ?? "name"); + sortMenu.visible = false; } } } @@ -136,8 +141,8 @@ StyledRect { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - sortMenu.sortOrderSelected(true) - sortMenu.visible = false + sortMenu.sortOrderSelected(true); + sortMenu.visible = false; } } } @@ -174,8 +179,8 @@ StyledRect { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - sortMenu.sortOrderSelected(false) - sortMenu.visible = false + sortMenu.sortOrderSelected(false); + sortMenu.visible = false; } } } diff --git a/quickshell/Modals/KeybindsModal.qml b/quickshell/Modals/KeybindsModal.qml index e1d6765e..d9acc2d5 100644 --- a/quickshell/Modals/KeybindsModal.qml +++ b/quickshell/Modals/KeybindsModal.qml @@ -142,13 +142,7 @@ DankModal { let shouldContinue = false; for (let j = 0; j < lowerQueryWords.length; j++) { const word = lowerQueryWords[j]; - if (!( - word.length === 0 || - keyLower.includes(word) || - descLower.includes(word) || - catLower.includes(word) || - actionLower.includes(word) - )) { + if (!(word.length === 0 || keyLower.includes(word) || descLower.includes(word) || catLower.includes(word) || actionLower.includes(word))) { shouldContinue = true; break; } @@ -181,7 +175,7 @@ DankModal { return processed; } - property var categories: generateCategories(""); + property var categories: generateCategories("") function estimateCategoryHeight(catName) { const catData = categories[catName]; @@ -196,7 +190,7 @@ DankModal { return 40 + bindCount * 28; } - property var categoryKeys: Object.keys(categories); + property var categoryKeys: Object.keys(categories) function distributeCategories(cols) { const columns = []; diff --git a/quickshell/Modals/MuxModal.qml b/quickshell/Modals/MuxModal.qml index 9d193880..56ffe9e7 100644 --- a/quickshell/Modals/MuxModal.qml +++ b/quickshell/Modals/MuxModal.qml @@ -21,18 +21,18 @@ DankModal { property var filteredSessions: [] function updateFilteredSessions() { - var filtered = [] - var lowerSearch = searchText.trim().toLowerCase() + var filtered = []; + var lowerSearch = searchText.trim().toLowerCase(); for (var i = 0; i < MuxService.sessions.length; i++) { - var session = MuxService.sessions[i] + var session = MuxService.sessions[i]; if (lowerSearch.length > 0 && !session.name.toLowerCase().includes(lowerSearch)) - continue - filtered.push(session) + continue; + filtered.push(session); } - filteredSessions = filtered + filteredSessions = filtered; if (selectedIndex >= filteredSessions.length) { - selectedIndex = Math.max(0, filteredSessions.length - 1) + selectedIndex = Math.max(0, filteredSessions.length - 1); } } @@ -41,7 +41,7 @@ DankModal { Connections { target: MuxService function onSessionsChanged() { - updateFilteredSessions() + updateFilteredSessions(); } } @@ -53,35 +53,35 @@ DankModal { function toggle() { if (shouldBeVisible) { - hide() + hide(); } else { - show() + show(); } } function show() { - open() - selectedIndex = -1 - searchText = "" - MuxService.refreshSessions() - shouldHaveFocus = true + open(); + selectedIndex = -1; + searchText = ""; + MuxService.refreshSessions(); + shouldHaveFocus = true; Qt.callLater(() => { if (muxPanel && muxPanel.searchField) { muxPanel.searchField.forceActiveFocus(); } - }) + }); } function hide() { - close() - selectedIndex = -1 - searchText = "" + close(); + selectedIndex = -1; + searchText = ""; } function attachToSession(name) { - MuxService.attachToSession(name) - hide() + MuxService.attachToSession(name); + hide(); } function renameSession(name) { @@ -90,9 +90,9 @@ DankModal { message: I18n.tr("Enter a new name for session \"%1\"").arg(name), initialText: name, onConfirm: function (newName) { - MuxService.renameSession(name, newName) + MuxService.renameSession(name, newName); } - }) + }); } function killSession(name) { @@ -102,9 +102,9 @@ DankModal { confirmText: I18n.tr("Kill"), confirmColor: Theme.primary, onConfirm: function () { - MuxService.killSession(name) + MuxService.killSession(name); } - }) + }); } function createNewSession() { @@ -112,25 +112,25 @@ DankModal { title: I18n.tr("New Session"), message: I18n.tr("Please write a name for your new %1 session").arg(MuxService.displayName), onConfirm: function (name) { - MuxService.createSession(name) - hide() + MuxService.createSession(name); + hide(); } - }) + }); } function selectNext() { - selectedIndex = Math.min(selectedIndex + 1, filteredSessions.length - 1) + selectedIndex = Math.min(selectedIndex + 1, filteredSessions.length - 1); } function selectPrevious() { - selectedIndex = Math.max(selectedIndex - 1, -1) + selectedIndex = Math.max(selectedIndex - 1, -1); } function activateSelected() { if (selectedIndex === -1) { - createNewSession() + createNewSession(); } else if (selectedIndex >= 0 && selectedIndex < filteredSessions.length) { - attachToSession(filteredSessions[selectedIndex].name) + attachToSession(filteredSessions[selectedIndex].name); } } @@ -155,18 +155,18 @@ DankModal { IpcHandler { function open(): string { - muxModal.show() - return "MUX_OPEN_SUCCESS" + muxModal.show(); + return "MUX_OPEN_SUCCESS"; } function close(): string { - muxModal.hide() - return "MUX_CLOSE_SUCCESS" + muxModal.hide(); + return "MUX_CLOSE_SUCCESS"; } function toggle(): string { - muxModal.toggle() - return "MUX_TOGGLE_SUCCESS" + muxModal.toggle(); + return "MUX_TOGGLE_SUCCESS"; } target: "mux" @@ -175,18 +175,18 @@ DankModal { // Backwards compatibility IpcHandler { function open(): string { - muxModal.show() - return "TMUX_OPEN_SUCCESS" + muxModal.show(); + return "TMUX_OPEN_SUCCESS"; } function close(): string { - muxModal.hide() - return "TMUX_CLOSE_SUCCESS" + muxModal.hide(); + return "TMUX_CLOSE_SUCCESS"; } function toggle(): string { - muxModal.toggle() - return "TMUX_TOGGLE_SUCCESS" + muxModal.toggle(); + return "TMUX_TOGGLE_SUCCESS"; } target: "tmux" @@ -248,33 +248,31 @@ DankModal { property alias searchField: searchField Keys.onPressed: event => { - if ((event.key === Qt.Key_J && (event.modifiers & Qt.ControlModifier)) || - (event.key === Qt.Key_Down)) { - selectNext() - event.accepted = true - } else if ((event.key === Qt.Key_K && (event.modifiers & Qt.ControlModifier)) || - (event.key === Qt.Key_Up)) { - selectPrevious() - event.accepted = true + if ((event.key === Qt.Key_J && (event.modifiers & Qt.ControlModifier)) || (event.key === Qt.Key_Down)) { + selectNext(); + event.accepted = true; + } else if ((event.key === Qt.Key_K && (event.modifiers & Qt.ControlModifier)) || (event.key === Qt.Key_Up)) { + selectPrevious(); + event.accepted = true; } else if (event.key === Qt.Key_N && (event.modifiers & Qt.ControlModifier)) { - createNewSession() - event.accepted = true + createNewSession(); + event.accepted = true; } else if (event.key === Qt.Key_R && (event.modifiers & Qt.ControlModifier)) { if (MuxService.supportsRename && selectedIndex >= 0 && selectedIndex < filteredSessions.length) { - renameSession(filteredSessions[selectedIndex].name) + renameSession(filteredSessions[selectedIndex].name); } - event.accepted = true + event.accepted = true; } else if (event.key === Qt.Key_D && (event.modifiers & Qt.ControlModifier)) { if (selectedIndex >= 0 && selectedIndex < filteredSessions.length) { - killSession(filteredSessions[selectedIndex].name) + killSession(filteredSessions[selectedIndex].name); } - event.accepted = true + event.accepted = true; } else if (event.key === Qt.Key_Escape) { - hide() - event.accepted = true + hide(); + event.accepted = true; } else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { - activateSelected() - event.accepted = true + activateSelected(); + event.accepted = true; } } @@ -307,12 +305,8 @@ DankModal { text: { const total = MuxService.sessions.length; const filtered = muxModal.filteredSessions.length; - const activePart = total === 1 - ? I18n.tr("%1 active session").arg(total) - : I18n.tr("%1 active sessions").arg(total); - const filteredPart = filtered === 1 - ? I18n.tr("%1 filtered").arg(filtered) - : I18n.tr("%1 filtered").arg(filtered); + const activePart = total === 1 ? I18n.tr("%1 active session").arg(total) : I18n.tr("%1 active sessions").arg(total); + const filteredPart = filtered === 1 ? I18n.tr("%1 filtered").arg(filtered) : I18n.tr("%1 filtered").arg(filtered); return activePart + ", " + filteredPart; } font.pixelSize: Theme.fontSizeMedium @@ -340,8 +334,8 @@ DankModal { keyForwardTargets: [muxPanel] onTextEdited: { - muxModal.searchText = text - muxModal.selectedIndex = 0 + muxModal.searchText = text; + muxModal.selectedIndex = 0; } } @@ -350,8 +344,7 @@ DankModal { width: parent.width height: 56 radius: Theme.cornerRadius - color: muxModal.selectedIndex === -1 ? Theme.primaryContainer : - (newMouse.containsMouse ? Theme.surfaceContainerHigh : Theme.surfaceContainer) + color: muxModal.selectedIndex === -1 ? Theme.primaryContainer : (newMouse.containsMouse ? Theme.surfaceContainerHigh : Theme.surfaceContainer) RowLayout { anchors.fill: parent @@ -428,8 +421,7 @@ DankModal { width: parent.width height: 64 radius: Theme.cornerRadius - color: muxModal.selectedIndex === index ? Theme.primaryContainer : - (sessionMouse.containsMouse ? Theme.surfaceContainerHigh : "transparent") + color: muxModal.selectedIndex === index ? Theme.primaryContainer : (sessionMouse.containsMouse ? Theme.surfaceContainerHigh : "transparent") MouseArea { id: sessionMouse @@ -476,13 +468,11 @@ DankModal { StyledText { text: { - var parts = [] + var parts = []; if (modelData.windows !== "N/A") - parts.push(modelData.windows === 1 - ? I18n.tr("%1 window").arg(modelData.windows) - : I18n.tr("%1 windows").arg(modelData.windows)) - parts.push(modelData.attached ? I18n.tr("attached") : I18n.tr("detached")) - return parts.join(" \u2022 ") + parts.push(modelData.windows === 1 ? I18n.tr("%1 window").arg(modelData.windows) : I18n.tr("%1 windows").arg(modelData.windows)); + parts.push(modelData.attached ? I18n.tr("attached") : I18n.tr("detached")); + return parts.join(" \u2022 "); } font.pixelSize: Theme.fontSizeSmall color: Theme.surfaceVariantText @@ -533,7 +523,7 @@ DankModal { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - muxModal.killSession(modelData.name) + muxModal.killSession(modelData.name); } } } @@ -587,15 +577,33 @@ DankModal { Repeater { model: { var shortcuts = [ - { key: "↑↓", label: I18n.tr("Navigate") }, - { key: "↵", label: I18n.tr("Attach") }, - { key: "^N", label: I18n.tr("New") }, - { key: "^D", label: I18n.tr("Kill") }, - { key: "Esc", label: I18n.tr("Close") } - ] + { + key: "↑↓", + label: I18n.tr("Navigate") + }, + { + key: "↵", + label: I18n.tr("Attach") + }, + { + key: "^N", + label: I18n.tr("New") + }, + { + key: "^D", + label: I18n.tr("Kill") + }, + { + key: "Esc", + label: I18n.tr("Close") + } + ]; if (MuxService.supportsRename) - shortcuts.splice(3, 0, { key: "^R", label: I18n.tr("Rename") }) - return shortcuts + shortcuts.splice(3, 0, { + key: "^R", + label: I18n.tr("Rename") + }); + return shortcuts; } delegate: Row { diff --git a/quickshell/Modals/WifiQRCodeModal.qml b/quickshell/Modals/WifiQRCodeModal.qml index 7962c249..ad6681f5 100644 --- a/quickshell/Modals/WifiQRCodeModal.qml +++ b/quickshell/Modals/WifiQRCodeModal.qml @@ -68,7 +68,7 @@ DankModal { if (response.error) { ToastService.showError(I18n.tr("Failed to remove QR code at %1: %2").arg(path).arg(JSON.stringify(response.error))); } - }) + }); } LazyLoader { @@ -90,7 +90,7 @@ DankModal { const fileName = cleanPath.split('/').pop(); const fileUrl = "file://" + cleanPath; - copyQrCodeProcess.exec(["cp", root.normalQrCodePath, cleanPath, "-f"]) + copyQrCodeProcess.exec(["cp", root.normalQrCodePath, cleanPath, "-f"]); } Process { diff --git a/quickshell/Modules/ControlCenter/BuiltinPlugins/DisplayProfilesWidget.qml b/quickshell/Modules/ControlCenter/BuiltinPlugins/DisplayProfilesWidget.qml index 72837ef5..75130c7d 100644 --- a/quickshell/Modules/ControlCenter/BuiltinPlugins/DisplayProfilesWidget.qml +++ b/quickshell/Modules/ControlCenter/BuiltinPlugins/DisplayProfilesWidget.qml @@ -13,7 +13,10 @@ PluginComponent { const result = []; for (const id in allProfiles) { if (allProfiles[id].name) - result.push({ id: id, name: allProfiles[id].name }); + result.push({ + id: id, + name: allProfiles[id].name + }); } return result; } diff --git a/quickshell/Modules/ControlCenter/Components/SizeControls.qml b/quickshell/Modules/ControlCenter/Components/SizeControls.qml index aeae4ee2..3c2577df 100644 --- a/quickshell/Modules/ControlCenter/Components/SizeControls.qml +++ b/quickshell/Modules/ControlCenter/Components/SizeControls.qml @@ -1,5 +1,4 @@ import QtQuick -import QtQuick.Controls import qs.Common import qs.Widgets @@ -39,13 +38,15 @@ Row { anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: { - root.currentSize = modelData - root.sizeChanged(modelData) + root.currentSize = modelData; + root.sizeChanged(modelData); } } Behavior on color { - ColorAnimation { duration: Theme.shortDuration } + ColorAnimation { + duration: Theme.shortDuration + } } } } diff --git a/quickshell/Modules/ControlCenter/Components/Typography.qml b/quickshell/Modules/ControlCenter/Components/Typography.qml index f3e554f0..5635c9c7 100644 --- a/quickshell/Modules/ControlCenter/Components/Typography.qml +++ b/quickshell/Modules/ControlCenter/Components/Typography.qml @@ -17,30 +17,44 @@ StyledText { font.pixelSize: { switch (style) { - case Typography.Style.Title: return Theme.fontSizeXLarge - case Typography.Style.Subtitle: return Theme.fontSizeLarge - case Typography.Style.Body: return Theme.fontSizeMedium - case Typography.Style.Caption: return Theme.fontSizeSmall - case Typography.Style.Button: return Theme.fontSizeSmall - default: return Theme.fontSizeMedium + case Typography.Style.Title: + return Theme.fontSizeXLarge; + case Typography.Style.Subtitle: + return Theme.fontSizeLarge; + case Typography.Style.Body: + return Theme.fontSizeMedium; + case Typography.Style.Caption: + return Theme.fontSizeSmall; + case Typography.Style.Button: + return Theme.fontSizeSmall; + default: + return Theme.fontSizeMedium; } } font.weight: { switch (style) { - case Typography.Style.Title: return Font.Bold - case Typography.Style.Subtitle: return Font.Medium - case Typography.Style.Body: return Font.Normal - case Typography.Style.Caption: return Font.Normal - case Typography.Style.Button: return Font.Medium - default: return Font.Normal + case Typography.Style.Title: + return Font.Bold; + case Typography.Style.Subtitle: + return Font.Medium; + case Typography.Style.Body: + return Font.Normal; + case Typography.Style.Caption: + return Font.Normal; + case Typography.Style.Button: + return Font.Medium; + default: + return Font.Normal; } } color: { switch (style) { - case Typography.Style.Caption: return Theme.surfaceVariantText - default: return Theme.surfaceText + case Typography.Style.Caption: + return Theme.surfaceVariantText; + default: + return Theme.surfaceText; } } } diff --git a/quickshell/Modules/DankBar/Widgets/AppsDock.qml b/quickshell/Modules/DankBar/Widgets/AppsDock.qml index a8df08ba..71fd32e8 100644 --- a/quickshell/Modules/DankBar/Widgets/AppsDock.qml +++ b/quickshell/Modules/DankBar/Widgets/AppsDock.qml @@ -741,7 +741,7 @@ BasePill { } } - Text { + StyledText { anchors.centerIn: parent visible: !iconImg.visible && !coreIcon.visible && !Paths.isSteamApp(appItem.appId) text: { diff --git a/quickshell/Modules/DankBar/Widgets/DWLLayout.qml b/quickshell/Modules/DankBar/Widgets/DWLLayout.qml index f810cb6b..70937707 100644 --- a/quickshell/Modules/DankBar/Widgets/DWLLayout.qml +++ b/quickshell/Modules/DankBar/Widgets/DWLLayout.qml @@ -1,5 +1,4 @@ import QtQuick -import Quickshell import qs.Common import qs.Modules.Plugins import qs.Services @@ -11,7 +10,7 @@ BasePill { property bool layoutPopupVisible: false property var popoutTarget: null - signal toggleLayoutPopup() + signal toggleLayoutPopup visible: CompositorService.isDwl && DwlService.dwlAvailable @@ -20,27 +19,27 @@ BasePill { property int currentLayoutIndex: outputState?.layout || 0 readonly property var layoutIcons: ({ - "CT": "view_compact", - "G": "grid_view", - "K": "layers", - "M": "fullscreen", - "RT": "view_sidebar", - "S": "view_carousel", - "T": "view_quilt", - "VG": "grid_on", - "VK": "view_day", - "VS": "scrollable_header", - "VT": "clarify" - }) + "CT": "view_compact", + "G": "grid_view", + "K": "layers", + "M": "fullscreen", + "RT": "view_sidebar", + "S": "view_carousel", + "T": "view_quilt", + "VG": "grid_on", + "VK": "view_day", + "VS": "scrollable_header", + "VT": "clarify" + }) function getLayoutIcon(symbol) { - return layoutIcons[symbol] || "view_quilt" + return layoutIcons[symbol] || "view_quilt"; } Connections { target: DwlService function onStateChanged() { - outputState = parentScreen ? DwlService.getOutputState(parentScreen.name) : null + outputState = parentScreen ? DwlService.getOutputState(parentScreen.name) : null; } } @@ -94,17 +93,17 @@ BasePill { } onClicked: { - toggleLayoutPopup() + toggleLayoutPopup(); } onRightClicked: { if (!parentScreen || !DwlService.dwlAvailable || DwlService.layouts.length === 0) { - return + return; } - const currentIndex = layout.currentLayoutIndex - const nextIndex = (currentIndex + 1) % DwlService.layouts.length + const currentIndex = layout.currentLayoutIndex; + const nextIndex = (currentIndex + 1) % DwlService.layouts.length; - DwlService.setLayout(parentScreen.name, nextIndex) + DwlService.setLayout(parentScreen.name, nextIndex); } } diff --git a/quickshell/Modules/DankBar/Widgets/DiskUsage.qml b/quickshell/Modules/DankBar/Widgets/DiskUsage.qml index d6e6d1be..b6812e6e 100644 --- a/quickshell/Modules/DankBar/Widgets/DiskUsage.qml +++ b/quickshell/Modules/DankBar/Widgets/DiskUsage.qml @@ -131,12 +131,17 @@ BasePill { if (root.diskUsagePercent === undefined || root.diskUsagePercent === null || root.diskUsagePercent === 0) { return "--"; } - if (!root.selectedMount) return "--"; + if (!root.selectedMount) + return "--"; switch (root.diskUsageMode) { - case 1: return root.selectedMount.size || "--"; - case 2: return root.selectedMount.avail || "--"; - case 3: return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--"); - default: return root.diskUsagePercent.toFixed(0); + case 1: + return root.selectedMount.size || "--"; + case 2: + return root.selectedMount.avail || "--"; + case 3: + return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--"); + default: + return root.diskUsagePercent.toFixed(0); } } font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) @@ -185,12 +190,17 @@ BasePill { if (root.diskUsagePercent === undefined || root.diskUsagePercent === null || root.diskUsagePercent === 0) { return "--%"; } - if (!root.selectedMount) return "--%"; + if (!root.selectedMount) + return "--%"; switch (root.diskUsageMode) { - case 1: return root.selectedMount.size || "--"; - case 2: return root.selectedMount.avail || "--"; - case 3: return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--"); - default: return root.diskUsagePercent.toFixed(0) + "%"; + case 1: + return root.selectedMount.size || "--"; + case 2: + return root.selectedMount.avail || "--"; + case 3: + return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--"); + default: + return root.diskUsagePercent.toFixed(0) + "%"; } } font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) @@ -204,10 +214,13 @@ BasePill { font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) text: { switch (root.diskUsageMode) { - case 3: return "888.8G / 888.8G"; - case 1: - case 2: return "888.8G"; - default: return "100%"; + case 3: + return "888.8G / 888.8G"; + case 1: + case 2: + return "888.8G"; + default: + return "100%"; } } } diff --git a/quickshell/Modules/DankBar/Widgets/FocusedApp.qml b/quickshell/Modules/DankBar/Widgets/FocusedApp.qml index 575cb66a..1edef1ba 100644 --- a/quickshell/Modules/DankBar/Widgets/FocusedApp.qml +++ b/quickshell/Modules/DankBar/Widgets/FocusedApp.qml @@ -132,9 +132,7 @@ BasePill { const focusedWin = NiriService.windows.find(w => w.is_focused); if (!focusedWin) return false; - const screenWsIds = new Set( - NiriService.allWorkspaces.filter(ws => ws.output === parentScreen.name).map(ws => ws.id) - ); + const screenWsIds = new Set(NiriService.allWorkspaces.filter(ws => ws.output === parentScreen.name).map(ws => ws.id)); return screenWsIds.has(focusedWin.workspace_id); } @@ -211,7 +209,7 @@ BasePill { visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && Paths.isSteamApp(activeWindow.appId) } - Text { + StyledText { anchors.centerIn: parent visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && !Paths.isSteamApp(activeWindow.appId) text: { diff --git a/quickshell/Modules/DankBar/Widgets/NetworkMonitor.qml b/quickshell/Modules/DankBar/Widgets/NetworkMonitor.qml index b7d8436e..c695fc59 100644 --- a/quickshell/Modules/DankBar/Widgets/NetworkMonitor.qml +++ b/quickshell/Modules/DankBar/Widgets/NetworkMonitor.qml @@ -1,8 +1,6 @@ import QtQuick -import QtQuick.Controls import qs.Common import qs.Modules.Plugins -import qs.Modules.ProcessList import qs.Services import qs.Widgets @@ -11,21 +9,21 @@ BasePill { function formatNetworkSpeed(bytesPerSec) { if (bytesPerSec < 1024) { - return bytesPerSec.toFixed(0) + " B/s" + return bytesPerSec.toFixed(0) + " B/s"; } else if (bytesPerSec < 1024 * 1024) { - return (bytesPerSec / 1024).toFixed(1) + " KB/s" + return (bytesPerSec / 1024).toFixed(1) + " KB/s"; } else if (bytesPerSec < 1024 * 1024 * 1024) { - return (bytesPerSec / (1024 * 1024)).toFixed(1) + " MB/s" + return (bytesPerSec / (1024 * 1024)).toFixed(1) + " MB/s"; } else { - return (bytesPerSec / (1024 * 1024 * 1024)).toFixed(1) + " GB/s" + return (bytesPerSec / (1024 * 1024 * 1024)).toFixed(1) + " GB/s"; } } Component.onCompleted: { - DgopService.addRef(["network"]) + DgopService.addRef(["network"]); } Component.onDestruction: { - DgopService.removeRef(["network"]) + DgopService.removeRef(["network"]); } content: Component { @@ -48,10 +46,12 @@ BasePill { StyledText { text: { - const rate = DgopService.networkRxRate - if (rate < 1024) return rate.toFixed(0) - if (rate < 1024 * 1024) return (rate / 1024).toFixed(0) + "K" - return (rate / (1024 * 1024)).toFixed(0) + "M" + const rate = DgopService.networkRxRate; + if (rate < 1024) + return rate.toFixed(0); + if (rate < 1024 * 1024) + return (rate / 1024).toFixed(0) + "K"; + return (rate / (1024 * 1024)).toFixed(0) + "M"; } font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) color: Theme.info @@ -60,10 +60,12 @@ BasePill { StyledText { text: { - const rate = DgopService.networkTxRate - if (rate < 1024) return rate.toFixed(0) - if (rate < 1024 * 1024) return (rate / 1024).toFixed(0) + "K" - return (rate / (1024 * 1024)).toFixed(0) + "M" + const rate = DgopService.networkTxRate; + if (rate < 1024) + return rate.toFixed(0); + if (rate < 1024 * 1024) + return (rate / 1024).toFixed(0) + "K"; + return (rate / (1024 * 1024)).toFixed(0) + "M"; } font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) color: Theme.error diff --git a/quickshell/Modules/DankBar/Widgets/RunningApps.qml b/quickshell/Modules/DankBar/Widgets/RunningApps.qml index c4f4ab19..8a0360ef 100644 --- a/quickshell/Modules/DankBar/Widgets/RunningApps.qml +++ b/quickshell/Modules/DankBar/Widgets/RunningApps.qml @@ -316,7 +316,7 @@ BasePill { visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId) } - Text { + StyledText { anchors.centerIn: parent visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId) text: { @@ -570,7 +570,7 @@ BasePill { visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId) } - Text { + StyledText { anchors.centerIn: parent visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId) text: { diff --git a/quickshell/Modules/DankBar/Widgets/SystemTrayBar.qml b/quickshell/Modules/DankBar/Widgets/SystemTrayBar.qml index 687e9d2f..136381db 100644 --- a/quickshell/Modules/DankBar/Widgets/SystemTrayBar.qml +++ b/quickshell/Modules/DankBar/Widgets/SystemTrayBar.qml @@ -428,7 +428,7 @@ BasePill { } } - Text { + StyledText { anchors.centerIn: parent visible: !iconImg.visible text: { @@ -649,7 +649,7 @@ BasePill { } } - Text { + StyledText { anchors.centerIn: parent visible: !inlineIconImg.visible text: { @@ -783,7 +783,7 @@ BasePill { } } - Text { + StyledText { anchors.centerIn: parent visible: !iconImg.visible text: { @@ -1290,7 +1290,7 @@ BasePill { } } - Text { + StyledText { anchors.centerIn: parent visible: !menuIconImg.visible text: { diff --git a/quickshell/Modules/DankBar/Widgets/Weather.qml b/quickshell/Modules/DankBar/Widgets/Weather.qml index 5dbe53a7..efd8893e 100644 --- a/quickshell/Modules/DankBar/Widgets/Weather.qml +++ b/quickshell/Modules/DankBar/Widgets/Weather.qml @@ -16,9 +16,11 @@ BasePill { content: Component { Item { implicitWidth: { - if (!SettingsData.weatherEnabled) return 0 - if (root.isVerticalOrientation) return root.widgetThickness - root.horizontalPadding * 2 - return Math.min(100 - root.horizontalPadding * 2, weatherRow.implicitWidth) + if (!SettingsData.weatherEnabled) + return 0; + if (root.isVerticalOrientation) + return root.widgetThickness - root.horizontalPadding * 2; + return Math.min(100 - root.horizontalPadding * 2, weatherRow.implicitWidth); } implicitHeight: root.isVerticalOrientation ? weatherColumn.implicitHeight : (root.widgetThickness - root.horizontalPadding * 2) diff --git a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml index 058557f9..27a1abf1 100644 --- a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml +++ b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml @@ -1691,7 +1691,7 @@ Item { anchors.bottom: parent.bottom z: 2 - Text { + StyledText { anchors.centerIn: parent text: modelData.count font.pixelSize: root.appIconSize * 0.44 @@ -1860,7 +1860,7 @@ Item { anchors.bottom: parent.bottom z: 2 - Text { + StyledText { anchors.centerIn: parent text: modelData.count font.pixelSize: root.appIconSize * 0.44 diff --git a/quickshell/Modules/DankDash/Overview/ClockCard.qml b/quickshell/Modules/DankDash/Overview/ClockCard.qml index 5f597c34..f09146d3 100644 --- a/quickshell/Modules/DankDash/Overview/ClockCard.qml +++ b/quickshell/Modules/DankDash/Overview/ClockCard.qml @@ -1,5 +1,4 @@ import QtQuick -import QtQuick.Effects import Quickshell import qs.Common import qs.Widgets @@ -22,11 +21,11 @@ Card { StyledText { text: { if (SettingsData.use24HourClock) { - return String(systemClock?.date?.getHours()).padStart(2, '0').charAt(0) + return String(systemClock?.date?.getHours()).padStart(2, '0').charAt(0); } else { - const hours = systemClock?.date?.getHours() - const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours - return String(display).padStart(2, '0').charAt(0) + const hours = systemClock?.date?.getHours(); + const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours; + return String(display).padStart(2, '0').charAt(0); } } font.pixelSize: 48 @@ -39,11 +38,11 @@ Card { StyledText { text: { if (SettingsData.use24HourClock) { - return String(systemClock?.date?.getHours()).padStart(2, '0').charAt(1) + return String(systemClock?.date?.getHours()).padStart(2, '0').charAt(1); } else { - const hours = systemClock?.date?.getHours() - const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours - return String(display).padStart(2, '0').charAt(1) + const hours = systemClock?.date?.getHours(); + const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours; + return String(display).padStart(2, '0').charAt(1); } } font.pixelSize: 48 diff --git a/quickshell/Modules/DankDash/Overview/MediaOverviewCard.qml b/quickshell/Modules/DankDash/Overview/MediaOverviewCard.qml index 35f4f47e..ce3a9a10 100644 --- a/quickshell/Modules/DankDash/Overview/MediaOverviewCard.qml +++ b/quickshell/Modules/DankDash/Overview/MediaOverviewCard.qml @@ -1,6 +1,4 @@ import QtQuick -import QtQuick.Effects -import QtQuick.Shapes import Quickshell.Services.Mpris import qs.Common import qs.Services @@ -10,24 +8,25 @@ Card { id: root clip: false - signal clicked() + signal clicked property MprisPlayer activePlayer: MprisController.activePlayer property real currentPosition: activePlayer?.positionSupported ? activePlayer.position : 0 property real displayPosition: currentPosition readonly property real ratio: { - if (!activePlayer || activePlayer.length <= 0) return 0 - const pos = displayPosition % Math.max(1, activePlayer.length) - const calculatedRatio = pos / activePlayer.length - return Math.max(0, Math.min(1, calculatedRatio)) + if (!activePlayer || activePlayer.length <= 0) + return 0; + const pos = displayPosition % Math.max(1, activePlayer.length); + const calculatedRatio = pos / activePlayer.length; + return Math.max(0, Math.min(1, calculatedRatio)); } onActivePlayerChanged: { if (activePlayer?.positionSupported) { - currentPosition = Qt.binding(() => activePlayer?.position || 0) + currentPosition = Qt.binding(() => activePlayer?.position || 0); } else { - currentPosition = 0 + currentPosition = 0; } } @@ -126,73 +125,73 @@ Card { spacing: Theme.spacingS anchors.centerIn: parent - Rectangle { - width: 28 - height: 28 - radius: 14 - anchors.verticalCenter: playPauseButton.verticalCenter - color: prevArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent" + Rectangle { + width: 28 + height: 28 + radius: 14 + anchors.verticalCenter: playPauseButton.verticalCenter + color: prevArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent" - DankIcon { - anchors.centerIn: parent - name: "skip_previous" - size: 14 - color: Theme.surfaceText + DankIcon { + anchors.centerIn: parent + name: "skip_previous" + size: 14 + color: Theme.surfaceText + } + + MouseArea { + id: prevArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: MprisController.previousOrRewind() + } } - MouseArea { - id: prevArea - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - onClicked: MprisController.previousOrRewind() - } - } + Rectangle { + id: playPauseButton + width: 32 + height: 32 + radius: 16 + color: Theme.primary - Rectangle { - id: playPauseButton - width: 32 - height: 32 - radius: 16 - color: Theme.primary + DankIcon { + anchors.centerIn: parent + name: activePlayer?.playbackState === MprisPlaybackState.Playing ? "pause" : "play_arrow" + size: 16 + color: Theme.background + } - DankIcon { - anchors.centerIn: parent - name: activePlayer?.playbackState === MprisPlaybackState.Playing ? "pause" : "play_arrow" - size: 16 - color: Theme.background + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: activePlayer?.togglePlaying() + } } - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - onClicked: activePlayer?.togglePlaying() - } - } + Rectangle { + width: 28 + height: 28 + radius: 14 + anchors.verticalCenter: playPauseButton.verticalCenter + color: nextArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent" - Rectangle { - width: 28 - height: 28 - radius: 14 - anchors.verticalCenter: playPauseButton.verticalCenter - color: nextArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent" + DankIcon { + anchors.centerIn: parent + name: "skip_next" + size: 14 + color: Theme.surfaceText + } - DankIcon { - anchors.centerIn: parent - name: "skip_next" - size: 14 - color: Theme.surfaceText + MouseArea { + id: nextArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: activePlayer?.next() + } } - - MouseArea { - id: nextArea - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - onClicked: activePlayer?.next() - } - } } } } diff --git a/quickshell/Modules/DankDash/WallpaperTab.qml b/quickshell/Modules/DankDash/WallpaperTab.qml index 1f35b001..2f844ddc 100644 --- a/quickshell/Modules/DankDash/WallpaperTab.qml +++ b/quickshell/Modules/DankDash/WallpaperTab.qml @@ -538,11 +538,7 @@ Item { StyledText { anchors.verticalCenter: parent.verticalCenter - text: wallpaperFolderModel.count > 0 - ? (wallpaperFolderModel.count === 1 - ? I18n.tr("%1 wallpaper • %2 / %3").arg(wallpaperFolderModel.count).arg(currentPage + 1).arg(totalPages) - : I18n.tr("%1 wallpapers • %2 / %3").arg(wallpaperFolderModel.count).arg(currentPage + 1).arg(totalPages)) - : I18n.tr("No wallpapers") + text: wallpaperFolderModel.count > 0 ? (wallpaperFolderModel.count === 1 ? I18n.tr("%1 wallpaper • %2 / %3").arg(wallpaperFolderModel.count).arg(currentPage + 1).arg(totalPages) : I18n.tr("%1 wallpapers • %2 / %3").arg(wallpaperFolderModel.count).arg(currentPage + 1).arg(totalPages)) : I18n.tr("No wallpapers") font.pixelSize: 14 color: Theme.surfaceText opacity: 0.7 diff --git a/quickshell/Modules/Dock/DockAppButton.qml b/quickshell/Modules/Dock/DockAppButton.qml index 60e711dd..e944a4d5 100644 --- a/quickshell/Modules/Dock/DockAppButton.qml +++ b/quickshell/Modules/Dock/DockAppButton.qml @@ -505,7 +505,7 @@ Item { border.width: 1 border.color: Theme.primarySelected - Text { + StyledText { anchors.centerIn: parent text: { if (!appData || !appData.appId) { diff --git a/quickshell/Modules/Lock/CustomButtonKeyboard.qml b/quickshell/Modules/Lock/CustomButtonKeyboard.qml index 639389c7..e6f1e80d 100644 --- a/quickshell/Modules/Lock/CustomButtonKeyboard.qml +++ b/quickshell/Modules/Lock/CustomButtonKeyboard.qml @@ -19,10 +19,13 @@ DankActionButton { DankIcon { anchors.centerIn: parent name: { - if (parent.text === "keyboard_hide") return "keyboard_hide" - if (parent.text === "Backspace") return "backspace" - if (parent.text === "Enter") return "keyboard_return" - return "" + if (parent.text === "keyboard_hide") + return "keyboard_hide"; + if (parent.text === "Backspace") + return "backspace"; + if (parent.text === "Enter") + return "keyboard_return"; + return ""; } size: 20 color: Theme.surfaceText diff --git a/quickshell/Modules/Notepad/Notepad.qml b/quickshell/Modules/Notepad/Notepad.qml index e2946955..6a024781 100644 --- a/quickshell/Modules/Notepad/Notepad.qml +++ b/quickshell/Modules/Notepad/Notepad.qml @@ -34,7 +34,7 @@ Item { target: slideout enabled: slideout !== null function onAboutToHide() { - textEditor.autoSaveToSession() + textEditor.autoSaveToSession(); } } @@ -213,8 +213,8 @@ Item { } onEscapePressed: { - textEditor.autoSaveToSession() - root.hideRequested() + textEditor.autoSaveToSession(); + root.hideRequested(); } onSettingsRequested: { diff --git a/quickshell/Modules/Notepad/NotepadTabs.qml b/quickshell/Modules/Notepad/NotepadTabs.qml index 05a21d18..1ed0674e 100644 --- a/quickshell/Modules/Notepad/NotepadTabs.qml +++ b/quickshell/Modules/Notepad/NotepadTabs.qml @@ -71,27 +71,27 @@ Column { repeat: false onTriggered: { if (NotepadStorageService.tabs.length > 1) { - delegateItem.longPressing = true + delegateItem.longPressing = true; } } } readonly property real shiftOffset: { if (root.draggedIndex < 0) - return 0 + return 0; if (index === root.draggedIndex) - return 0 - var dragIdx = root.draggedIndex - var dropIdx = root.dropTargetIndex - var myIdx = index - var shiftAmount = root.tabItemSize + return 0; + var dragIdx = root.draggedIndex; + var dropIdx = root.dropTargetIndex; + var myIdx = index; + var shiftAmount = root.tabItemSize; if (dropIdx < 0) - return 0 + return 0; if (dragIdx < dropIdx && myIdx > dragIdx && myIdx <= dropIdx) - return -shiftAmount + return -shiftAmount; if (dragIdx > dropIdx && myIdx >= dropIdx && myIdx < dragIdx) - return shiftAmount - return 0 + return shiftAmount; + return 0; } width: tabWidth @@ -140,11 +140,11 @@ Column { id: tabText width: parent.width - (tabCloseButton.visible ? tabCloseButton.width + Theme.spacingXS : 0) text: { - var prefix = "" + var prefix = ""; if (hasUnsavedChangesForTab(modelData)) { - prefix = "● " + prefix = "● "; } - return prefix + (modelData.title || "Untitled") + return prefix + (modelData.title || "Untitled"); } font.pixelSize: Theme.fontSizeSmall color: isActive ? Theme.primary : Theme.surfaceText @@ -202,68 +202,65 @@ Column { onPressed: mouse => { if (mouse.button === Qt.LeftButton && NotepadStorageService.tabs.length > 1) { - delegateItem.dragStartPos = Qt.point(mouse.x, mouse.y) - longPressTimer.start() + delegateItem.dragStartPos = Qt.point(mouse.x, mouse.y); + longPressTimer.start(); } } onReleased: mouse => { - longPressTimer.stop() - var wasDragging = delegateItem.dragging - var didReorder = wasDragging && delegateItem.targetIndex >= 0 && delegateItem.targetIndex !== delegateItem.originalIndex + longPressTimer.stop(); + var wasDragging = delegateItem.dragging; + var didReorder = wasDragging && delegateItem.targetIndex >= 0 && delegateItem.targetIndex !== delegateItem.originalIndex; if (didReorder) { - root.suppressShiftAnimation = true - NotepadStorageService.reorderTab(delegateItem.originalIndex, delegateItem.targetIndex) + root.suppressShiftAnimation = true; + NotepadStorageService.reorderTab(delegateItem.originalIndex, delegateItem.targetIndex); } - delegateItem.longPressing = false - delegateItem.dragging = false - delegateItem.dragAxisOffset = 0 - delegateItem.targetIndex = -1 - delegateItem.originalIndex = -1 - root.draggedIndex = -1 - root.dropTargetIndex = -1 + delegateItem.longPressing = false; + delegateItem.dragging = false; + delegateItem.dragAxisOffset = 0; + delegateItem.targetIndex = -1; + delegateItem.originalIndex = -1; + root.draggedIndex = -1; + root.dropTargetIndex = -1; if (didReorder) { Qt.callLater(() => { - root.suppressShiftAnimation = false - }) + root.suppressShiftAnimation = false; + }); } if (wasDragging || mouse.button !== Qt.LeftButton) - return - root.tabSwitched(index) + return; + root.tabSwitched(index); } onPositionChanged: mouse => { if (delegateItem.longPressing && !delegateItem.dragging) { - var distance = Math.sqrt(Math.pow(mouse.x - delegateItem.dragStartPos.x, 2) + Math.pow(mouse.y - delegateItem.dragStartPos.y, 2)) + var distance = Math.sqrt(Math.pow(mouse.x - delegateItem.dragStartPos.x, 2) + Math.pow(mouse.y - delegateItem.dragStartPos.y, 2)); if (distance > 5) { - delegateItem.dragging = true - delegateItem.targetIndex = index - delegateItem.originalIndex = index - root.draggedIndex = index - root.dropTargetIndex = index + delegateItem.dragging = true; + delegateItem.targetIndex = index; + delegateItem.originalIndex = index; + root.draggedIndex = index; + root.dropTargetIndex = index; } } if (!delegateItem.dragging) - return + return; + var axisOffset = mouse.x - delegateItem.dragStartPos.x; + delegateItem.dragAxisOffset = axisOffset; - var axisOffset = mouse.x - delegateItem.dragStartPos.x - delegateItem.dragAxisOffset = axisOffset - - var itemSize = root.tabItemSize - var rawSlot = axisOffset / itemSize - var slotOffset = rawSlot >= 0 - ? Math.floor(rawSlot + 0.4) - : Math.ceil(rawSlot - 0.4) - var tabCount = NotepadStorageService.tabs.length - var newTargetIndex = Math.max(0, Math.min(tabCount - 1, delegateItem.originalIndex + slotOffset)) + var itemSize = root.tabItemSize; + var rawSlot = axisOffset / itemSize; + var slotOffset = rawSlot >= 0 ? Math.floor(rawSlot + 0.4) : Math.ceil(rawSlot - 0.4); + var tabCount = NotepadStorageService.tabs.length; + var newTargetIndex = Math.max(0, Math.min(tabCount - 1, delegateItem.originalIndex + slotOffset)); if (newTargetIndex !== delegateItem.targetIndex) { - delegateItem.targetIndex = newTargetIndex - root.dropTargetIndex = newTargetIndex + delegateItem.targetIndex = newTargetIndex; + root.dropTargetIndex = newTargetIndex; } } } diff --git a/quickshell/Modules/Notepad/NotepadTextEditor.qml b/quickshell/Modules/Notepad/NotepadTextEditor.qml index 3ae86797..01602bc7 100644 --- a/quickshell/Modules/Notepad/NotepadTextEditor.qml +++ b/quickshell/Modules/Notepad/NotepadTextEditor.qml @@ -465,7 +465,7 @@ Column { width: 32 height: measuringText.contentHeight - Text { + StyledText { id: measuringText width: textArea.width - textArea.leftPadding - textArea.rightPadding text: modelData || " " @@ -719,7 +719,7 @@ Column { contentWidth: width - 11 contentHeight: previewText.paintedHeight + Theme.spacingM * 2 - Text { + StyledText { id: previewText width: parent.width - Theme.spacingM padding: Theme.spacingM diff --git a/quickshell/Modules/Plugins/DesktopPluginWrapper.qml b/quickshell/Modules/Plugins/DesktopPluginWrapper.qml index e4745df4..8a8619ee 100644 --- a/quickshell/Modules/Plugins/DesktopPluginWrapper.qml +++ b/quickshell/Modules/Plugins/DesktopPluginWrapper.qml @@ -718,7 +718,7 @@ Item { anchors.verticalCenter: parent.verticalCenter } - Text { + StyledText { text: root.gridEnabled ? I18n.tr("Grid: ON", "Widget grid snap status") : I18n.tr("Grid: OFF", "Widget grid snap status") font.pixelSize: Theme.fontSizeSmall font.family: Theme.fontFamily @@ -733,7 +733,7 @@ Item { anchors.verticalCenter: parent.verticalCenter } - Text { + StyledText { text: root.gridSize + "px" font.pixelSize: Theme.fontSizeSmall font.family: Theme.fontFamily @@ -748,7 +748,7 @@ Item { anchors.verticalCenter: parent.verticalCenter } - Text { + StyledText { text: I18n.tr("G: grid • Z/X: size", "Widget grid keyboard hints") font.pixelSize: Theme.fontSizeSmall font.family: Theme.fontFamily diff --git a/quickshell/Modules/Plugins/ListSetting.qml b/quickshell/Modules/Plugins/ListSetting.qml index 5f636f5a..c90a9f18 100644 --- a/quickshell/Modules/Plugins/ListSetting.qml +++ b/quickshell/Modules/Plugins/ListSetting.qml @@ -16,38 +16,38 @@ Column { spacing: Theme.spacingM Component.onCompleted: { - const settings = findSettings() + const settings = findSettings(); if (settings) { - items = settings.loadValue(settingKey, defaultValue) + items = settings.loadValue(settingKey, defaultValue); } } onItemsChanged: { - const settings = findSettings() + const settings = findSettings(); if (settings) { - settings.saveValue(settingKey, items) + settings.saveValue(settingKey, items); } } function findSettings() { - let item = parent + let item = parent; while (item) { if (item.saveValue !== undefined && item.loadValue !== undefined) { - return item + return item; } - item = item.parent + item = item.parent; } - return null + return null; } function addItem(item) { - items = items.concat([item]) + items = items.concat([item]); } function removeItem(index) { - const newItems = items.slice() - newItems.splice(index, 1) - items = newItems + const newItems = items.slice(); + newItems.splice(index, 1); + items = newItems; } StyledText { @@ -123,7 +123,7 @@ Column { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - root.removeItem(index) + root.removeItem(index); } } } diff --git a/quickshell/Modules/Plugins/ListSettingWithInput.qml b/quickshell/Modules/Plugins/ListSettingWithInput.qml index 8da4fb6b..941c6995 100644 --- a/quickshell/Modules/Plugins/ListSettingWithInput.qml +++ b/quickshell/Modules/Plugins/ListSettingWithInput.qml @@ -18,47 +18,47 @@ Column { property bool isLoading: false Component.onCompleted: { - loadValue() + loadValue(); } function loadValue() { - const settings = findSettings() + const settings = findSettings(); if (settings) { - isLoading = true - items = settings.loadValue(settingKey, defaultValue) - isLoading = false + isLoading = true; + items = settings.loadValue(settingKey, defaultValue); + isLoading = false; } } onItemsChanged: { if (isLoading) { - return + return; } - const settings = findSettings() + const settings = findSettings(); if (settings) { - settings.saveValue(settingKey, items) + settings.saveValue(settingKey, items); } } function findSettings() { - let item = parent + let item = parent; while (item) { if (item.saveValue !== undefined && item.loadValue !== undefined) { - return item + return item; } - item = item.parent + item = item.parent; } - return null + return null; } function addItem(item) { - items = items.concat([item]) + items = items.concat([item]); } function removeItem(index) { - const newItems = items.slice() - newItems.splice(index, 1) - items = newItems + const newItems = items.slice(); + newItems.splice(index, 1); + items = newItems; } StyledText { @@ -110,11 +110,11 @@ Column { placeholderText: modelData.placeholder || "" Component.onCompleted: { - inputRow.inputFields.push(this) + inputRow.inputFields.push(this); } Keys.onReturnPressed: { - addButton.clicked() + addButton.clicked(); } } } @@ -126,32 +126,32 @@ Column { text: I18n.tr("Add") onClicked: { - let newItem = {} - let hasValue = false + let newItem = {}; + let hasValue = false; for (let i = 0; i < root.fields.length; i++) { - const field = root.fields[i] - const input = inputRow.inputFields[i] - const value = input.text.trim() + const field = root.fields[i]; + const input = inputRow.inputFields[i]; + const value = input.text.trim(); if (value !== "") { - hasValue = true + hasValue = true; } if (field.required && value === "") { - return + return; } - newItem[field.id] = value || (field.default || "") + newItem[field.id] = value || (field.default || ""); } if (hasValue) { - root.addItem(newItem) + root.addItem(newItem); for (let i = 0; i < inputRow.inputFields.length; i++) { - inputRow.inputFields[i].text = "" + inputRow.inputFields[i].text = ""; } if (inputRow.inputFields.length > 0) { - inputRow.inputFields[0].forceActiveFocus() + inputRow.inputFields[0].forceActiveFocus(); } } } @@ -200,13 +200,13 @@ Column { required property var modelData text: { - const field = modelData - const item = itemRow.itemData + const field = modelData; + const item = itemRow.itemData; if (!field || !field.id || !item) { - return "" + return ""; } - const value = item[field.id] - return value || "" + const value = item[field.id]; + return value || ""; } color: Theme.surfaceText font.pixelSize: Theme.fontSizeMedium @@ -239,7 +239,7 @@ Column { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - root.removeItem(index) + root.removeItem(index); } } } diff --git a/quickshell/Modules/Plugins/SliderSetting.qml b/quickshell/Modules/Plugins/SliderSetting.qml index f540fd4b..a349a475 100644 --- a/quickshell/Modules/Plugins/SliderSetting.qml +++ b/quickshell/Modules/Plugins/SliderSetting.qml @@ -20,32 +20,32 @@ Column { spacing: Theme.spacingS function loadValue() { - const settings = findSettings() + const settings = findSettings(); if (settings && settings.pluginService) { - value = settings.loadValue(settingKey, defaultValue) + value = settings.loadValue(settingKey, defaultValue); } } Component.onCompleted: { - loadValue() + loadValue(); } onValueChanged: { - const settings = findSettings() + const settings = findSettings(); if (settings) { - settings.saveValue(settingKey, value) + settings.saveValue(settingKey, value); } } function findSettings() { - let item = parent + let item = parent; while (item) { if (item.saveValue !== undefined && item.loadValue !== undefined) { - return item + return item; } - item = item.parent + item = item.parent; } - return null + return null; } StyledText { @@ -75,7 +75,7 @@ Column { wheelEnabled: false thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency) onSliderValueChanged: newValue => { - root.value = newValue + root.value = newValue; } } } diff --git a/quickshell/Modules/Plugins/ToggleSetting.qml b/quickshell/Modules/Plugins/ToggleSetting.qml index 3a6eae5f..51b9125a 100644 --- a/quickshell/Modules/Plugins/ToggleSetting.qml +++ b/quickshell/Modules/Plugins/ToggleSetting.qml @@ -17,35 +17,36 @@ Row { property bool isInitialized: false function loadValue() { - const settings = findSettings() + const settings = findSettings(); if (settings && settings.pluginService) { - const loadedValue = settings.loadValue(settingKey, defaultValue) - value = loadedValue - isInitialized = true + const loadedValue = settings.loadValue(settingKey, defaultValue); + value = loadedValue; + isInitialized = true; } } Component.onCompleted: { - Qt.callLater(loadValue) + Qt.callLater(loadValue); } onValueChanged: { - if (!isInitialized) return - const settings = findSettings() + if (!isInitialized) + return; + const settings = findSettings(); if (settings) { - settings.saveValue(settingKey, value) + settings.saveValue(settingKey, value); } } function findSettings() { - let item = parent + let item = parent; while (item) { if (item.saveValue !== undefined && item.loadValue !== undefined) { - return item + return item; } - item = item.parent + item = item.parent; } - return null + return null; } Column { @@ -75,7 +76,7 @@ Row { anchors.verticalCenter: parent.verticalCenter checked: root.value onToggled: isChecked => { - root.value = isChecked + root.value = isChecked; } } } diff --git a/quickshell/Modules/Settings/AboutTab.qml b/quickshell/Modules/Settings/AboutTab.qml index ff3c2b3d..4cc0bf4a 100644 --- a/quickshell/Modules/Settings/AboutTab.qml +++ b/quickshell/Modules/Settings/AboutTab.qml @@ -171,7 +171,7 @@ Item { } } - Text { + StyledText { anchors.verticalCenter: parent.verticalCenter text: "DANK LINUX" font.pixelSize: parent.compactLogo ? 32 : 48 diff --git a/quickshell/Modules/Settings/DisplayConfigTab.qml b/quickshell/Modules/Settings/DisplayConfigTab.qml index 925680dd..1f229141 100644 --- a/quickshell/Modules/Settings/DisplayConfigTab.qml +++ b/quickshell/Modules/Settings/DisplayConfigTab.qml @@ -390,11 +390,9 @@ Item { } StyledText { - text: DisplayConfigState.allOutputs[modelData]?.connected - ? I18n.tr("Connected") : I18n.tr("Disconnected") + text: DisplayConfigState.allOutputs[modelData]?.connected ? I18n.tr("Connected") : I18n.tr("Disconnected") font.pixelSize: Theme.fontSizeSmall - color: DisplayConfigState.allOutputs[modelData]?.connected - ? Theme.success : Theme.surfaceVariantText + color: DisplayConfigState.allOutputs[modelData]?.connected ? Theme.success : Theme.surfaceVariantText } } } diff --git a/quickshell/Modules/Settings/GreeterTab.qml b/quickshell/Modules/Settings/GreeterTab.qml index b3d3a41f..6c08dc5a 100644 --- a/quickshell/Modules/Settings/GreeterTab.qml +++ b/quickshell/Modules/Settings/GreeterTab.qml @@ -2,12 +2,10 @@ pragma ComponentBehavior: Bound import QtQuick import QtQuick.Layouts -import Quickshell import Quickshell.Io import qs.Common import qs.Modals.Common import qs.Modals.FileBrowser -import qs.Services import qs.Widgets import qs.Modules.Settings.Widgets diff --git a/quickshell/Modules/Settings/MuxTab.qml b/quickshell/Modules/Settings/MuxTab.qml index a82cdbef..0ad90c99 100644 --- a/quickshell/Modules/Settings/MuxTab.qml +++ b/quickshell/Modules/Settings/MuxTab.qml @@ -7,10 +7,7 @@ import qs.Modules.Settings.Widgets Item { id: root - readonly property var muxTypeOptions: [ - "tmux", - "zellij" - ] + readonly property var muxTypeOptions: ["tmux", "zellij"] DankFlickable { anchors.fill: parent diff --git a/quickshell/Modules/Settings/PluginsTab.qml b/quickshell/Modules/Settings/PluginsTab.qml index 6eb272f9..a5e1445d 100644 --- a/quickshell/Modules/Settings/PluginsTab.qml +++ b/quickshell/Modules/Settings/PluginsTab.qml @@ -23,7 +23,8 @@ FocusScope { function updateFilteredPlugins() { var query = searchQuery.toLowerCase(); filteredPlugins = PluginService.availablePluginsList.filter(plugin => { - if (!query) return true; + if (!query) + return true; var name = (plugin.name || "").toLowerCase(); var desc = (plugin.description || "").toLowerCase(); var author = (plugin.author || "").toLowerCase(); @@ -31,7 +32,6 @@ FocusScope { }); } - Connections { target: PluginService function onAvailablePluginsListChanged() { diff --git a/quickshell/Modules/Settings/TypographyMotionTab.qml b/quickshell/Modules/Settings/TypographyMotionTab.qml index 8cc4f62d..1be986b4 100644 --- a/quickshell/Modules/Settings/TypographyMotionTab.qml +++ b/quickshell/Modules/Settings/TypographyMotionTab.qml @@ -251,17 +251,7 @@ Item { settingKey: "fontWeight" text: I18n.tr("Font Weight") description: I18n.tr("Select font weight for UI text") - options: [ - I18n.tr("Thin"), - I18n.tr("Extra Light"), - I18n.tr("Light"), - I18n.tr("Regular"), - I18n.tr("Medium"), - I18n.tr("Demi Bold"), - I18n.tr("Bold"), - I18n.tr("Extra Bold"), - I18n.tr("Black") - ] + options: [I18n.tr("Thin"), I18n.tr("Extra Light"), I18n.tr("Light"), I18n.tr("Regular"), I18n.tr("Medium"), I18n.tr("Demi Bold"), I18n.tr("Bold"), I18n.tr("Extra Bold"), I18n.tr("Black")] currentValue: { switch (SettingsData.fontWeight) { case Font.Thin: @@ -441,13 +431,11 @@ Item { height: 1 color: Theme.outline opacity: 0.15 - visible: SettingsData.textRenderType === SettingsData.TextRenderType.Qt } Item { width: parent.width - height: visible ? qualityGroup.implicitHeight + qualityLabel.implicitHeight + Theme.spacingS : 0 - visible: SettingsData.textRenderType === SettingsData.TextRenderType.Qt + height: qualityGroup.implicitHeight + qualityLabel.implicitHeight + Theme.spacingS clip: true StyledText { diff --git a/quickshell/Modules/WorkspaceOverlays/OverviewWidget.qml b/quickshell/Modules/WorkspaceOverlays/OverviewWidget.qml index 8fd3e338..ae9c969a 100644 --- a/quickshell/Modules/WorkspaceOverlays/OverviewWidget.qml +++ b/quickshell/Modules/WorkspaceOverlays/OverviewWidget.qml @@ -223,7 +223,7 @@ Item { onClicked: { if (root.draggingTargetWorkspace === -1) { root.overviewOpen = false; - HyplandService.focusWorkspace(workspaceValue) + HyplandService.focusWorkspace(workspaceValue); } } } @@ -352,7 +352,7 @@ Item { root.draggingTargetWorkspace = -1; if (targetWorkspace !== -1 && targetWorkspace !== windowData?.workspace.id) { - HyprlandService.moveToWorkspace(targetWorkspace, windowData?.address, false) + HyprlandService.moveToWorkspace(targetWorkspace, windowData?.address, false); Qt.callLater(() => { Hyprland.refreshToplevels(); Hyprland.refreshWorkspaces(); diff --git a/quickshell/Widgets/AppIconRenderer.qml b/quickshell/Widgets/AppIconRenderer.qml index 9cdb71b3..ccd10a83 100644 --- a/quickshell/Widgets/AppIconRenderer.qml +++ b/quickshell/Widgets/AppIconRenderer.qml @@ -1,8 +1,6 @@ import QtQuick -import Quickshell import Quickshell.Widgets import qs.Common -import qs.Services Item { id: root diff --git a/quickshell/Widgets/DankNumberStepper.qml b/quickshell/Widgets/DankNumberStepper.qml index f4dcf5a1..02268ea8 100644 --- a/quickshell/Widgets/DankNumberStepper.qml +++ b/quickshell/Widgets/DankNumberStepper.qml @@ -1,4 +1,3 @@ -import QtCore import QtQuick import qs.Common @@ -27,7 +26,6 @@ Column { readonly property bool effectiveIncrementEnabled: root.onIncrement ? root.incrementEnabled : false readonly property bool effectiveDecrementEnabled: root.onDecrement ? root.decrementEnabled : false - width: Math.max(buttonSize * 2, root.implicitWidth + horizontalPadding * 2) spacing: 4 @@ -38,20 +36,27 @@ Column { iconSize: root.iconSize buttonSize: root.buttonSize iconName: root.incrementIconName - onClicked: if (typeof root.onIncrement === 'function') root.onIncrement() + onClicked: if (typeof root.onIncrement === 'function') + root.onIncrement() tooltipText: root.incrementTooltipText } Row { anchors.horizontalCenter: parent.horizontalCenter - Item { width: 5; height: 1 } + Item { + width: 5 + height: 1 + } StyledText { isMonospace: true text: root.text font.pixelSize: root.textSize color: root.textColor } - Item { width: 5; height: 1 } + Item { + width: 5 + height: 1 + } } DankActionButton { @@ -61,7 +66,8 @@ Column { iconSize: root.iconSize buttonSize: root.buttonSize iconName: root.decrementIconName - onClicked: if (typeof root.onDecrement === 'function') root.onDecrement() + onClicked: if (typeof root.onDecrement === 'function') + root.onDecrement() tooltipText: root.decrementTooltipText } } diff --git a/quickshell/Widgets/DankSlideout.qml b/quickshell/Widgets/DankSlideout.qml index b9305308..4dd22be4 100644 --- a/quickshell/Widgets/DankSlideout.qml +++ b/quickshell/Widgets/DankSlideout.qml @@ -1,6 +1,5 @@ pragma ComponentBehavior: Bound import QtQuick -import QtQuick.Controls import Quickshell import Quickshell.Wayland import qs.Common @@ -29,7 +28,9 @@ PanelWindow { function show() { mappedVisible = true; - Qt.callLater(() => { isVisible = true; }); + Qt.callLater(() => { + isVisible = true; + }); } function hide() { diff --git a/quickshell/Widgets/DankTooltip.qml b/quickshell/Widgets/DankTooltip.qml index f9585727..caf04059 100644 --- a/quickshell/Widgets/DankTooltip.qml +++ b/quickshell/Widgets/DankTooltip.qml @@ -50,21 +50,21 @@ PanelWindow { margins { left: { - const screenWidth = targetScreen?.width ?? Screen.width + const screenWidth = targetScreen?.width ?? Screen.width; if (alignLeft) { - return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX))) + return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX))); } else if (alignRight) { - return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth))) + return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth))); } else { - return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth / 2))) + return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth / 2))); } } top: { - const screenHeight = targetScreen?.height ?? Screen.height + const screenHeight = targetScreen?.height ?? Screen.height; if (alignLeft || alignRight) { - return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY - implicitHeight / 2))) + return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY - implicitHeight / 2))); } else { - return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY))) + return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY))); } } } @@ -76,7 +76,7 @@ PanelWindow { border.width: 1 border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08) - Text { + StyledText { id: textContent anchors.centerIn: parent