use more non-Layouts

This commit is contained in:
end-4
2025-09-28 13:42:44 +02:00
parent b57e678dc9
commit 0f6c076dda
6 changed files with 46 additions and 42 deletions
@@ -97,7 +97,7 @@ Item { // Bar content region
} }
} }
RowLayout { // Middle section Row { // Middle section
id: middleSection id: middleSection
anchors { anchors {
top: parent.top top: parent.top
@@ -108,8 +108,7 @@ Item { // Bar content region
BarGroup { BarGroup {
id: leftCenterGroup id: leftCenterGroup
Layout.preferredWidth: root.centerSideModuleWidth implicitWidth: root.centerSideModuleWidth
Layout.fillHeight: false
Resources { Resources {
alwaysShowAllResources: root.useShortenedForm === 2 alwaysShowAllResources: root.useShortenedForm === 2
@@ -153,9 +152,8 @@ Item { // Bar content region
MouseArea { MouseArea {
id: rightCenterGroup id: rightCenterGroup
implicitWidth: rightCenterGroupContent.implicitWidth implicitWidth: root.centerSideModuleWidth
implicitHeight: rightCenterGroupContent.implicitHeight implicitHeight: rightCenterGroupContent.implicitHeight
Layout.preferredWidth: root.centerSideModuleWidth
onPressed: { onPressed: {
GlobalStates.sidebarRightOpen = !GlobalStates.sidebarRightOpen; GlobalStates.sidebarRightOpen = !GlobalStates.sidebarRightOpen;
@@ -1,3 +1,4 @@
pragma ComponentBehavior: Bound
import qs import qs
import qs.services import qs.services
import qs.modules.common import qs.modules.common
@@ -11,8 +12,9 @@ Item {
readonly property var keybinds: HyprlandKeybinds.keybinds readonly property var keybinds: HyprlandKeybinds.keybinds
property real spacing: 20 property real spacing: 20
property real titleSpacing: 7 property real titleSpacing: 7
implicitWidth: rowLayout.implicitWidth property real padding: 4
implicitHeight: rowLayout.implicitHeight implicitWidth: row.implicitWidth + padding * 2
implicitHeight: row.implicitHeight + padding * 2
property var keyBlacklist: ["Super_L"] property var keyBlacklist: ["Super_L"]
property var keySubstitutions: ({ property var keySubstitutions: ({
@@ -28,43 +30,51 @@ Item {
// "Shift": "", // "Shift": "",
}) })
RowLayout { // Keybind columns Row { // Keybind columns
id: rowLayout id: row
spacing: root.spacing spacing: root.spacing
Repeater { Repeater {
model: keybinds.children model: keybinds.children
delegate: ColumnLayout { // Keybind sections delegate: Column { // Keybind sections
spacing: root.spacing spacing: root.spacing
required property var modelData required property var modelData
Layout.alignment: Qt.AlignTop anchors.top: row.top
Repeater { Repeater {
model: modelData.children model: modelData.children
delegate: Item { // Section with real keybinds delegate: Item { // Section with real keybinds
id: keybindSection
required property var modelData required property var modelData
implicitWidth: sectionColumnLayout.implicitWidth implicitWidth: sectionColumn.implicitWidth
implicitHeight: sectionColumnLayout.implicitHeight implicitHeight: sectionColumn.implicitHeight
ColumnLayout {
id: sectionColumnLayout Column {
id: sectionColumn
anchors.centerIn: parent anchors.centerIn: parent
spacing: root.titleSpacing spacing: root.titleSpacing
StyledText { StyledText {
id: sectionTitle id: sectionTitle
font.family: Appearance.font.family.title font.family: Appearance.font.family.title
font.pixelSize: Appearance.font.pixelSize.huge font.pixelSize: Appearance.font.pixelSize.huge
color: Appearance.colors.colOnLayer0 color: Appearance.colors.colOnLayer0
text: modelData.name text: keybindSection.modelData.name
} }
GridLayout { Grid {
id: keybindGrid id: keybindGrid
columns: 2 columns: 2
columnSpacing: 4
rowSpacing: 4
Repeater { Repeater {
model: { model: {
var result = []; var result = [];
for (var i = 0; i < modelData.keybinds.length; i++) { for (var i = 0; i < keybindSection.modelData.keybinds.length; i++) {
const keybind = modelData.keybinds[i]; const keybind = keybindSection.modelData.keybinds[i];
result.push({ result.push({
"type": "keys", "type": "keys",
"mods": keybind.mods, "mods": keybind.mods,
@@ -89,7 +99,7 @@ Item {
Component { Component {
id: keysComponent id: keysComponent
RowLayout { Row {
spacing: 4 spacing: 4
Repeater { Repeater {
model: modelData.mods model: modelData.mods
@@ -101,7 +111,6 @@ Item {
StyledText { StyledText {
id: keybindPlus id: keybindPlus
visible: !keyBlacklist.includes(modelData.key) && modelData.mods.length > 0 visible: !keyBlacklist.includes(modelData.key) && modelData.mods.length > 0
Layout.alignment: Qt.AlignVCenter
text: "+" text: "+"
} }
KeyboardKey { KeyboardKey {
@@ -15,14 +15,14 @@ Item {
implicitWidth: mainLayout.implicitWidth implicitWidth: mainLayout.implicitWidth
implicitHeight: mainLayout.implicitHeight implicitHeight: mainLayout.implicitHeight
ColumnLayout { Column {
id: mainLayout id: mainLayout
spacing: root.spacing spacing: root.spacing
Repeater { // Main table rows Repeater { // Main table rows
model: root.elements model: root.elements
delegate: RowLayout { // Table cells delegate: Row { // Table cells
id: tableRow id: tableRow
spacing: root.spacing spacing: root.spacing
required property var modelData required property var modelData
@@ -47,7 +47,7 @@ Item {
Repeater { // Main table rows Repeater { // Main table rows
model: root.series model: root.series
delegate: RowLayout { // Table cells delegate: Row { // Table cells
id: seriesTableRow id: seriesTableRow
spacing: root.spacing spacing: root.spacing
required property var modelData required property var modelData
@@ -1,3 +1,4 @@
pragma ComponentBehavior: Bound
import qs.modules.common import qs.modules.common
import qs.modules.common.widgets import qs.modules.common.widgets
import qs.services import qs.services
@@ -153,8 +154,8 @@ Scope {
required property MprisPlayer modelData required property MprisPlayer modelData
player: modelData player: modelData
visualizerPoints: root.visualizerPoints visualizerPoints: root.visualizerPoints
implicitWidth: widgetWidth implicitWidth: root.widgetWidth
implicitHeight: widgetHeight implicitHeight: root.widgetHeight
radius: root.popupRounding radius: root.popupRounding
} }
} }
@@ -80,7 +80,7 @@ Item { // Bar content region
} }
} }
ColumnLayout { // Middle section Column { // Middle section
id: middleSection id: middleSection
anchors.centerIn: parent anchors.centerIn: parent
spacing: 4 spacing: 4
@@ -157,8 +157,6 @@ Item { // Bar content region
Layout.fillHeight: false Layout.fillHeight: false
} }
} }
} }
+11 -13
View File
@@ -74,10 +74,10 @@ ShellRoot {
} }
implicitWidth: regionInfoRow.implicitWidth + horizontalPadding * 2 implicitWidth: regionInfoRow.implicitWidth + horizontalPadding * 2
implicitHeight: regionInfoRow.implicitHeight + verticalPadding * 2 implicitHeight: regionInfoRow.implicitHeight + verticalPadding * 2
RowLayout { Row {
id: regionInfoRow id: regionInfoRow
anchors.centerIn: parent anchors.centerIn: parent
spacing: 8 spacing: 4
Loader { Loader {
id: regionIconLoader id: regionIconLoader
@@ -430,21 +430,19 @@ ShellRoot {
implicitWidth: instructionsRow.implicitWidth + 10 * 2 implicitWidth: instructionsRow.implicitWidth + 10 * 2
implicitHeight: instructionsRow.implicitHeight + 5 * 2 implicitHeight: instructionsRow.implicitHeight + 5 * 2
RowLayout { Row {
id: instructionsRow id: instructionsRow
anchors.centerIn: parent anchors.centerIn: parent
Item { spacing: 4
Layout.fillHeight: true MaterialSymbol {
implicitWidth: screenshotRegionIcon.implicitWidth id: screenshotRegionIcon
MaterialSymbol { // anchors.centerIn: parent
id: screenshotRegionIcon iconSize: Appearance.font.pixelSize.larger
anchors.centerIn: parent text: "screenshot_region"
iconSize: Appearance.font.pixelSize.larger color: root.genericContentForeground
text: "screenshot_region"
color: root.genericContentForeground
}
} }
StyledText { StyledText {
anchors.verticalCenter: parent.verticalCenter
text: Translation.tr("Drag or click a region • LMB: Copy • RMB: Edit") text: Translation.tr("Drag or click a region • LMB: Copy • RMB: Edit")
color: root.genericContentForeground color: root.genericContentForeground
} }