added adaptive quickshell
This commit is contained in:
1 parent
6eb56d2065
commit
5b33a73fd8
189 files changed
+8678
-15
No files matched your search
@@ -0,0 +1,153 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import "services"
|
||||
|
||||
ScrollView {
|
||||
id: root
|
||||
contentWidth: availableWidth
|
||||
clip: true
|
||||
BrightnessController { id: brightness }
|
||||
DisplayController { id: displays }
|
||||
DisplayPreview { id: preview }
|
||||
ColumnLayout {
|
||||
width: root.availableWidth
|
||||
spacing: 16
|
||||
Label { text: "Дисплей и яркость"; font.pixelSize: 24; font.bold: true; color: Theme.primary }
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: "Управление подсветкой встроенных дисплеев через brightnessctl. Внешние мониторы DDC/CI пока не поддерживаются."
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.outline
|
||||
}
|
||||
Label { text: "Подключённые мониторы"; font.pixelSize: 20; font.bold: true; color: Theme.foreground }
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: "Изменения разрешения, масштаба, ориентации и позиции применяются временно. Если не подтвердить их за 20 секунд, исходные параметры будут восстановлены. Постоянные правила Hyprland не изменяются."
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.outline
|
||||
}
|
||||
Repeater {
|
||||
model: displays.monitors
|
||||
ColumnLayout {
|
||||
id: monitorCard
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
spacing: 4
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: monitorCard.modelData.name + (monitorCard.modelData.focused ? " · активный" : "")
|
||||
font.bold: true
|
||||
color: Theme.foreground
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: monitorCard.modelData.description
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.outline
|
||||
}
|
||||
Label {
|
||||
text: monitorCard.modelData.width + " × " + monitorCard.modelData.height + " · " + monitorCard.modelData.refreshRate + " Гц · масштаб " + monitorCard.modelData.scale
|
||||
color: Theme.foreground
|
||||
}
|
||||
Label {
|
||||
text: "Позиция: " + monitorCard.modelData.x + ", " + monitorCard.modelData.y + " · transform: " + monitorCard.modelData.transform
|
||||
color: Theme.outline
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: "Позиция X:"; color: Theme.foreground }
|
||||
SpinBox {
|
||||
id: posX
|
||||
from: -100000; to: 100000
|
||||
value: monitorCard.modelData.x
|
||||
editable: true
|
||||
enabled: !preview.busy && preview.token === ""
|
||||
}
|
||||
Label { text: "Y:"; color: Theme.foreground }
|
||||
SpinBox {
|
||||
id: posY
|
||||
from: -100000; to: 100000
|
||||
value: monitorCard.modelData.y
|
||||
editable: true
|
||||
enabled: !preview.busy && preview.token === ""
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
ComboBox {
|
||||
id: modePicker
|
||||
Layout.fillWidth: true
|
||||
model: monitorCard.modelData.availableModes
|
||||
enabled: !preview.busy && preview.token === "" && count > 0
|
||||
}
|
||||
ComboBox {
|
||||
id: scalePicker
|
||||
model: ["1", "1.25", "1.5", "1.75", "2", "2.5", "3"]
|
||||
Component.onCompleted: currentIndex = Math.max(0, model.indexOf(String(monitorCard.modelData.scale)))
|
||||
enabled: !preview.busy && preview.token === ""
|
||||
}
|
||||
ComboBox {
|
||||
id: rotationPicker
|
||||
model: ["0°", "90°", "180°", "270°"]
|
||||
Component.onCompleted: currentIndex = Math.max(0, Math.min(3, Number(monitorCard.modelData.transform)))
|
||||
enabled: !preview.busy && preview.token === ""
|
||||
}
|
||||
Button {
|
||||
text: "Применить"
|
||||
enabled: modePicker.currentText !== "" && !preview.busy && preview.token === ""
|
||||
onClicked: preview.preview(monitorCard.modelData.name, modePicker.currentText.replace("Hz", ""), scalePicker.currentText, rotationPicker.currentIndex, posX.value, posY.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
visible: preview.token !== ""
|
||||
text: "Подтвердите новые параметры дисплея: осталось " + preview.secondsRemaining + " с"
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.foreground
|
||||
}
|
||||
Button {
|
||||
text: "Сохранить текущие параметры"
|
||||
visible: preview.token !== ""
|
||||
enabled: !preview.busy && preview.secondsRemaining > 0
|
||||
onClicked: preview.confirm()
|
||||
}
|
||||
Label { Layout.fillWidth: true; visible: preview.error !== ""; text: preview.error; wrapMode: Text.Wrap; color: "#d04040" }
|
||||
Label { visible: displays.monitors.length === 0 && displays.error === ""; text: "Мониторы не обнаружены"; color: Theme.outline }
|
||||
Label { Layout.fillWidth: true; visible: displays.error !== ""; text: displays.error; wrapMode: Text.Wrap; color: "#d04040" }
|
||||
Button { text: "Обновить дисплеи"; enabled: !displays.busy; onClicked: displays.refresh() }
|
||||
Label { text: "Яркость"; font.pixelSize: 20; font.bold: true; color: Theme.foreground }
|
||||
Repeater {
|
||||
model: brightness.devices
|
||||
ColumnLayout {
|
||||
id: displayCard
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
Label { text: displayCard.modelData.name + " · " + displayCard.modelData.percent + "%"; color: Theme.foreground }
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
from: 1; to: 100; stepSize: 1
|
||||
value: displayCard.modelData.percent
|
||||
enabled: !brightness.busy
|
||||
onMoved: brightness.setBrightness(displayCard.modelData.name, Math.round(value))
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
visible: brightness.devices.length === 0
|
||||
text: "Управляемая подсветка не обнаружена."
|
||||
color: Theme.outline
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
visible: brightness.error !== ""
|
||||
text: brightness.error
|
||||
wrapMode: Text.Wrap
|
||||
color: "#d04040"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user