From 0f6c076dda53414922b542b4e042016d941619cb Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 28 Sep 2025 13:42:44 +0200 Subject: [PATCH] use more non-Layouts --- .../quickshell/ii/modules/bar/BarContent.qml | 8 ++-- .../modules/cheatsheet/CheatsheetKeybinds.qml | 41 +++++++++++-------- .../cheatsheet/CheatsheetPeriodicTable.qml | 6 +-- .../modules/mediaControls/MediaControls.qml | 5 ++- .../verticalBar/VerticalBarContent.qml | 4 +- .config/quickshell/ii/screenshot.qml | 24 +++++------ 6 files changed, 46 insertions(+), 42 deletions(-) diff --git a/.config/quickshell/ii/modules/bar/BarContent.qml b/.config/quickshell/ii/modules/bar/BarContent.qml index c0c5e31b8..677801882 100644 --- a/.config/quickshell/ii/modules/bar/BarContent.qml +++ b/.config/quickshell/ii/modules/bar/BarContent.qml @@ -97,7 +97,7 @@ Item { // Bar content region } } - RowLayout { // Middle section + Row { // Middle section id: middleSection anchors { top: parent.top @@ -108,8 +108,7 @@ Item { // Bar content region BarGroup { id: leftCenterGroup - Layout.preferredWidth: root.centerSideModuleWidth - Layout.fillHeight: false + implicitWidth: root.centerSideModuleWidth Resources { alwaysShowAllResources: root.useShortenedForm === 2 @@ -153,9 +152,8 @@ Item { // Bar content region MouseArea { id: rightCenterGroup - implicitWidth: rightCenterGroupContent.implicitWidth + implicitWidth: root.centerSideModuleWidth implicitHeight: rightCenterGroupContent.implicitHeight - Layout.preferredWidth: root.centerSideModuleWidth onPressed: { GlobalStates.sidebarRightOpen = !GlobalStates.sidebarRightOpen; diff --git a/.config/quickshell/ii/modules/cheatsheet/CheatsheetKeybinds.qml b/.config/quickshell/ii/modules/cheatsheet/CheatsheetKeybinds.qml index e0e8ce6cd..8c21d3426 100644 --- a/.config/quickshell/ii/modules/cheatsheet/CheatsheetKeybinds.qml +++ b/.config/quickshell/ii/modules/cheatsheet/CheatsheetKeybinds.qml @@ -1,3 +1,4 @@ +pragma ComponentBehavior: Bound import qs import qs.services import qs.modules.common @@ -11,8 +12,9 @@ Item { readonly property var keybinds: HyprlandKeybinds.keybinds property real spacing: 20 property real titleSpacing: 7 - implicitWidth: rowLayout.implicitWidth - implicitHeight: rowLayout.implicitHeight + property real padding: 4 + implicitWidth: row.implicitWidth + padding * 2 + implicitHeight: row.implicitHeight + padding * 2 property var keyBlacklist: ["Super_L"] property var keySubstitutions: ({ @@ -28,43 +30,51 @@ Item { // "Shift": "", }) - RowLayout { // Keybind columns - id: rowLayout + Row { // Keybind columns + id: row spacing: root.spacing + Repeater { model: keybinds.children - delegate: ColumnLayout { // Keybind sections + delegate: Column { // Keybind sections spacing: root.spacing required property var modelData - Layout.alignment: Qt.AlignTop + anchors.top: row.top + Repeater { model: modelData.children delegate: Item { // Section with real keybinds + id: keybindSection required property var modelData - implicitWidth: sectionColumnLayout.implicitWidth - implicitHeight: sectionColumnLayout.implicitHeight - ColumnLayout { - id: sectionColumnLayout + implicitWidth: sectionColumn.implicitWidth + implicitHeight: sectionColumn.implicitHeight + + Column { + id: sectionColumn anchors.centerIn: parent spacing: root.titleSpacing + StyledText { id: sectionTitle font.family: Appearance.font.family.title font.pixelSize: Appearance.font.pixelSize.huge color: Appearance.colors.colOnLayer0 - text: modelData.name + text: keybindSection.modelData.name } - GridLayout { + Grid { id: keybindGrid columns: 2 + columnSpacing: 4 + rowSpacing: 4 + Repeater { model: { var result = []; - for (var i = 0; i < modelData.keybinds.length; i++) { - const keybind = modelData.keybinds[i]; + for (var i = 0; i < keybindSection.modelData.keybinds.length; i++) { + const keybind = keybindSection.modelData.keybinds[i]; result.push({ "type": "keys", "mods": keybind.mods, @@ -89,7 +99,7 @@ Item { Component { id: keysComponent - RowLayout { + Row { spacing: 4 Repeater { model: modelData.mods @@ -101,7 +111,6 @@ Item { StyledText { id: keybindPlus visible: !keyBlacklist.includes(modelData.key) && modelData.mods.length > 0 - Layout.alignment: Qt.AlignVCenter text: "+" } KeyboardKey { diff --git a/.config/quickshell/ii/modules/cheatsheet/CheatsheetPeriodicTable.qml b/.config/quickshell/ii/modules/cheatsheet/CheatsheetPeriodicTable.qml index a0a8ecf3f..c21ddc825 100644 --- a/.config/quickshell/ii/modules/cheatsheet/CheatsheetPeriodicTable.qml +++ b/.config/quickshell/ii/modules/cheatsheet/CheatsheetPeriodicTable.qml @@ -15,14 +15,14 @@ Item { implicitWidth: mainLayout.implicitWidth implicitHeight: mainLayout.implicitHeight - ColumnLayout { + Column { id: mainLayout spacing: root.spacing Repeater { // Main table rows model: root.elements - delegate: RowLayout { // Table cells + delegate: Row { // Table cells id: tableRow spacing: root.spacing required property var modelData @@ -47,7 +47,7 @@ Item { Repeater { // Main table rows model: root.series - delegate: RowLayout { // Table cells + delegate: Row { // Table cells id: seriesTableRow spacing: root.spacing required property var modelData diff --git a/.config/quickshell/ii/modules/mediaControls/MediaControls.qml b/.config/quickshell/ii/modules/mediaControls/MediaControls.qml index b5742075a..5f8154a76 100644 --- a/.config/quickshell/ii/modules/mediaControls/MediaControls.qml +++ b/.config/quickshell/ii/modules/mediaControls/MediaControls.qml @@ -1,3 +1,4 @@ +pragma ComponentBehavior: Bound import qs.modules.common import qs.modules.common.widgets import qs.services @@ -153,8 +154,8 @@ Scope { required property MprisPlayer modelData player: modelData visualizerPoints: root.visualizerPoints - implicitWidth: widgetWidth - implicitHeight: widgetHeight + implicitWidth: root.widgetWidth + implicitHeight: root.widgetHeight radius: root.popupRounding } } diff --git a/.config/quickshell/ii/modules/verticalBar/VerticalBarContent.qml b/.config/quickshell/ii/modules/verticalBar/VerticalBarContent.qml index 612510720..8635bc969 100644 --- a/.config/quickshell/ii/modules/verticalBar/VerticalBarContent.qml +++ b/.config/quickshell/ii/modules/verticalBar/VerticalBarContent.qml @@ -80,7 +80,7 @@ Item { // Bar content region } } - ColumnLayout { // Middle section + Column { // Middle section id: middleSection anchors.centerIn: parent spacing: 4 @@ -156,8 +156,6 @@ Item { // Bar content region Layout.fillWidth: true Layout.fillHeight: false } - - } } diff --git a/.config/quickshell/ii/screenshot.qml b/.config/quickshell/ii/screenshot.qml index a8e102048..ec52aaa33 100644 --- a/.config/quickshell/ii/screenshot.qml +++ b/.config/quickshell/ii/screenshot.qml @@ -74,10 +74,10 @@ ShellRoot { } implicitWidth: regionInfoRow.implicitWidth + horizontalPadding * 2 implicitHeight: regionInfoRow.implicitHeight + verticalPadding * 2 - RowLayout { + Row { id: regionInfoRow anchors.centerIn: parent - spacing: 8 + spacing: 4 Loader { id: regionIconLoader @@ -430,21 +430,19 @@ ShellRoot { implicitWidth: instructionsRow.implicitWidth + 10 * 2 implicitHeight: instructionsRow.implicitHeight + 5 * 2 - RowLayout { + Row { id: instructionsRow anchors.centerIn: parent - Item { - Layout.fillHeight: true - implicitWidth: screenshotRegionIcon.implicitWidth - MaterialSymbol { - id: screenshotRegionIcon - anchors.centerIn: parent - iconSize: Appearance.font.pixelSize.larger - text: "screenshot_region" - color: root.genericContentForeground - } + spacing: 4 + MaterialSymbol { + id: screenshotRegionIcon + // anchors.centerIn: parent + iconSize: Appearance.font.pixelSize.larger + text: "screenshot_region" + color: root.genericContentForeground } StyledText { + anchors.verticalCenter: parent.verticalCenter text: Translation.tr("Drag or click a region • LMB: Copy • RMB: Edit") color: root.genericContentForeground }