From 39f2d2c9bf50ae6006475e20a3ef373aadf007f0 Mon Sep 17 00:00:00 2001 From: Christian Duvholt Date: Sun, 12 May 2024 18:43:28 +0200 Subject: [PATCH] Formatting --- plasmoid/contents/ui/configGeneral.qml | 126 ++++++++--------- plasmoid/contents/ui/main.qml | 184 ++++++++++++------------- 2 files changed, 155 insertions(+), 155 deletions(-) diff --git a/plasmoid/contents/ui/configGeneral.qml b/plasmoid/contents/ui/configGeneral.qml index 28900c2..47f355b 100644 --- a/plasmoid/contents/ui/configGeneral.qml +++ b/plasmoid/contents/ui/configGeneral.qml @@ -6,10 +6,10 @@ import org.kde.kcmutils as KCM KCM.SimpleKCM { - property alias cfg_showWorkspaceNames : showWorkspaceNames.checked - property alias cfg_filterByCurrentScreen : filterByCurrentScreen.checked - property alias cfg_urgentColorWholeWorkspace : urgentColorWholeWorkspace.checked - property alias cfg_rounded : rounded.checked + property alias cfg_showWorkspaceNames: showWorkspaceNames.checked + property alias cfg_filterByCurrentScreen: filterByCurrentScreen.checked + property alias cfg_urgentColorWholeWorkspace: urgentColorWholeWorkspace.checked + property alias cfg_rounded: rounded.checked property var cfg_orderWorkspacesBy property var cfg_style property var cfg_styleDefault @@ -30,129 +30,129 @@ KCM.SimpleKCM { property var cfg_urgentColorWholeWorkspaceDefault Kirigami.FormLayout { - id : page - width : childrenRect.width - height : childrenRect.height + id: page + width: childrenRect.width + height: childrenRect.height ColumnLayout { - Kirigami.FormData.label : i18n("Basic:") - Kirigami.FormData.buddyFor : showWorkspaceNames + Kirigami.FormData.label: i18n("Basic:") + Kirigami.FormData.buddyFor: showWorkspaceNames CheckBox { - id : showWorkspaceNames - text : i18n("Show workspace names") - checked : plasmoid.configuration.showWorkspaceNames - onCheckedChanged : plasmoid.configuration.showWorkspaceNames = checked + id: showWorkspaceNames + text: i18n("Show workspace names") + checked: plasmoid.configuration.showWorkspaceNames + onCheckedChanged: plasmoid.configuration.showWorkspaceNames = checked } CheckBox { - id : filterByCurrentScreen - text : i18n("Filter workspaces by current screen") - checked : plasmoid.configuration.filterByCurrentScreen - onCheckedChanged : plasmoid.configuration.filterByCurrentScreen = checked + id: filterByCurrentScreen + text: i18n("Filter workspaces by current screen") + checked: plasmoid.configuration.filterByCurrentScreen + onCheckedChanged: plasmoid.configuration.filterByCurrentScreen = checked } CheckBox { - id : urgentColorWholeWorkspace - text : i18n("Color the whole workspace if urgent") - checked : plasmoid.configuration.urgentColorWholeWorkspace - onCheckedChanged : plasmoid.configuration.urgentColorWholeWorkspace = checked + id: urgentColorWholeWorkspace + text: i18n("Color the whole workspace if urgent") + checked: plasmoid.configuration.urgentColorWholeWorkspace + onCheckedChanged: plasmoid.configuration.urgentColorWholeWorkspace = checked } CheckBox { - id : rounded - text : i18n("Rounded corners") - checked : plasmoid.configuration.rounded - onCheckedChanged : plasmoid.configuration.rounded = checked + id: rounded + text: i18n("Rounded corners") + checked: plasmoid.configuration.rounded + onCheckedChanged: plasmoid.configuration.rounded = checked } } Item { - Kirigami.FormData.isSection : true + Kirigami.FormData.isSection: true } ColumnLayout { - Kirigami.FormData.label : i18n("Order workspaces by:") - Kirigami.FormData.buddyFor : orderWorkspacesByDefaultRadio + Kirigami.FormData.label: i18n("Order workspaces by:") + Kirigami.FormData.buddyFor: orderWorkspacesByDefaultRadio RadioButton { - id : orderWorkspacesByDefaultRadio - text : i18n("Default") - checked : cfg_orderWorkspacesBy == "default" - onClicked : { + id: orderWorkspacesByDefaultRadio + text: i18n("Default") + checked: cfg_orderWorkspacesBy == "default" + onClicked: { cfg_orderWorkspacesBy = "default" } } RadioButton { - id : orderWorkspacesByScreenRadio - text : i18n("Screen") - checked : cfg_orderWorkspacesBy == "screen" - onClicked : { + id: orderWorkspacesByScreenRadio + text: i18n("Screen") + checked: cfg_orderWorkspacesBy == "screen" + onClicked: { cfg_orderWorkspacesBy = "screen" } } RadioButton { - id : orderWorkspacesByName - text : i18n("Name") - checked : cfg_orderWorkspacesBy == "name" - onClicked : { + id: orderWorkspacesByName + text: i18n("Name") + checked: cfg_orderWorkspacesBy == "name" + onClicked: { cfg_orderWorkspacesBy = "name" } } } Item { - Kirigami.FormData.isSection : true + Kirigami.FormData.isSection: true } ColumnLayout { - Kirigami.FormData.label : i18n("Indicator style:") - Kirigami.FormData.buddyFor : styleUnderlineRadio + Kirigami.FormData.label: i18n("Indicator style:") + Kirigami.FormData.buddyFor: styleUnderlineRadio RadioButton { - id : styleUnderlineRadio - text : i18n("Line") - checked : cfg_style == "line" - onClicked : { + id: styleUnderlineRadio + text: i18n("Line") + checked: cfg_style == "line" + onClicked: { cfg_style = "line" } } RadioButton { - id : styleBorderRadio - text : i18n("Border") - checked : cfg_style == "border" - onClicked : { + id: styleBorderRadio + text: i18n("Border") + checked: cfg_style == "border" + onClicked: { cfg_style = "border" } } } Item { - Kirigami.FormData.isSection : true + Kirigami.FormData.isSection: true } ColumnLayout { - Kirigami.FormData.label : i18n("Indicator position:") - Kirigami.FormData.buddyFor : indicatorPositionTopRadio - visible : cfg_style == "line" + Kirigami.FormData.label: i18n("Indicator position:") + Kirigami.FormData.buddyFor: indicatorPositionTopRadio + visible: cfg_style == "line" RadioButton { - id : indicatorPositionTopRadio - text : i18n("Top") - checked : cfg_indicatorPosition == "top" - onClicked : { + id: indicatorPositionTopRadio + text: i18n("Top") + checked: cfg_indicatorPosition == "top" + onClicked: { cfg_indicatorPosition = "top" } } RadioButton { - id : indicatorPositionBottomRadio - text : i18n("Bottom") - checked : cfg_indicatorPosition == "bottom" - onClicked : { + id: indicatorPositionBottomRadio + text: i18n("Bottom") + checked: cfg_indicatorPosition == "bottom" + onClicked: { cfg_indicatorPosition = "bottom" } } diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index d3e130c..b2045cb 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -9,24 +9,24 @@ import org.kde.private.I3Pager PlasmoidItem { - id : root - readonly property color defaultWorkspace : "transparent" - readonly property color focusedWorkspace : Kirigami.Theme.positiveTextColor - readonly property color visibleWorkspace : Kirigami.Theme.neutralTextColor - readonly property color urgentWorkspace : Kirigami.Theme.negativeTextColor - readonly property color mouseWorkspace : Kirigami.Theme.linkColor + id: root + readonly property color defaultWorkspace: "transparent" + readonly property color focusedWorkspace: Kirigami.Theme.positiveTextColor + readonly property color visibleWorkspace: Kirigami.Theme.neutralTextColor + readonly property color urgentWorkspace: Kirigami.Theme.negativeTextColor + readonly property color mouseWorkspace: Kirigami.Theme.linkColor - preferredRepresentation : fullRepresentation + preferredRepresentation: fullRepresentation Layout.minimumWidth: workspaceRow.implicitWidth + Kirigami.Units.smallSpacing ColumnLayout { - id : rootColumnLayout + id: rootColumnLayout I3Pager { - id : i3pager - currentScreen : Screen.name - onWorkspacesChanged : { + id: i3pager + currentScreen: Screen.name + onWorkspacesChanged: { updateWorkspaces(); } function updateWorkspaces() { @@ -39,7 +39,7 @@ PlasmoidItem { } Connections { - target : plasmoid.configuration + target: plasmoid.configuration function onFilterByCurrentScreenChanged() { i3pager.updateWorkspaces(); } @@ -55,27 +55,27 @@ PlasmoidItem { } // Hack to update current screen - Screen.onNameChanged : { + Screen.onNameChanged: { i3pager.currentScreen = Screen.name } Row { - id : workspaceRow - Layout.alignment : Layout.AlignVCenter | Layout.AlignHCenter - spacing : 2 + id: workspaceRow + Layout.alignment: Layout.AlignVCenter | Layout.AlignHCenter + spacing: 2 Repeater { - id : repeater + id: repeater MouseArea { - id : mouseArea - hoverEnabled : true - cursorShape : Qt.PointingHandCursor - onClicked : { + id: mouseArea + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: { i3pager.activateWorkspace(modelData.id) } - width : textRow.width - height : root.height + width: textRow.width + height: root.height function getIndicatorColor() { if (mouseArea.containsMouse) { return mouseWorkspace; @@ -99,30 +99,30 @@ PlasmoidItem { return screenColor; } function getRadius() { - return plasmoid.configuration.rounded ? 3 : 0; + return plasmoid.configuration.rounded ? 3: 0; } Rectangle { // Border style - visible : plasmoid.configuration.style === "border" - color : mouseArea.getFillColor() - radius : getRadius() - height : textRow.height - width : textRow.width + visible: plasmoid.configuration.style === "border" + color: mouseArea.getFillColor() + radius: getRadius() + height: textRow.height + width: textRow.width border { - width : 2 - color : mouseArea.getIndicatorColor() + width: 2 + color: mouseArea.getIndicatorColor() } } Rectangle { // Underline style - visible : plasmoid.configuration.style === "line" - color : mouseArea.getFillColor() - radius : getRadius() - height : textRow.height - width : textRow.width + visible: plasmoid.configuration.style === "line" + color: mouseArea.getFillColor() + radius: getRadius() + height: textRow.height + width: textRow.width Rectangle { - Component.onCompleted : { + Component.onCompleted: { if (plasmoid.configuration.indicatorPosition === "top") { anchors.top = parent.top; } else { @@ -130,83 +130,83 @@ PlasmoidItem { } } - height : 5 - width : textRow.width - radius : getRadius() - color : mouseArea.getIndicatorColor() + height: 5 + width: textRow.width + radius: getRadius() + color: mouseArea.getIndicatorColor() } } RowLayout { - id : textRow - height : parent.height + id: textRow + height: parent.height Rectangle { - width : 5 + width: 5 } Text { - font.family : Kirigami.Theme.defaultFont.family - height : textRow.height - minimumPixelSize : Kirigami.Theme.smallFont.pixelSize - font.pixelSize : Math.min(textRow.height * 0.5, 1.5 * Kirigami.Theme.defaultFont.pixelSize) - fontSizeMode : Text.VerticalFit - color : Kirigami.Theme.textColor - text : modelData.index - verticalAlignment : Text.AlignHCenter + font.family: Kirigami.Theme.defaultFont.family + height: textRow.height + minimumPixelSize: Kirigami.Theme.smallFont.pixelSize + font.pixelSize: Math.min(textRow.height * 0.5, 1.5 * Kirigami.Theme.defaultFont.pixelSize) + fontSizeMode: Text.VerticalFit + color: Kirigami.Theme.textColor + text: modelData.index + verticalAlignment: Text.AlignHCenter } Label { - id : icon - rightPadding : 3 - leftPadding : 3 - bottomPadding : 0 - height : textRow.height - minimumPixelSize : Kirigami.Theme.smallFont.pixelSize - font.pixelSize : Math.min(textRow.height * 0.5, 1.5 * Kirigami.Theme.defaultFont.pixelSize) - fontSizeMode : Text.VerticalFit - font.family : "Font Awesome" - font.styleName : "Solid" - color : Kirigami.Theme.textColor - text : modelData.icon - verticalAlignment : Text.AlignHCenter - visible : plasmoid.configuration.showWorkspaceNames + id: icon + rightPadding: 3 + leftPadding: 3 + bottomPadding: 0 + height: textRow.height + minimumPixelSize: Kirigami.Theme.smallFont.pixelSize + font.pixelSize: Math.min(textRow.height * 0.5, 1.5 * Kirigami.Theme.defaultFont.pixelSize) + fontSizeMode: Text.VerticalFit + font.family: "Font Awesome" + font.styleName: "Solid" + color: Kirigami.Theme.textColor + text: modelData.icon + verticalAlignment: Text.AlignHCenter + visible: plasmoid.configuration.showWorkspaceNames } Text { - height : textRow.height - minimumPixelSize : Kirigami.Theme.smallFont.pixelSize - font.pixelSize : Math.min(textRow.height * 0.5, 1.5 * Kirigami.Theme.defaultFont.pixelSize) - fontSizeMode : Text.VerticalFit - font.family : Kirigami.Theme.defaultFont.family - color : Kirigami.Theme.textColor - text : modelData.name - verticalAlignment : Text.AlignHCenter - visible : plasmoid.configuration.showWorkspaceNames + height: textRow.height + minimumPixelSize: Kirigami.Theme.smallFont.pixelSize + font.pixelSize: Math.min(textRow.height * 0.5, 1.5 * Kirigami.Theme.defaultFont.pixelSize) + fontSizeMode: Text.VerticalFit + font.family: Kirigami.Theme.defaultFont.family + color: Kirigami.Theme.textColor + text: modelData.name + verticalAlignment: Text.AlignHCenter + visible: plasmoid.configuration.showWorkspaceNames } Rectangle { - width : 5 + width: 5 } } } } Item { - width : modeText.width - height : modeText.height - anchors.verticalCenter : parent.verticalCenter - visible : i3pager.mode !== "default" + width: modeText.width + height: modeText.height + anchors.verticalCenter: parent.verticalCenter + visible: i3pager.mode !== "default" Rectangle { - color : "#e5c07b" - height : parent.height - width : parent.width + color: "#e5c07b" + height: parent.height + width: parent.width } Text { - id : modeText - rightPadding : 10 - leftPadding : 10 - minimumPixelSize : Kirigami.Theme.smallFont.pixelSize - font.pixelSize : Math.min(root.height * 0.5, 1.5 * Kirigami.Theme.defaultFont.pixelSize) - fontSizeMode : Text.VerticalFit - font.family : Kirigami.Theme.defaultFont.family - color : "#333333" - text : i3pager.mode + id: modeText + rightPadding: 10 + leftPadding: 10 + minimumPixelSize: Kirigami.Theme.smallFont.pixelSize + font.pixelSize: Math.min(root.height * 0.5, 1.5 * Kirigami.Theme.defaultFont.pixelSize) + fontSizeMode: Text.VerticalFit + font.family: Kirigami.Theme.defaultFont.family + color: "#333333" + text: i3pager.mode } } }