Settings: cleanup Display
This commit is contained in:
parent
09706ccb28
commit
8b7d5d8b6a
1 changed files with 38 additions and 40 deletions
|
|
@ -2,60 +2,58 @@ import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import qs.Settings
|
|
||||||
import qs.Components
|
import qs.Components
|
||||||
|
import qs.Settings
|
||||||
|
|
||||||
ScrollView {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
// Get list of available monitors/screens
|
||||||
|
property var monitors: Quickshell.screens || []
|
||||||
|
|
||||||
|
// Sorted monitors by name
|
||||||
|
property var sortedMonitors: {
|
||||||
|
let sorted = [...monitors];
|
||||||
|
sorted.sort((a, b) => {
|
||||||
|
let nameA = a.name || "Unknown";
|
||||||
|
let nameB = b.name || "Unknown";
|
||||||
|
return nameA.localeCompare(nameB);
|
||||||
|
});
|
||||||
|
return sorted;
|
||||||
|
}
|
||||||
|
|
||||||
|
spacing: 0
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
padding: 0
|
anchors.margins: 0
|
||||||
rightPadding: 12
|
|
||||||
clip: true
|
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
||||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: root
|
|
||||||
width: parent.availableWidth
|
|
||||||
spacing: 0
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.margins: 0
|
|
||||||
|
|
||||||
// Get list of available monitors/screens
|
ScrollView {
|
||||||
property var monitors: Quickshell.screens || []
|
id: scrollView
|
||||||
|
|
||||||
// Sorted monitors by name
|
|
||||||
property var sortedMonitors: {
|
|
||||||
let sorted = [...monitors];
|
|
||||||
sorted.sort((a, b) => {
|
|
||||||
let nameA = a.name || "Unknown";
|
|
||||||
let nameB = b.name || "Unknown";
|
|
||||||
return nameA.localeCompare(nameB);
|
|
||||||
});
|
|
||||||
return sorted;
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
padding: 16
|
||||||
|
rightPadding: 12
|
||||||
|
clip: true
|
||||||
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
|
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 12
|
width: scrollView.availableWidth
|
||||||
Layout.fillWidth: true
|
spacing: 0
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "Monitor Selection"
|
text: "Monitor Selection"
|
||||||
font.pixelSize: 18 * Theme.uiScale
|
font.pixelSize: 18 * Theme.uiScale
|
||||||
font.bold: true
|
font.bold: true
|
||||||
color: Theme.textPrimary
|
color: Theme.textPrimary
|
||||||
Layout.bottomMargin: 8
|
Layout.bottomMargin: 16 * Theme.uiScale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 8
|
||||||
|
Layout.bottomMargin: 8
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
@ -159,6 +157,7 @@ ScrollView {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 8
|
Layout.topMargin: 8
|
||||||
|
Layout.bottomMargin: 8
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
@ -265,6 +264,7 @@ ScrollView {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 8
|
Layout.topMargin: 8
|
||||||
|
Layout.bottomMargin: 8
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
@ -365,11 +365,9 @@ ScrollView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue