Add glassMxrph shell sources
Initial commit of the Quickshell desktop suite: bar, dock, launcher, settings, Control Center, dashboard, OSD, lock screen, desktop widgets, plugin host with the vendored Noctalia/Omarchy compatibility layer, helpers, packaging, tests and phase documentation. Includes the optimization work so far: usage widgets and dashboard gauges no longer animate continuously, desktop widgets pause while covered, system controls stop flickering on background polls, dock app matching uses an indexed catalog, and workspace ghosts are created only for occupied slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
99e64a7713
433 files changed
+57792
No files matched your search
@@ -0,0 +1,862 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "../components"
|
||||
import "../services"
|
||||
import "../theme"
|
||||
import "../core"
|
||||
import "controls"
|
||||
import "pages" as Pages
|
||||
|
||||
// The layer surface is sized to the panel so compositor glass (HyprGlass)
|
||||
// shapes its refraction edges to the panel instead of to the whole screen.
|
||||
// While dragging it temporarily spans the screen, giving a stable pointer frame.
|
||||
// Runtime selects the concrete layer window.
|
||||
// qmllint disable uncreatable-type
|
||||
PanelWindow {
|
||||
// qmllint enable uncreatable-type
|
||||
id: root
|
||||
screen: ScreenService.current(ShellState.targetScreen)
|
||||
visible: ShellState.settingsOpen || panel.opacity > 0.01
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
bottom: root.dragging
|
||||
right: root.dragging
|
||||
}
|
||||
// Margins is present at runtime but unresolved in 0.3.1 qmltypes.
|
||||
// qmllint disable unqualified unresolved-type
|
||||
margins {
|
||||
left: root.dragging ? 0 : root.panelX
|
||||
top: root.dragging ? 0 : root.panelY
|
||||
}
|
||||
// qmllint enable unqualified unresolved-type
|
||||
implicitWidth: panel.width
|
||||
implicitHeight: panel.height
|
||||
color: Theme.transparent
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.namespace: "glassMxrph-settings"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.keyboardFocus: ShellState.settingsOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||
Component.onCompleted: ShellState.settingsWindow = root
|
||||
Component.onDestruction: ShellState.settingsWindow = null
|
||||
|
||||
readonly property int screenWidth: screen ? screen.width : 1920
|
||||
readonly property int screenHeight: screen ? screen.height : 1080
|
||||
readonly property bool wide: panel.width >= 780
|
||||
|
||||
// Placement: centred until the user drags the panel; double-click a header to recentre.
|
||||
property bool placed: false
|
||||
property real placedX: 0
|
||||
property real placedY: 0
|
||||
readonly property real panelX: Math.round(placed ? Math.max(0, Math.min(screenWidth - panel.width, placedX)) : (screenWidth - panel.width) / 2)
|
||||
readonly property real panelY: Math.round(placed ? Math.max(0, Math.min(screenHeight - panel.height, placedY)) : (screenHeight - panel.height) / 2)
|
||||
property bool dragging: false
|
||||
// True once the compositor has actually resized the surface to the screen.
|
||||
readonly property bool spanning: width > panel.width + 1
|
||||
property point dragStart
|
||||
property point dragOrigin
|
||||
function screenPoint(item, x, y) {
|
||||
const p = item.mapToItem(null, x, y);
|
||||
return spanning ? p : Qt.point(p.x + dragOrigin.x, p.y + dragOrigin.y);
|
||||
}
|
||||
function beginDrag(item, x, y) {
|
||||
dragOrigin = Qt.point(panelX, panelY);
|
||||
dragStart = screenPoint(item, x, y);
|
||||
placedX = panelX;
|
||||
placedY = panelY;
|
||||
placed = true;
|
||||
dragging = true;
|
||||
}
|
||||
function moveDrag(item, x, y) {
|
||||
if (!dragging)
|
||||
return;
|
||||
const p = screenPoint(item, x, y);
|
||||
placedX = dragOrigin.x + p.x - dragStart.x;
|
||||
placedY = dragOrigin.y + p.y - dragStart.y;
|
||||
}
|
||||
function endDrag() {
|
||||
dragging = false;
|
||||
}
|
||||
function recenter() {
|
||||
placed = false;
|
||||
}
|
||||
readonly property var currentPage: SettingsRegistry.page(ShellState.settingsPage) || SettingsRegistry.page("about")
|
||||
readonly property var currentGroup: SettingsRegistry.groups.find(g => g.id === currentPage.group) || null
|
||||
|
||||
// Sidebar entries: group captions followed by their pages.
|
||||
readonly property int captionHeight: 30
|
||||
readonly property int gapHeight: 12
|
||||
readonly property int itemHeight: 40
|
||||
readonly property int itemSpacing: 2
|
||||
readonly property var navEntries: {
|
||||
const entries = [];
|
||||
for (const group of SettingsRegistry.groups) {
|
||||
const pages = SettingsRegistry.pages.filter(p => p.group === group.id);
|
||||
if (pages.length === 0)
|
||||
continue;
|
||||
entries.push({
|
||||
kind: group.title ? "caption" : "gap",
|
||||
title: group.title
|
||||
});
|
||||
for (const p of pages)
|
||||
entries.push({
|
||||
kind: "page",
|
||||
page: p
|
||||
});
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
function entryHeight(entry) {
|
||||
return entry.kind === "page" ? itemHeight : entry.kind === "caption" ? captionHeight : gapHeight;
|
||||
}
|
||||
function entryY(pageId) {
|
||||
let y = 0;
|
||||
for (const entry of navEntries) {
|
||||
if (entry.kind === "page" && entry.page.id === pageId)
|
||||
return y;
|
||||
y += entryHeight(entry) + itemSpacing;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
function step(direction) {
|
||||
const ids = SettingsRegistry.pages.map(p => p.id);
|
||||
const index = ids.indexOf(ShellState.settingsPage);
|
||||
ShellState.openSettings(ids[(index + direction + ids.length) % ids.length]);
|
||||
}
|
||||
|
||||
// Search
|
||||
property bool searchActive: false
|
||||
property int searchIndex: 0
|
||||
readonly property var searchResults: SettingsRegistry.search(searchField.text)
|
||||
function openSearch() {
|
||||
searchActive = true;
|
||||
searchField.forceActiveFocus();
|
||||
}
|
||||
function closeSearch() {
|
||||
searchActive = false;
|
||||
searchField.clear();
|
||||
panel.forceActiveFocus();
|
||||
}
|
||||
function chooseResult(result) {
|
||||
if (!result)
|
||||
return;
|
||||
closeSearch();
|
||||
ShellState.revealSetting(result.page, result.setting);
|
||||
}
|
||||
onSearchResultsChanged: searchIndex = 0
|
||||
// Keep the selected sidebar entry in view.
|
||||
function revealNavEntry() {
|
||||
const y = entryY(ShellState.settingsPage);
|
||||
if (y < 0 || nav.height <= 0)
|
||||
return;
|
||||
if (y < nav.contentY)
|
||||
nav.contentY = y;
|
||||
else if (y + itemHeight > nav.contentY + nav.height)
|
||||
nav.contentY = Math.min(nav.contentHeight - nav.height, y + itemHeight - nav.height);
|
||||
}
|
||||
Connections {
|
||||
target: ShellState
|
||||
function onSettingsOpenChanged() {
|
||||
if (!ShellState.settingsOpen && root.searchActive)
|
||||
root.closeSearch();
|
||||
if (ShellState.settingsOpen)
|
||||
Qt.callLater(root.revealNavEntry);
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
// Clear the reveal request once matching rows have flashed.
|
||||
running: ShellState.settingsHighlight !== ""
|
||||
interval: 3000
|
||||
onTriggered: ShellState.settingsHighlight = ""
|
||||
}
|
||||
|
||||
// Drag handle for moving the panel; double-click recentres it.
|
||||
component DragArea: MouseArea {
|
||||
id: handle
|
||||
anchors.fill: parent
|
||||
cursorShape: pressed ? Qt.ClosedHandCursor : Qt.OpenHandCursor
|
||||
onPressed: mouse => root.beginDrag(handle, mouse.x, mouse.y)
|
||||
onPositionChanged: mouse => root.moveDrag(handle, mouse.x, mouse.y)
|
||||
onReleased: root.endDrag()
|
||||
onCanceled: root.endDrag()
|
||||
onDoubleClicked: root.recenter()
|
||||
}
|
||||
|
||||
// Hyprland routes every pointer event to a layer with exclusive keyboard
|
||||
// focus, so clicks outside the panel arrive here with out-of-bounds
|
||||
// coordinates. Qt Quick still delivers them to items extending past the
|
||||
// window, so this catcher (behind the panel) dismisses on outside clicks.
|
||||
MouseArea {
|
||||
objectName: "settingsOutside"
|
||||
x: -20000
|
||||
y: -20000
|
||||
width: 40000
|
||||
height: 40000
|
||||
onPressed: ShellState.settingsOpen = false
|
||||
}
|
||||
GlassPopup {
|
||||
id: panel
|
||||
objectName: "settingsSurface"
|
||||
opened: ShellState.settingsOpen
|
||||
x: root.spanning ? root.panelX : 0
|
||||
y: root.spanning ? root.panelY : 0
|
||||
width: Math.min(1080, root.screenWidth - 40)
|
||||
height: Math.min(780, root.screenHeight - 40)
|
||||
focus: ShellState.settingsOpen
|
||||
onOpenedChanged: if (opened)
|
||||
forceActiveFocus()
|
||||
Keys.onEscapePressed: ShellState.settingsOpen = false
|
||||
Keys.onPressed: event => {
|
||||
if (event.modifiers & Qt.ControlModifier) {
|
||||
if (event.key === Qt.Key_F) {
|
||||
root.openSearch();
|
||||
event.accepted = true;
|
||||
} else if (event.key === Qt.Key_PageDown || event.key === Qt.Key_Tab) {
|
||||
root.step(1);
|
||||
event.accepted = true;
|
||||
} else if (event.key === Qt.Key_PageUp || event.key === Qt.Key_Backtab) {
|
||||
root.step(-1);
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
}
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
// Sidebar
|
||||
Rectangle {
|
||||
id: sidebar
|
||||
visible: root.wide
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: 252
|
||||
topLeftRadius: panel.radius
|
||||
bottomLeftRadius: panel.radius
|
||||
color: Qt.alpha(Theme.tint, 0.15)
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 14
|
||||
spacing: 12
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 36
|
||||
DragArea {
|
||||
objectName: "settingsDragHandle"
|
||||
}
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 6
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Settings"
|
||||
color: Theme.text
|
||||
font.pixelSize: 17
|
||||
font.weight: Font.DemiBold
|
||||
opacity: root.searchActive ? 0 : 1
|
||||
scale: root.searchActive ? 0.92 : 1
|
||||
visible: opacity > 0.01
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Behavior on scale {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
// The search button widens into the search field.
|
||||
Item {
|
||||
id: searchMorph
|
||||
property real progress: root.searchActive ? 1 : 0
|
||||
Behavior on progress {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 36 + (parent.width - 36) * progress
|
||||
height: 36
|
||||
clip: true
|
||||
GlassTextField {
|
||||
id: searchField
|
||||
objectName: "settingsSearch"
|
||||
anchors.fill: parent
|
||||
leftPadding: 36
|
||||
rightPadding: 36
|
||||
placeholderText: "Search settings…"
|
||||
opacity: searchMorph.progress
|
||||
enabled: root.searchActive
|
||||
background: Rectangle {
|
||||
radius: height / 2
|
||||
color: Theme.surfaceVariant
|
||||
border.color: searchField.activeFocus ? Theme.accent : Theme.border
|
||||
}
|
||||
Keys.onEscapePressed: root.closeSearch()
|
||||
Keys.onDownPressed: root.searchIndex = Math.min(root.searchResults.length - 1, root.searchIndex + 1)
|
||||
Keys.onUpPressed: root.searchIndex = Math.max(0, root.searchIndex - 1)
|
||||
Keys.onReturnPressed: root.chooseResult(root.searchResults[root.searchIndex])
|
||||
Keys.onEnterPressed: root.chooseResult(root.searchResults[root.searchIndex])
|
||||
}
|
||||
Rectangle {
|
||||
width: 36
|
||||
height: 36
|
||||
radius: 18
|
||||
color: !root.searchActive && searchButton.containsMouse ? Qt.alpha(Theme.text, 0.1) : Theme.transparent
|
||||
GlassIcon {
|
||||
anchors.centerIn: parent
|
||||
glyph: ""
|
||||
fallback: "⌕"
|
||||
size: 28
|
||||
glyphSize: 16
|
||||
color: Theme.transparent
|
||||
border.width: 0
|
||||
glyphColor: root.searchActive ? Theme.textSecondary : Theme.text
|
||||
}
|
||||
MouseArea {
|
||||
id: searchButton
|
||||
objectName: "settingsSearchButton"
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.searchActive ? searchField.forceActiveFocus() : root.openSearch()
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
anchors.right: parent.right
|
||||
width: 36
|
||||
height: 36
|
||||
radius: 18
|
||||
visible: searchMorph.progress > 0.5
|
||||
opacity: searchMorph.progress
|
||||
color: closeSearchArea.containsMouse ? Qt.alpha(Theme.text, 0.1) : Theme.transparent
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "×"
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 18
|
||||
}
|
||||
MouseArea {
|
||||
id: closeSearchArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.closeSearch()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
// Navigation
|
||||
Flickable {
|
||||
id: nav
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
contentHeight: navColumn.implicitHeight
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
opacity: root.searchActive ? 0 : 1
|
||||
visible: opacity > 0.01
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
}
|
||||
}
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AsNeeded
|
||||
opacity: active ? 1 : 0
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
}
|
||||
}
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 3
|
||||
radius: 2
|
||||
color: Qt.alpha(Theme.text, 0.2)
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: activeHighlight
|
||||
readonly property real target: root.entryY(ShellState.settingsPage)
|
||||
visible: target >= 0
|
||||
width: nav.width
|
||||
height: root.itemHeight
|
||||
y: target
|
||||
radius: Math.max(10, Theme.radius * 0.55)
|
||||
color: Theme.accent
|
||||
Behavior on y {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration * 1.3
|
||||
easing.type: Easing.OutQuint
|
||||
}
|
||||
}
|
||||
}
|
||||
Column {
|
||||
id: navColumn
|
||||
width: nav.width
|
||||
spacing: root.itemSpacing
|
||||
Repeater {
|
||||
model: root.navEntries
|
||||
Item {
|
||||
id: entry
|
||||
required property var modelData
|
||||
readonly property bool isPage: modelData.kind === "page"
|
||||
readonly property bool selected: isPage && modelData.page.id === ShellState.settingsPage
|
||||
width: navColumn.width
|
||||
height: root.entryHeight(modelData)
|
||||
Text {
|
||||
visible: entry.modelData.kind === "caption"
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 8
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 6
|
||||
text: String(entry.modelData.title || "").toUpperCase()
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 10
|
||||
font.weight: Font.DemiBold
|
||||
font.letterSpacing: 1.2
|
||||
}
|
||||
Rectangle {
|
||||
visible: entry.isPage
|
||||
anchors.fill: parent
|
||||
radius: activeHighlight.radius
|
||||
color: !entry.selected && itemArea.containsMouse ? Qt.alpha(Theme.text, 0.07) : Theme.transparent
|
||||
scale: itemArea.pressed ? 0.98 : 1
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.duration / 2
|
||||
}
|
||||
}
|
||||
Behavior on scale {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
easing.type: Easing.OutQuint
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
// Selected items shift right as the highlight lands.
|
||||
anchors.leftMargin: 6 + (entry.selected ? 3 * Theme.intensity : 0)
|
||||
anchors.rightMargin: 10
|
||||
spacing: 10
|
||||
Behavior on anchors.leftMargin {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration * 1.3
|
||||
easing.type: Easing.OutQuint
|
||||
}
|
||||
}
|
||||
GlassIcon {
|
||||
glyph: entry.isPage ? entry.modelData.page.icon : ""
|
||||
image: entry.isPage ? entry.modelData.page.image || "" : ""
|
||||
fallback: entry.isPage ? entry.modelData.page.title.charAt(0) : ""
|
||||
size: 28
|
||||
glyphSize: 15
|
||||
color: entry.selected ? Qt.alpha(Theme.accentText, 0.14) : Theme.surfaceVariant
|
||||
glyphColor: entry.selected ? Theme.accentText : Theme.text
|
||||
}
|
||||
Text {
|
||||
text: entry.isPage ? entry.modelData.page.title : ""
|
||||
color: entry.selected ? Theme.accentText : itemArea.containsMouse ? Theme.text : Qt.alpha(Theme.text, 0.82)
|
||||
font.pixelSize: 13
|
||||
font.weight: entry.selected ? Font.DemiBold : Font.Medium
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.duration / 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: itemArea
|
||||
objectName: entry.isPage ? "settingsNav-" + entry.modelData.page.id : ""
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ShellState.openSettings(entry.modelData.page.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Search results
|
||||
ListView {
|
||||
id: results
|
||||
objectName: "settingsSearchResults"
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
spacing: 4
|
||||
model: root.searchResults
|
||||
currentIndex: root.searchIndex
|
||||
opacity: root.searchActive ? 1 : 0
|
||||
visible: opacity > 0.01
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
highlightFollowsCurrentItem: false
|
||||
onCurrentIndexChanged: positionViewAtIndex(currentIndex, ListView.Contain)
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
}
|
||||
}
|
||||
delegate: Rectangle {
|
||||
id: result
|
||||
required property var modelData
|
||||
required property int index
|
||||
readonly property bool selected: index === root.searchIndex
|
||||
width: results.width
|
||||
height: 50
|
||||
radius: Math.max(10, Theme.radius * 0.55)
|
||||
color: selected ? Theme.accent : resultArea.containsMouse ? Qt.alpha(Theme.text, 0.08) : Theme.fill
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.duration / 2
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 8 + (result.selected ? 3 : 0)
|
||||
anchors.rightMargin: 10
|
||||
spacing: 10
|
||||
Behavior on anchors.leftMargin {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
easing.type: Easing.OutQuint
|
||||
}
|
||||
}
|
||||
GlassIcon {
|
||||
glyph: result.modelData.icon
|
||||
image: result.modelData.image || ""
|
||||
fallback: result.modelData.detail.charAt(0)
|
||||
size: 28
|
||||
glyphSize: 14
|
||||
color: result.selected ? Qt.alpha(Theme.accentText, 0.14) : Theme.surfaceVariant
|
||||
glyphColor: result.selected ? Theme.accentText : Theme.text
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 1
|
||||
Text {
|
||||
text: result.modelData.title
|
||||
color: result.selected ? Theme.accentText : Theme.text
|
||||
font.pixelSize: 12
|
||||
font.weight: Font.DemiBold
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: result.modelData.setting ? "in " + result.modelData.detail : result.modelData.detail
|
||||
color: result.selected ? Qt.alpha(Theme.accentText, 0.75) : Theme.textSecondary
|
||||
font.pixelSize: 10
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: resultArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onEntered: root.searchIndex = result.index
|
||||
onClicked: root.chooseResult(result.modelData)
|
||||
}
|
||||
}
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: root.searchActive && results.count === 0
|
||||
width: parent.width - 20
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: searchField.text.trim() ? "No settings match “" + searchField.text.trim() + "”" : "Type to search pages and settings"
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 12
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 6
|
||||
text: root.searchActive ? "↑↓ select · Enter open · Esc back" : "Ctrl+F search · Ctrl+Tab next page"
|
||||
color: Qt.alpha(Theme.textSecondary, 0.8)
|
||||
font.pixelSize: 10
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
visible: root.wide
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: 1
|
||||
color: Theme.border
|
||||
}
|
||||
|
||||
// Content
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.margins: 24
|
||||
Layout.rightMargin: 14
|
||||
spacing: 18
|
||||
// Page header, also a drag handle for the panel.
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: pageHeader.implicitHeight
|
||||
DragArea {}
|
||||
RowLayout {
|
||||
id: pageHeader
|
||||
anchors.fill: parent
|
||||
anchors.rightMargin: 10
|
||||
spacing: 14
|
||||
GlassIcon {
|
||||
glyph: root.currentPage.icon
|
||||
image: root.currentPage.image || ""
|
||||
fallback: root.currentPage.title.charAt(0)
|
||||
active: true
|
||||
size: 46
|
||||
glyphSize: 22
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 1
|
||||
Text {
|
||||
visible: !!root.currentGroup && root.currentGroup.title !== ""
|
||||
text: root.currentGroup ? root.currentGroup.title.toUpperCase() : ""
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 10
|
||||
font.weight: Font.DemiBold
|
||||
font.letterSpacing: 1.2
|
||||
}
|
||||
Text {
|
||||
text: root.currentPage.title
|
||||
color: Theme.text
|
||||
font.pixelSize: 22
|
||||
font.weight: Font.DemiBold
|
||||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Text {
|
||||
text: root.currentPage.description
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 12
|
||||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
GlassIconButton {
|
||||
text: "×"
|
||||
onClicked: ShellState.settingsOpen = false
|
||||
Accessible.name: "Close settings"
|
||||
}
|
||||
}
|
||||
}
|
||||
GlassComboBox {
|
||||
visible: !root.wide
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 10
|
||||
model: SettingsRegistry.pages
|
||||
textRole: "title"
|
||||
valueRole: "id"
|
||||
currentIndex: SettingsRegistry.pages.findIndex(p => p.id === ShellState.settingsPage)
|
||||
onActivated: ShellState.openSettings(currentValue)
|
||||
}
|
||||
Item {
|
||||
id: pageHost
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
clip: true
|
||||
property real enter: 1
|
||||
NumberAnimation {
|
||||
id: enterAnimation
|
||||
target: pageHost
|
||||
property: "enter"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: Theme.duration * 1.4
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
Connections {
|
||||
target: ShellState
|
||||
function onSettingsPageChanged() {
|
||||
enterAnimation.restart();
|
||||
Qt.callLater(root.revealNavEntry);
|
||||
}
|
||||
}
|
||||
Loader {
|
||||
id: page
|
||||
objectName: "settingsPageLoader"
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
y: (1 - pageHost.enter) * 14 * Theme.intensity
|
||||
opacity: pageHost.enter
|
||||
active: ConfigService.ready && ShellState.settingsOpen
|
||||
sourceComponent: {
|
||||
switch (ShellState.settingsPage) {
|
||||
case "metrics":
|
||||
return metrics;
|
||||
case "appearance":
|
||||
return appearance;
|
||||
case "wallpaper":
|
||||
return wallpaper;
|
||||
case "widgets":
|
||||
return widgets;
|
||||
case "bar":
|
||||
return bar;
|
||||
case "tray":
|
||||
return tray;
|
||||
case "dock":
|
||||
return dock;
|
||||
case "media":
|
||||
return media;
|
||||
case "osd":
|
||||
return osd;
|
||||
case "dashboard":
|
||||
return dashboardPage;
|
||||
case "plugins":
|
||||
return pluginsPage;
|
||||
case "launcher":
|
||||
return launcher;
|
||||
case "controlcenter":
|
||||
return controlcenter;
|
||||
case "network":
|
||||
return network;
|
||||
case "bluetooth":
|
||||
return bluetooth;
|
||||
case "audio":
|
||||
return audio;
|
||||
case "displays":
|
||||
return displays;
|
||||
case "notifications":
|
||||
return notifications;
|
||||
case "power":
|
||||
return power;
|
||||
case "lock":
|
||||
return lockPage;
|
||||
default:
|
||||
return about;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
visible: ConfigService.error !== ""
|
||||
text: ConfigService.error
|
||||
color: Theme.urgent
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: metrics
|
||||
Pages.Metrics {}
|
||||
}
|
||||
Component {
|
||||
id: appearance
|
||||
Pages.Appearance {}
|
||||
}
|
||||
Component {
|
||||
id: wallpaper
|
||||
Pages.Wallpaper {}
|
||||
}
|
||||
Component {
|
||||
id: widgets
|
||||
Pages.Widgets {}
|
||||
}
|
||||
Component {
|
||||
id: bar
|
||||
Pages.Bar {}
|
||||
}
|
||||
Component {
|
||||
id: tray
|
||||
SettingsPage {
|
||||
Pages.Tray {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: dock
|
||||
Pages.Dock {}
|
||||
}
|
||||
Component {
|
||||
id: media
|
||||
Pages.Media {}
|
||||
}
|
||||
Component {
|
||||
id: osd
|
||||
Pages.Osd {}
|
||||
}
|
||||
Component {
|
||||
id: launcher
|
||||
SettingsPage {
|
||||
Pages.Launcher {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: controlcenter
|
||||
Pages.ControlCenter {}
|
||||
}
|
||||
Component {
|
||||
id: network
|
||||
Pages.Network {}
|
||||
}
|
||||
Component {
|
||||
id: bluetooth
|
||||
Pages.Bluetooth {}
|
||||
}
|
||||
Component {
|
||||
id: audio
|
||||
Pages.Audio {}
|
||||
}
|
||||
Component {
|
||||
id: displays
|
||||
Pages.Displays {}
|
||||
}
|
||||
Component {
|
||||
id: notifications
|
||||
Pages.Notifications {}
|
||||
}
|
||||
Component {
|
||||
id: power
|
||||
Pages.Power {}
|
||||
}
|
||||
Component {
|
||||
id: pluginsPage
|
||||
Pages.Plugins {}
|
||||
}
|
||||
Component {
|
||||
id: dashboardPage
|
||||
Pages.Dashboard {}
|
||||
}
|
||||
Component {
|
||||
id: lockPage
|
||||
Pages.Lock {}
|
||||
}
|
||||
Component {
|
||||
id: about
|
||||
Pages.About {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import "../../components"
|
||||
import "../../core"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
import "../../services/SettingsLogic.js" as Logic
|
||||
Item {
|
||||
id: root
|
||||
objectName:"barEditor"
|
||||
implicitHeight: lanes.implicitHeight
|
||||
property var laneItems: []
|
||||
property string dragging: ""
|
||||
property string targetLane: ""
|
||||
property string beforeId: ""
|
||||
// Screen whose layout is edited; "" or a screen without its own layout edits the shared one.
|
||||
property string screenName: ""
|
||||
// Card whose options panel (cog) is open.
|
||||
property string expandedId: ""
|
||||
// Option fields for a module: built-in choice lists, or a plugin's
|
||||
// manifest schema (boolean / integer / number / string / choices).
|
||||
function fieldsFor(id) {
|
||||
if (!ModuleRegistry.isPlugin(id))
|
||||
return (ModuleRegistry.optionSchemas[id] || []).map(f => Object.assign({type:"choice"}, f));
|
||||
return PluginService.schema(String(id).slice(7)).filter(f => f && f.key).map(f => {
|
||||
const choices = Array.isArray(f.choices) ? f.choices : Array.isArray(f.options) ? f.options.map(o => typeof o === "object" ? o.value : o) : null;
|
||||
return Object.assign({}, f, {label: f.label || f.key, type: choices ? "choice" : (f.type || "string"), choices: choices || []});
|
||||
});
|
||||
}
|
||||
function valueOf(entry, field) {
|
||||
if (!ModuleRegistry.isPlugin(entry.id))
|
||||
return ModuleRegistry.option(entry, field.key);
|
||||
return PluginService.widgetSettings(String(entry.id).slice(7), entry.options)[field.key];
|
||||
}
|
||||
function setOption(entry, key, value) {
|
||||
root.save(Logic.editModule(root.modules, entry.id, "options", Object.assign({}, entry.options || {}, {[key]: value})));
|
||||
}
|
||||
readonly property var modules: BarLayout.modulesFor(screenName)
|
||||
function save(list) {
|
||||
BarLayout.save(screenName, list);
|
||||
}
|
||||
function updateDrag(source,x,y) {
|
||||
const p=source.mapToItem(root,x,y);
|
||||
ghost.x=p.x-70;ghost.y=p.y-22;
|
||||
targetLane="";beforeId="";
|
||||
for(let i=0;i<laneItems.length;i++) {
|
||||
const lane=laneItems[i],local=root.mapToItem(lane,p.x,p.y);
|
||||
if(local.x<0 || local.x>lane.width || local.y<0 || local.y>lane.height)continue;
|
||||
targetLane=lane.modelData;
|
||||
for(let j=0;j<lane.cards.count;j++) {
|
||||
const card=lane.cards.itemAt(j),q=root.mapToItem(card,p.x,p.y);
|
||||
if(q.y<card.height/2) {beforeId=card.modelData.id;break;}
|
||||
}
|
||||
}
|
||||
}
|
||||
function finish() {
|
||||
const id=dragging,lane=targetLane,before=beforeId;
|
||||
dragging="";targetLane="";beforeId="";
|
||||
if(id && lane)Qt.callLater(()=>root.save(Logic.dropModule(root.modules,id,lane,before)));
|
||||
}
|
||||
RowLayout {
|
||||
id: lanes
|
||||
anchors.left:parent.left;anchors.right:parent.right
|
||||
spacing:12
|
||||
Repeater {
|
||||
id: laneRepeater
|
||||
model:["left","center","right"]
|
||||
GlassPanel {
|
||||
id: lane
|
||||
Component.onCompleted: root.laneItems=root.laneItems.concat([lane])
|
||||
Component.onDestruction: root.laneItems=root.laneItems.filter(l=>l!==lane)
|
||||
required property string modelData
|
||||
property alias cards: cards
|
||||
objectName:"bar-lane-"+modelData
|
||||
Layout.fillWidth:true
|
||||
Layout.minimumWidth:130
|
||||
Layout.fillHeight:true
|
||||
implicitHeight:column.implicitHeight+32
|
||||
border.color:root.targetLane===modelData ? Theme.accent : Theme.border
|
||||
ColumnLayout {
|
||||
id:column
|
||||
anchors {left:parent.left;right:parent.right;top:parent.top;margins:10}
|
||||
spacing:8
|
||||
Text {text:lane.modelData.toUpperCase();color:Theme.textSecondary;font.pixelSize:11}
|
||||
Repeater {
|
||||
id:cards
|
||||
model:root.modules.filter(m=>m.position===lane.modelData)
|
||||
GlassPanel {
|
||||
id:card
|
||||
required property var modelData
|
||||
readonly property var schema:root.fieldsFor(modelData.id)
|
||||
readonly property var link:ModuleRegistry.settingsLinks[modelData.id] || null
|
||||
readonly property bool expanded:root.expandedId===modelData.id && schema.length>0
|
||||
Layout.fillWidth:true
|
||||
implicitHeight:52+(expanded ? optionsColumn.implicitHeight+4 : 0)
|
||||
Behavior on implicitHeight {NumberAnimation {duration:Theme.duration;easing.type:Easing.OutCubic}}
|
||||
clip:true
|
||||
radius:12
|
||||
HoverHandler {id:cardHover}
|
||||
opacity:root.dragging===modelData.id ? 0.35 : 1
|
||||
Rectangle {anchors.top:parent.top;width:parent.width;height:3;radius:2;color:Theme.accent;visible:root.targetLane===lane.modelData && root.beforeId===card.modelData.id}
|
||||
RowLayout {
|
||||
anchors {left:parent.left;right:parent.right;top:parent.top;margins:7}
|
||||
height:38;spacing:5
|
||||
Item {
|
||||
Layout.preferredWidth:24;Layout.fillHeight:true
|
||||
activeFocusOnTab:true
|
||||
Accessible.name:"Move "+card.modelData.id
|
||||
Accessible.role:Accessible.Button
|
||||
Text {anchors.centerIn:parent;text:"⠿";color:parent.activeFocus ? Theme.accent : Theme.textSecondary;font.pixelSize:24}
|
||||
MouseArea {
|
||||
id:grip
|
||||
objectName:"bar-drag-"+card.modelData.id
|
||||
anchors.fill:parent
|
||||
preventStealing:true
|
||||
cursorShape:pressed ? Qt.ClosedHandCursor : Qt.OpenHandCursor
|
||||
property point start
|
||||
onPressed:event=>{start=Qt.point(event.x,event.y);parent.forceActiveFocus();}
|
||||
onPositionChanged:event=>{
|
||||
if(!pressed)return;
|
||||
if(!root.dragging && Math.hypot(event.x-start.x,event.y-start.y)<8)return;
|
||||
root.dragging=card.modelData.id;root.updateDrag(grip,event.x,event.y);
|
||||
}
|
||||
onReleased:root.finish()
|
||||
onCanceled:{root.dragging="";root.targetLane="";}
|
||||
}
|
||||
Keys.onPressed:event=>{
|
||||
if(event.key===Qt.Key_Escape) {root.dragging="";root.targetLane="";event.accepted=true;}
|
||||
else if(event.modifiers & Qt.ControlModifier && [Qt.Key_Up,Qt.Key_Down].includes(event.key)) {
|
||||
root.save(Logic.moveModule(root.modules,card.modelData.id,event.key===Qt.Key_Up?-1:1));event.accepted=true;
|
||||
} else if(event.modifiers & Qt.AltModifier && [Qt.Key_Left,Qt.Key_Right].includes(event.key)) {
|
||||
const index=["left","center","right"].indexOf(lane.modelData)+(event.key===Qt.Key_Left?-1:1);
|
||||
if(index>=0 && index<3)root.save(Logic.dropModule(root.modules,card.modelData.id,["left","center","right"][index],""));event.accepted=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {text:ModuleRegistry.title(card.modelData.id);color:Theme.text;Layout.fillWidth:true;elide:Text.ElideRight;font.pixelSize:12}
|
||||
// Cog: module options inline, or the page that holds them.
|
||||
Rectangle {
|
||||
objectName:"bar-options-"+card.modelData.id
|
||||
visible:card.schema.length>0 || !!card.link
|
||||
implicitWidth:26;implicitHeight:26;radius:13
|
||||
color:card.expanded ? Qt.alpha(Theme.accent,0.3) : cogArea.containsMouse ? Theme.hover : Qt.alpha(Theme.text,0.06)
|
||||
Accessible.name:"Options for "+card.modelData.id
|
||||
Accessible.role:Accessible.Button
|
||||
Text {anchors.centerIn:parent;text:Icons.available ? "" : "⚙";font.family:Icons.available ? Icons.family : "";color:card.expanded || cogArea.containsMouse ? Theme.text : Theme.textSecondary;font.pixelSize:13}
|
||||
MouseArea {
|
||||
id:cogArea
|
||||
anchors.fill:parent
|
||||
hoverEnabled:true
|
||||
cursorShape:Qt.PointingHandCursor
|
||||
onClicked:{
|
||||
if(card.schema.length>0)root.expandedId=card.expanded ? "" : card.modelData.id;
|
||||
else if(card.link)ShellState.revealSetting(card.link.page,card.link.setting);
|
||||
}
|
||||
}
|
||||
}
|
||||
GlassToggle {objectName:"bar-enable-"+card.modelData.id;checked:card.modelData.enabled;onToggled:root.save(Logic.editModule(root.modules,card.modelData.id,"enabled",checked))}
|
||||
// Removed modules return to the "+" list below the lanes.
|
||||
Rectangle {
|
||||
objectName:"bar-remove-"+card.modelData.id
|
||||
// Shown on hover so narrow lanes keep room for the name.
|
||||
visible:cardHover.hovered || card.activeFocus
|
||||
implicitWidth:26;implicitHeight:26;radius:13
|
||||
color:removeArea.containsMouse ? Qt.alpha(Theme.urgent,0.25) : Qt.alpha(Theme.text,0.06)
|
||||
Accessible.name:"Remove "+card.modelData.id
|
||||
Accessible.role:Accessible.Button
|
||||
Text {anchors.centerIn:parent;text:"×";color:removeArea.containsMouse ? Theme.text : Theme.textSecondary;font.pixelSize:16}
|
||||
MouseArea {
|
||||
id:removeArea
|
||||
anchors.fill:parent
|
||||
hoverEnabled:true
|
||||
cursorShape:Qt.PointingHandCursor
|
||||
onClicked:root.save(Logic.removeModule(root.modules,card.modelData.id))
|
||||
}
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
id:optionsColumn
|
||||
visible:card.expanded
|
||||
anchors {left:parent.left;right:parent.right;top:parent.top;topMargin:50;leftMargin:12;rightMargin:10}
|
||||
spacing:6
|
||||
Repeater {
|
||||
model:card.schema
|
||||
RowLayout {
|
||||
id:optionRow
|
||||
required property var modelData
|
||||
readonly property var value:root.valueOf(card.modelData,modelData)
|
||||
Layout.fillWidth:true
|
||||
spacing:8
|
||||
Text {text:optionRow.modelData.label;color:Theme.textSecondary;font.pixelSize:11;Layout.fillWidth:true;elide:Text.ElideRight
|
||||
HoverHandler {id:labelHover}
|
||||
ToolTip.visible:labelHover.hovered && !!optionRow.modelData.description
|
||||
ToolTip.text:optionRow.modelData.description || ""
|
||||
ToolTip.delay:600}
|
||||
GlassComboBox {
|
||||
objectName:"bar-option-"+card.modelData.id+"-"+optionRow.modelData.key
|
||||
visible:optionRow.modelData.type==="choice"
|
||||
Layout.preferredWidth:110
|
||||
implicitHeight:30
|
||||
model:optionRow.modelData.choices.map(c=>({text:String(c).charAt(0).toUpperCase()+String(c).slice(1),value:c}))
|
||||
textRole:"text"
|
||||
valueRole:"value"
|
||||
currentIndex:optionRow.modelData.choices.indexOf(optionRow.value)
|
||||
onActivated:root.setOption(card.modelData,optionRow.modelData.key,currentValue)
|
||||
}
|
||||
GlassToggle {
|
||||
visible:optionRow.modelData.type==="boolean"
|
||||
checked:optionRow.value===true
|
||||
onToggled:root.setOption(card.modelData,optionRow.modelData.key,checked)
|
||||
}
|
||||
Text {
|
||||
visible:optionRow.modelData.type==="integer" || optionRow.modelData.type==="number"
|
||||
text:optionRow.value===undefined ? "" : String(optionRow.value)
|
||||
color:Theme.text;font.pixelSize:11
|
||||
Layout.preferredWidth:26;horizontalAlignment:Text.AlignRight
|
||||
}
|
||||
GlassSlider {
|
||||
visible:optionRow.modelData.type==="integer" || optionRow.modelData.type==="number"
|
||||
Layout.preferredWidth:90
|
||||
implicitHeight:26
|
||||
from:Number(optionRow.modelData.min !== undefined ? optionRow.modelData.min : 0)
|
||||
to:Number(optionRow.modelData.max !== undefined ? optionRow.modelData.max : 100)
|
||||
stepSize:Number(optionRow.modelData.step || (optionRow.modelData.type==="integer" ? 1 : 0.1))
|
||||
value:Number(optionRow.value || 0)
|
||||
onMoved:root.setOption(card.modelData,optionRow.modelData.key,optionRow.modelData.type==="integer" ? Math.round(value) : value)
|
||||
}
|
||||
GlassTextField {
|
||||
visible:optionRow.modelData.type==="string"
|
||||
Layout.preferredWidth:110
|
||||
implicitHeight:30
|
||||
text:optionRow.value===undefined ? "" : String(optionRow.value)
|
||||
onEditingFinished:root.setOption(card.modelData,optionRow.modelData.key,text)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {Layout.fillWidth:true;implicitHeight:3;radius:2;color:root.targetLane===lane.modelData && !root.beforeId ? Theme.accent : Theme.transparent}
|
||||
Text {text:cards.count ? "Drop to append" : "Drop a module here";color:Theme.textSecondary;font.pixelSize:11;Layout.fillWidth:true;wrapMode:Text.Wrap}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GlassPill {
|
||||
id:ghost
|
||||
z:100
|
||||
visible:!!root.dragging
|
||||
width:140;height:44
|
||||
color:Theme.surfaceVariant;border.color:Theme.accent
|
||||
Text {anchors.centerIn:parent;text:root.dragging;color:Theme.text}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
property string label
|
||||
property string setting
|
||||
property string error: ""
|
||||
Layout.fillWidth: true
|
||||
Text {
|
||||
text: root.label
|
||||
color: Theme.textSecondary
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
GlassTextField {
|
||||
Layout.fillWidth: true
|
||||
text: JSON.stringify(ConfigService.value(root.setting))
|
||||
onEditingFinished: {
|
||||
try {
|
||||
if (ConfigService.setValue(root.setting, JSON.parse(text))) {
|
||||
root.error = "";
|
||||
SystemService.refresh();
|
||||
} else
|
||||
root.error = ConfigService.error;
|
||||
} catch (e) {
|
||||
root.error = "Enter a JSON array of command arguments";
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
visible: !!root.error
|
||||
text: root.error
|
||||
color: Theme.urgent
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
ColumnLayout {
|
||||
id:root
|
||||
spacing:2
|
||||
SettingNote {text:GlassService.state.available ? "Global glass controls apply to the shell and other translucent applications. Explicit app/preset rules keep priority. Changes apply when you press Apply at the top of this page." : "HyprGlass is not available. Install a version matching your compositor to use these controls."}
|
||||
SettingRow {
|
||||
title:"Liquid glass preset"
|
||||
description:"Ghostty-like refraction with lighter shell surfaces"
|
||||
icon:""
|
||||
GlassButton {
|
||||
objectName:"glassMatchGhostty"
|
||||
text:"Match Ghostty’s liquid glass"
|
||||
onClicked:{
|
||||
const values={blur_strength:0.45,blur_iterations:2,refraction_strength:3,chromatic_aberration:0.45,fresnel_strength:0.5,specular_strength:0.8,edge_thickness:0.065,lens_distortion:0.25,brightness:0.95,contrast:1,saturation:1,vibrancy:0.15,adaptive_dim:0.2};
|
||||
ConfigService.setValue("hyprglass.values",values);
|
||||
ConfigService.setValue("appearance.glassOpacity",0.3);ConfigService.setValue("appearance.panelOpacity",0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
PreferenceToggle {label:"Enable global glass";setting:"hyprglass.effectEnabled"}
|
||||
PreferenceToggle {label:"Glass on shell/layers";setting:"hyprglass.layers"}
|
||||
Repeater {
|
||||
model:[{key:"blur_strength",label:"Blur",max:5},{key:"blur_iterations",label:"Blur passes",min:1,max:5,step:1},{key:"refraction_strength",label:"Refraction",max:8},{key:"chromatic_aberration",label:"Spectral highlights",max:1},{key:"fresnel_strength",label:"Edge glow",max:1},{key:"specular_strength",label:"Specular highlights",max:1},{key:"edge_thickness",label:"Rim thickness",max:0.15,step:0.005},{key:"lens_distortion",label:"Lens distortion",max:1},{key:"brightness",label:"Brightness",min:0.2,max:2},{key:"contrast",label:"Contrast",min:0.2,max:2},{key:"saturation",label:"Saturation",max:2},{key:"vibrancy",label:"Vibrancy",max:1},{key:"adaptive_dim",label:"Adaptive dimming",max:1}]
|
||||
PreferenceSlider {required property var modelData;label:modelData.label;setting:"hyprglass.values."+modelData.key;from:modelData.min || 0;to:modelData.max;step:modelData.step || 0.01}
|
||||
}
|
||||
SettingNote {visible:!!GlassService.state.namespaces || !!GlassService.state.exclusions || !!GlassService.state.overrides;text:"Existing layer allow/exclude lists or preset overrides are active. Those compositor rules remain authoritative."}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
|
||||
// Few short choices render as a segmented control, longer lists as a menu.
|
||||
SettingRow {
|
||||
id: root
|
||||
property string label
|
||||
property var choices: []
|
||||
readonly property bool segmented: choices.length > 1 && choices.length <= 4 && choices.join("").length <= 34
|
||||
title: label
|
||||
GlassSegmented {
|
||||
visible: root.segmented
|
||||
model: root.choices
|
||||
currentIndex: root.choices.indexOf(ConfigService.value(root.setting))
|
||||
onActivated: (index, value) => ConfigService.setValue(root.setting, value)
|
||||
}
|
||||
GlassComboBox {
|
||||
visible: !root.segmented
|
||||
Layout.preferredWidth: 240
|
||||
model: root.choices
|
||||
currentIndex: Math.max(0, root.choices.indexOf(ConfigService.value(root.setting)))
|
||||
onActivated: ConfigService.setValue(root.setting, currentText)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
import "../../components"
|
||||
|
||||
SettingRow {
|
||||
id: root
|
||||
property string label
|
||||
property real from: 0
|
||||
property real to: 1
|
||||
property real step: 0.01
|
||||
property string unit
|
||||
title: label
|
||||
GlassSlider {
|
||||
Layout.preferredWidth: 240
|
||||
from: root.from
|
||||
to: root.to
|
||||
stepSize: root.step
|
||||
value: Number(ConfigService.value(root.setting))
|
||||
onMoved: ConfigService.setValue(root.setting, Number((Math.round(value / root.step) * root.step).toFixed(6)))
|
||||
}
|
||||
Text {
|
||||
text: Number(ConfigService.value(root.setting)).toFixed(root.step < 0.01 ? 3 : root.step < 1 ? 2 : 0) + root.unit
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 12
|
||||
font.features: {
|
||||
"tnum": 1
|
||||
}
|
||||
horizontalAlignment: Text.AlignRight
|
||||
Layout.preferredWidth: 52
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import QtQuick
|
||||
import "../../services"
|
||||
import "../../components"
|
||||
|
||||
SettingRow {
|
||||
id: root
|
||||
property string label
|
||||
title: label
|
||||
clickable: enabled
|
||||
onClicked: ConfigService.setValue(setting, !ConfigService.value(setting))
|
||||
GlassToggle {
|
||||
checked: !!ConfigService.value(root.setting)
|
||||
onToggled: ConfigService.setValue(root.setting, checked)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../../theme"
|
||||
|
||||
// Secondary explanatory text inside a settings section.
|
||||
Text {
|
||||
property bool warning: false
|
||||
color: warning ? Theme.urgent : Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
wrapMode: Text.Wrap
|
||||
visible: text !== ""
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.topMargin: 2
|
||||
Layout.bottomMargin: 4
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import "../../components"
|
||||
import "../../core"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
|
||||
// One setting: optional icon, title and description on the left, control on the right.
|
||||
// Wide controls go in `below`. A bound `setting` gains a reset-to-default button once changed.
|
||||
Item {
|
||||
id: root
|
||||
property string title
|
||||
property string description
|
||||
property string icon
|
||||
property string setting
|
||||
property bool clickable: false
|
||||
default property alias control: controls.data
|
||||
property alias below: belowColumn.data
|
||||
signal clicked
|
||||
readonly property var defaultValue: setting ? setting.split(".").reduce((object, key) => object ? object[key] : undefined, ConfigService.defaults) : undefined
|
||||
readonly property bool modified: defaultValue !== undefined && JSON.stringify(ConfigService.value(setting)) !== JSON.stringify(defaultValue)
|
||||
property real flash: 0
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: Math.max(52, content.implicitHeight + 20)
|
||||
opacity: enabled ? 1 : 0.5
|
||||
|
||||
function matches(text) {
|
||||
const a = title.toLowerCase(), b = String(text).toLowerCase();
|
||||
return !!a && !!b && (a === b || a.startsWith(b) || b.startsWith(a));
|
||||
}
|
||||
function reveal() {
|
||||
// Untyped walk: the nearest Flickable ancestor scrolls the row into view.
|
||||
let parent = Object(root.parent);
|
||||
while (parent) {
|
||||
if (parent.contentY !== undefined && parent.contentItem && parent.contentHeight > parent.height) {
|
||||
const position = root.mapToItem(parent.contentItem, 0, 0);
|
||||
parent.contentY = Math.max(0, Math.min(parent.contentHeight - parent.height, position.y - parent.height / 3));
|
||||
break;
|
||||
}
|
||||
parent = parent.parent;
|
||||
}
|
||||
highlight.restart();
|
||||
}
|
||||
function checkHighlight() {
|
||||
if (ShellState.settingsHighlight && root.matches(ShellState.settingsHighlight))
|
||||
Qt.callLater(root.reveal);
|
||||
}
|
||||
Component.onCompleted: checkHighlight()
|
||||
Connections {
|
||||
target: ShellState
|
||||
function onSettingsHighlightSerialChanged() {
|
||||
root.checkHighlight();
|
||||
}
|
||||
}
|
||||
SequentialAnimation {
|
||||
id: highlight
|
||||
PauseAnimation {
|
||||
duration: 160
|
||||
}
|
||||
NumberAnimation {
|
||||
target: root
|
||||
property: "flash"
|
||||
to: 1
|
||||
duration: 320
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
PauseAnimation {
|
||||
duration: 1200
|
||||
}
|
||||
NumberAnimation {
|
||||
target: root
|
||||
property: "flash"
|
||||
to: 0
|
||||
duration: 800
|
||||
easing.type: Easing.InOutSine
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Math.max(8, Theme.radius * 0.5)
|
||||
color: area.containsMouse && root.clickable ? Qt.alpha(Theme.text, 0.07) : area.containsMouse ? Qt.alpha(Theme.text, 0.035) : Theme.transparent
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.duration / 2
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: Theme.accent
|
||||
opacity: root.flash * 0.22
|
||||
border.width: root.flash > 0 ? 1 : 0
|
||||
border.color: Qt.alpha(Theme.accent, root.flash)
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: area
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
acceptedButtons: root.clickable ? Qt.LeftButton : Qt.NoButton
|
||||
cursorShape: root.clickable ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
onClicked: root.clicked()
|
||||
}
|
||||
ColumnLayout {
|
||||
id: content
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.leftMargin: 12
|
||||
anchors.rightMargin: 12
|
||||
spacing: 10
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 12
|
||||
GlassIcon {
|
||||
visible: root.icon !== ""
|
||||
glyph: root.icon
|
||||
fallback: root.title.charAt(0)
|
||||
size: 32
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: 120
|
||||
spacing: 2
|
||||
Text {
|
||||
text: root.title
|
||||
visible: text !== ""
|
||||
color: Theme.text
|
||||
font.pixelSize: 13
|
||||
font.weight: Font.Medium
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: root.description
|
||||
visible: text !== ""
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
objectName: "reset-" + root.setting
|
||||
ToolTip.visible: resetArea.containsMouse
|
||||
ToolTip.delay: 500
|
||||
ToolTip.text: "Reset to default"
|
||||
visible: root.modified
|
||||
implicitWidth: 26
|
||||
implicitHeight: 26
|
||||
radius: 13
|
||||
color: resetArea.containsMouse ? Qt.alpha(Theme.accent, 0.25) : Qt.alpha(Theme.text, 0.06)
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "↺"
|
||||
color: resetArea.containsMouse ? Theme.text : Theme.textSecondary
|
||||
font.pixelSize: 14
|
||||
}
|
||||
MouseArea {
|
||||
id: resetArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ConfigService.setValue(root.setting, JSON.parse(JSON.stringify(root.defaultValue)))
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
id: controls
|
||||
spacing: 8
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
id: belowColumn
|
||||
visible: children.length > 0
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import "../../theme"
|
||||
|
||||
ScrollView {
|
||||
id: root
|
||||
default property alias content: column.data
|
||||
clip: true
|
||||
contentWidth: availableWidth
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AsNeeded
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 4
|
||||
radius: 2
|
||||
color: Qt.alpha(Theme.text, 0.25)
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
id: column
|
||||
width: root.availableWidth - 14
|
||||
spacing: 22
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../../theme"
|
||||
|
||||
// Titled card grouping related settings. `padded` suits free-form content
|
||||
// (buttons, notes, previews); rows carry their own padding.
|
||||
ColumnLayout {
|
||||
id: root
|
||||
property string title
|
||||
property string description
|
||||
property bool padded: false
|
||||
default property alias content: body.data
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
ColumnLayout {
|
||||
visible: root.title !== "" || root.description !== ""
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 4
|
||||
spacing: 2
|
||||
Text {
|
||||
text: root.title
|
||||
visible: text !== ""
|
||||
color: Theme.text
|
||||
font.pixelSize: 14
|
||||
font.weight: Font.DemiBold
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: root.description
|
||||
visible: text !== ""
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: body.implicitHeight + (root.padded ? 28 : 8)
|
||||
radius: Math.max(10, Theme.radius * 0.7)
|
||||
color: Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
ColumnLayout {
|
||||
id: body
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: root.padded ? 14 : 4
|
||||
spacing: root.padded ? 10 : 2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
|
||||
SettingsPage {
|
||||
SettingsSection {
|
||||
padded: true
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 16
|
||||
Image {
|
||||
objectName: "aboutCrest"
|
||||
Layout.preferredWidth: 96
|
||||
Layout.preferredHeight: 96
|
||||
source: Qt.resolvedUrl("../../assets/glassmxrph-256.png")
|
||||
sourceSize: Qt.size(192, 192)
|
||||
fillMode: Image.PreserveAspectFit
|
||||
smooth: true
|
||||
mipmap: true
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 3
|
||||
Text {
|
||||
text: "GlassMxrph"
|
||||
color: Theme.text
|
||||
font.pixelSize: 26
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
Text {
|
||||
text: "Portable Quickshell desktop suite for Hyprland"
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 12
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Environment"
|
||||
SettingRow {
|
||||
title: "Quickshell"
|
||||
description: "Tested release"
|
||||
Text {
|
||||
text: "0.3.1"
|
||||
color: Theme.textSecondary
|
||||
}
|
||||
}
|
||||
SettingRow {
|
||||
title: "Compositor"
|
||||
description: "Tested release"
|
||||
Text {
|
||||
text: "Hyprland 0.56.2"
|
||||
color: Theme.textSecondary
|
||||
}
|
||||
}
|
||||
SettingRow {
|
||||
title: "Icons"
|
||||
description: Icons.available ? "Using the installed " + Icons.family : "Install a Nerd Font (e.g. Symbols Nerd Font) for icon glyphs"
|
||||
Text {
|
||||
text: Icons.available ? "Nerd Font" : "Letters"
|
||||
color: Theme.textSecondary
|
||||
}
|
||||
}
|
||||
SettingRow {
|
||||
title: "Configuration"
|
||||
description: ConfigService.directory + "/config.json"
|
||||
Text {
|
||||
text: ConfigService.writable ? "Writable" : "Read-only"
|
||||
color: ConfigService.writable ? Theme.textSecondary : Theme.urgent
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Status"
|
||||
padded: true
|
||||
SettingNote {
|
||||
Layout.leftMargin: 0
|
||||
text: "Phase 9 · Glass and interaction polish. MPRIS media and system controls are available. Shared system metrics are available. HyprGlass is optional; host integration is separate."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
|
||||
// HyprGlass actions stay pinned above the scrolling preferences.
|
||||
ColumnLayout {
|
||||
spacing: 14
|
||||
Component.onCompleted: GlassService.probe()
|
||||
Rectangle {
|
||||
objectName: "glassActions"
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 14
|
||||
implicitHeight: actions.implicitHeight + 20
|
||||
radius: Math.max(10, Theme.radius * 0.7)
|
||||
color: Qt.alpha(Theme.accent, 0.12)
|
||||
border.width: 1
|
||||
border.color: Qt.alpha(Theme.accent, 0.35)
|
||||
RowLayout {
|
||||
id: actions
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
anchors.leftMargin: 12
|
||||
spacing: 12
|
||||
GlassIcon {
|
||||
glyph: ""
|
||||
fallback: "G"
|
||||
size: 32
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 1
|
||||
Text {
|
||||
text: "HyprGlass"
|
||||
color: Theme.text
|
||||
font.pixelSize: 13
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
Text {
|
||||
text: GlassService.error || GlassService.notice || (GlassService.state.available ? "Glass changes reach the desktop and apps when applied" : "HyprGlass is not available for this compositor")
|
||||
color: GlassService.error ? Theme.urgent : Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "glassRestore"
|
||||
text: "Restore previous"
|
||||
enabled: !GlassService.busy
|
||||
onClicked: GlassService.restore()
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "glassApply"
|
||||
text: GlassService.busy ? "Applying…" : "Apply"
|
||||
accented: true
|
||||
enabled: !!GlassService.state.available && !GlassService.busy
|
||||
onClicked: GlassService.apply(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsPage {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
SettingsSection {
|
||||
title: "Accent"
|
||||
PreferenceChoice {
|
||||
label: "Accent source"
|
||||
description: "Pick a colour, generate one from the wallpaper, or follow the system"
|
||||
icon: ""
|
||||
setting: "appearance.accentSource"
|
||||
choices: ["custom", "matugen", "system"]
|
||||
}
|
||||
SettingRow {
|
||||
visible: ThemeManager.source === "custom"
|
||||
title: "Custom accent"
|
||||
description: "Hex colour used across the shell"
|
||||
setting: "appearance.customAccent"
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 120
|
||||
color: Theme.text
|
||||
selectByMouse: true
|
||||
text: ConfigService.data.appearance.customAccent
|
||||
validator: RegularExpressionValidator {
|
||||
regularExpression: /#[0-9a-fA-F]{6}/
|
||||
}
|
||||
onEditingFinished: if (acceptableInput)
|
||||
ConfigService.setValue("appearance.customAccent", text)
|
||||
}
|
||||
below: GlassColorPicker {
|
||||
Layout.fillWidth: true
|
||||
selectedColor: ConfigService.data.appearance.customAccent
|
||||
onChosen: color => ConfigService.setValue("appearance.customAccent", color.toString())
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
text: ThemeManager.status !== ThemeManager.source ? ThemeManager.status : ""
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
visible: ThemeManager.source === "matugen"
|
||||
title: "Matugen"
|
||||
description: MatugenService.version || "Select an installed Matugen 4.2.x executable"
|
||||
SettingRow {
|
||||
title: "Executable"
|
||||
description: "matugen or an absolute executable path"
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 220
|
||||
text: ConfigService.data.matugen.executable
|
||||
placeholderText: "matugen"
|
||||
onEditingFinished: ConfigService.setValue("matugen.executable", text)
|
||||
}
|
||||
GlassButton {
|
||||
text: "Check"
|
||||
onClicked: MatugenService.probe()
|
||||
}
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Scheme"
|
||||
setting: "matugen.scheme"
|
||||
choices: MatugenService.schemes
|
||||
enabled: choices.length > 0
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Contrast"
|
||||
setting: "matugen.contrast"
|
||||
from: -1
|
||||
to: 1
|
||||
step: 0.1
|
||||
enabled: MatugenService.version !== ""
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Regenerate on wallpaper change"
|
||||
setting: "matugen.regenerateOnWallpaperChange"
|
||||
}
|
||||
SettingRow {
|
||||
title: "Palette"
|
||||
description: MatugenService.busy ? "Generating from the current wallpaper…" : "Generate a new palette from the current wallpaper"
|
||||
GlassButton {
|
||||
text: MatugenService.busy ? "Generating…" : "Regenerate"
|
||||
enabled: !MatugenService.busy
|
||||
onClicked: MatugenService.regenerate()
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: MatugenService.error
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Surfaces"
|
||||
description: "Transparency and shape of the shell’s own panels"
|
||||
SettingRow {
|
||||
title: "Glass tint"
|
||||
description: "Colour behind the glass, like Ghostty’s background. Black matches a black Ghostty background."
|
||||
icon: ""
|
||||
setting: "appearance.glassTint"
|
||||
Repeater {
|
||||
model: [
|
||||
{
|
||||
name: "Black",
|
||||
value: "#000000"
|
||||
},
|
||||
{
|
||||
name: "Graphite",
|
||||
value: "#1b1b1b"
|
||||
},
|
||||
{
|
||||
name: "Slate",
|
||||
value: "#171b20"
|
||||
}
|
||||
]
|
||||
Rectangle {
|
||||
id: swatch
|
||||
required property var modelData
|
||||
readonly property bool selected: ConfigService.data.appearance.glassTint.toLowerCase() === modelData.value
|
||||
objectName: "glassTint-" + modelData.name.toLowerCase()
|
||||
implicitWidth: 26
|
||||
implicitHeight: 26
|
||||
radius: 13
|
||||
color: modelData.value
|
||||
border.width: selected ? 2 : 1
|
||||
border.color: selected ? Theme.accent : Theme.border
|
||||
ToolTip.visible: swatchArea.containsMouse
|
||||
ToolTip.delay: 400
|
||||
ToolTip.text: modelData.name
|
||||
MouseArea {
|
||||
id: swatchArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ConfigService.setValue("appearance.glassTint", swatch.modelData.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 96
|
||||
text: ConfigService.data.appearance.glassTint
|
||||
validator: RegularExpressionValidator {
|
||||
regularExpression: /#[0-9a-fA-F]{6}/
|
||||
}
|
||||
onEditingFinished: if (acceptableInput)
|
||||
ConfigService.setValue("appearance.glassTint", text)
|
||||
}
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Glass opacity"
|
||||
description: "Bar, dock and cards"
|
||||
icon: ""
|
||||
setting: "appearance.glassOpacity"
|
||||
from: 0.15
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Panel opacity"
|
||||
description: "Popups, launcher and settings"
|
||||
icon: ""
|
||||
setting: "appearance.panelOpacity"
|
||||
from: 0.15
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Border opacity"
|
||||
icon: ""
|
||||
setting: "appearance.borderOpacity"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Corner radius"
|
||||
icon: ""
|
||||
setting: "appearance.radius"
|
||||
to: 48
|
||||
step: 1
|
||||
unit: " px"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Shadows"
|
||||
icon: ""
|
||||
setting: "appearance.shadows"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Glass highlights"
|
||||
description: "Subtle top sheen and rim light"
|
||||
icon: ""
|
||||
setting: "appearance.highlights"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Motion"
|
||||
PreferenceSlider {
|
||||
label: "Animation duration"
|
||||
icon: ""
|
||||
setting: "animation.duration"
|
||||
to: 1000
|
||||
step: 10
|
||||
unit: " ms"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Animation intensity"
|
||||
description: "Distance of slides, lifts and scale effects"
|
||||
icon: ""
|
||||
setting: "animation.intensity"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Reduced motion"
|
||||
description: "Disable animations everywhere"
|
||||
icon: ""
|
||||
setting: "animation.reducedMotion"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "HyprGlass"
|
||||
description: "Compositor glass for the desktop and applications. Surface opacity above controls the shell’s own transparency."
|
||||
GlassSettings {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../controlcenter/modules" as Modules
|
||||
import "../../services"
|
||||
|
||||
SettingsPage {
|
||||
Modules.Audio {
|
||||
detailed: true
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: SystemService.error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../core"
|
||||
import "../../theme"
|
||||
import "../../services/SettingsLogic.js" as Logic
|
||||
import "../../bar/modules" as Bar
|
||||
|
||||
SettingsPage {
|
||||
id: root
|
||||
// Screen whose bar is being edited; "" is the shared layout.
|
||||
property string editScreen: ""
|
||||
readonly property bool ownLayout: BarLayout.hasOwn(editScreen)
|
||||
readonly property var modules: BarLayout.modulesFor(editScreen)
|
||||
function edit(id, key, value) {
|
||||
BarLayout.save(editScreen, Logic.editModule(modules, id, key, value));
|
||||
}
|
||||
function move(id, direction) {
|
||||
BarLayout.save(editScreen, Logic.moveModule(modules, id, direction));
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Layout"
|
||||
PreferenceSlider {
|
||||
label: "Bar height"
|
||||
icon: ""
|
||||
setting: "bar.height"
|
||||
from: 32
|
||||
to: 80
|
||||
step: 1
|
||||
unit: " px"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Margin"
|
||||
description: "Gap between the bar and the screen edge"
|
||||
icon: ""
|
||||
setting: "bar.margin"
|
||||
from: 0
|
||||
to: 100
|
||||
step: 1
|
||||
unit: " px"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Modules"
|
||||
description: "Drag a module by its grip to reorder it or move it between lanes. Keyboard: Ctrl+↑/↓ reorders; Alt+←/→ changes lane."
|
||||
padded: true
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 12
|
||||
Text {
|
||||
text: "Screen"
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 12
|
||||
}
|
||||
GlassSegmented {
|
||||
objectName: "barScreenPicker"
|
||||
model: ["all screens"].concat(Quickshell.screens.map(s => s.name))
|
||||
currentIndex: root.editScreen ? model.indexOf(root.editScreen) : 0
|
||||
onActivated: (index, value) => root.editScreen = index === 0 ? "" : value
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
visible: root.editScreen !== ""
|
||||
text: "Separate layout"
|
||||
color: Theme.text
|
||||
font.pixelSize: 12
|
||||
}
|
||||
GlassToggle {
|
||||
objectName: "barOwnLayout"
|
||||
visible: root.editScreen !== ""
|
||||
checked: root.ownLayout
|
||||
onToggled: BarLayout.setOwn(root.editScreen, checked)
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
Layout.leftMargin: 0
|
||||
text: root.editScreen === "" ? (Object.keys(BarLayout.screens).length ? "Shared layout, used by every screen without its own: " + Quickshell.screens.map(s => s.name).filter(n => !BarLayout.hasOwn(n)).join(", ") : "One layout for every screen. Pick a screen to give it its own modules.") : root.ownLayout ? root.editScreen + " has its own modules; changes here only affect that bar." : root.editScreen + " uses the shared layout. Turn on Separate layout to change its modules on their own."
|
||||
}
|
||||
BarEditor {
|
||||
Layout.fillWidth: true
|
||||
screenName: root.editScreen
|
||||
opacity: root.editScreen === "" || root.ownLayout ? 1 : 0.45
|
||||
enabled: root.editScreen === "" || root.ownLayout
|
||||
}
|
||||
Flow {
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
visible: addRepeater.count > 0
|
||||
Repeater {
|
||||
id: addRepeater
|
||||
model: root.editScreen === "" || root.ownLayout ? ModuleRegistry.available.filter(id => !root.modules.some(m => m.id === id)) : []
|
||||
GlassButton {
|
||||
required property string modelData
|
||||
text: "+ " + ModuleRegistry.title(modelData)
|
||||
onClicked: BarLayout.save(root.editScreen, root.modules.concat([
|
||||
{
|
||||
id: modelData,
|
||||
position: modelData === "activeWindow" ? "center" : "right",
|
||||
enabled: true
|
||||
}
|
||||
]))
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
Layout.leftMargin: 0
|
||||
text: "The system button opens Control Center. Metrics pills share the collector configured under System Metrics."
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Clock"
|
||||
PreferenceToggle {
|
||||
label: "Show date"
|
||||
icon: ""
|
||||
setting: "bar.clock.showDate"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "24-hour time"
|
||||
icon: ""
|
||||
setting: "bar.clock.use24Hour"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Show seconds"
|
||||
icon: ""
|
||||
setting: "bar.clock.showSeconds"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Workspaces"
|
||||
PreferenceChoice {
|
||||
label: "Workspace style"
|
||||
description: "Numbers, roman numerals, dots (filled when occupied) or Pac-Man"
|
||||
icon: ""
|
||||
setting: "bar.workspaces.style"
|
||||
choices: ["numbers", "roman", "dots", "pacman"]
|
||||
}
|
||||
SettingRow {
|
||||
title: "Preview"
|
||||
description: "Live workspaces; the outline marks a workspace shown on another monitor"
|
||||
icon: ""
|
||||
// Below the text with the full card width; scaled down when wider (e.g. 20 roman numerals).
|
||||
below: Item {
|
||||
id: previewBox
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: preview.height * preview.scale
|
||||
Bar.WorkspacesModule {
|
||||
id: preview
|
||||
objectName: "workspacesPreview"
|
||||
barScreen: ScreenService.active
|
||||
transformOrigin: Item.TopLeft
|
||||
scale: Math.min(1, previewBox.width / width)
|
||||
}
|
||||
}
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Workspace count"
|
||||
icon: ""
|
||||
setting: "bar.workspaces.count"
|
||||
from: 1
|
||||
to: 20
|
||||
step: 1
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
SettingRow {
|
||||
title: "Tray"
|
||||
description: "Tray icons, hover menus and background"
|
||||
icon: ""
|
||||
clickable: true
|
||||
onClicked: ShellState.openSettings("tray")
|
||||
Text {
|
||||
text: "›"
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Bluetooth
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
|
||||
SettingsPage {
|
||||
SettingsSection {
|
||||
SettingRow {
|
||||
title: "Bluetooth"
|
||||
description: BluetoothService.adapter ? BluetoothService.summary : "No Bluetooth adapter"
|
||||
icon: ""
|
||||
GlassToggle {
|
||||
checked: BluetoothService.enabled
|
||||
enabled: !!BluetoothService.adapter && BluetoothService.adapter.state !== BluetoothAdapterState.Blocked
|
||||
onClicked: {
|
||||
BluetoothService.toggle();
|
||||
checked = Qt.binding(() => BluetoothService.enabled);
|
||||
}
|
||||
Accessible.name: "Bluetooth power"
|
||||
}
|
||||
}
|
||||
SettingRow {
|
||||
title: "Adapter"
|
||||
icon: ""
|
||||
GlassComboBox {
|
||||
Layout.preferredWidth: 240
|
||||
model: BluetoothService.adapters.map(a => a.name)
|
||||
currentIndex: BluetoothService.adapters.indexOf(BluetoothService.adapter)
|
||||
enabled: BluetoothService.adapters.length > 0
|
||||
onActivated: BluetoothService.adapterId = BluetoothService.adapters[currentIndex].adapterId
|
||||
}
|
||||
}
|
||||
SettingRow {
|
||||
title: "Pairing"
|
||||
description: "Pairing and PIN confirmation use the existing Bluetooth manager. Paired devices can connect here."
|
||||
icon: ""
|
||||
GlassButton {
|
||||
text: "Pair devices…"
|
||||
enabled: !SystemService.acting
|
||||
onClicked: SystemService.action("manager", "bluetooth", false)
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Devices"
|
||||
visible: devices.count > 0
|
||||
Repeater {
|
||||
id: devices
|
||||
model: BluetoothService.devices.filter(d => d.paired)
|
||||
SettingRow {
|
||||
id: entry
|
||||
required property var modelData
|
||||
title: modelData.name
|
||||
description: BluetoothDeviceState.toString(modelData.state) + (modelData.batteryAvailable ? " · " + Math.round(modelData.battery * 100) + "%" : "")
|
||||
icon: modelData.connected ? "" : ""
|
||||
GlassButton {
|
||||
text: entry.modelData.connected ? "Disconnect" : "Connect"
|
||||
accented: !entry.modelData.connected
|
||||
enabled: BluetoothService.enabled && !BluetoothService.pending
|
||||
onClicked: BluetoothService.connectDevice(entry.modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: BluetoothService.error
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: SystemService.error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../controlcenter"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
|
||||
SettingsPage {
|
||||
id: root
|
||||
function edit(index, enabled) {
|
||||
const list = ConfigService.data.controlCenter.modules.map(m => Object.assign({}, m));
|
||||
list[index].enabled = enabled;
|
||||
ConfigService.setValue("controlCenter.modules", list);
|
||||
}
|
||||
function move(index, step) {
|
||||
const list = ConfigService.data.controlCenter.modules.slice();
|
||||
const to = index + step;
|
||||
if (to < 0 || to >= list.length)
|
||||
return;
|
||||
const entry = list.splice(index, 1)[0];
|
||||
list.splice(to, 0, entry);
|
||||
ConfigService.setValue("controlCenter.modules", list);
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Panel"
|
||||
PreferenceSlider {
|
||||
label: "Panel width"
|
||||
icon: ""
|
||||
setting: "controlCenter.width"
|
||||
from: 320
|
||||
to: 600
|
||||
step: 10
|
||||
unit: " px"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Modules"
|
||||
description: "Enable, disable and order the Control Center cards"
|
||||
Repeater {
|
||||
model: ConfigService.data.controlCenter.modules
|
||||
SettingRow {
|
||||
id: card
|
||||
required property var modelData
|
||||
required property int index
|
||||
readonly property var entry: ControlRegistry.entry(modelData.id)
|
||||
title: entry ? entry.title : modelData.id + " (unavailable)"
|
||||
GlassIconButton {
|
||||
objectName: "control-up-" + card.modelData.id
|
||||
text: "↑"
|
||||
enabled: card.index > 0
|
||||
onClicked: root.move(card.index, -1)
|
||||
}
|
||||
GlassIconButton {
|
||||
objectName: "control-down-" + card.modelData.id
|
||||
text: "↓"
|
||||
enabled: card.index < ConfigService.data.controlCenter.modules.length - 1
|
||||
onClicked: root.move(card.index, 1)
|
||||
}
|
||||
GlassToggle {
|
||||
objectName: "control-enable-" + card.modelData.id
|
||||
checked: card.modelData.enabled
|
||||
onClicked: root.edit(card.index, checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
Flow {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 8
|
||||
spacing: 8
|
||||
visible: addRepeater.count > 0
|
||||
Repeater {
|
||||
id: addRepeater
|
||||
model: Object.keys(ControlRegistry.modules).filter(id => !ConfigService.data.controlCenter.modules.some(m => m.id === id))
|
||||
GlassButton {
|
||||
required property string modelData
|
||||
text: "+ " + ControlRegistry.modules[modelData].title
|
||||
onClicked: ConfigService.setValue("controlCenter.modules", ConfigService.data.controlCenter.modules.concat([
|
||||
{
|
||||
id: modelData,
|
||||
enabled: true
|
||||
}
|
||||
]))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
text: "Super+X can use the documented IPC binding. Existing keybinds are unchanged."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../core"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
|
||||
SettingsPage {
|
||||
id: root
|
||||
readonly property var options: ConfigService.data.dashboard
|
||||
readonly property var placements: ["top-left", "top-center", "top-right", "center"]
|
||||
function edit(index, enabled) {
|
||||
const list = options.tabs.map(t => Object.assign({}, t));
|
||||
list[index].enabled = enabled;
|
||||
ConfigService.setValue("dashboard.tabs", list);
|
||||
}
|
||||
function move(index, step) {
|
||||
const list = options.tabs.slice();
|
||||
const to = index + step;
|
||||
if (to < 0 || to >= list.length)
|
||||
return;
|
||||
const entry = list.splice(index, 1)[0];
|
||||
list.splice(to, 0, entry);
|
||||
ConfigService.setValue("dashboard.tabs", list);
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Dashboard"
|
||||
description: "A tabbed glass panel below the bar. Open it from the clock, with “glassmxrph dashboard [tab]”, or bind that to a key. ←/→, Tab and 1–4 switch tabs."
|
||||
PreferenceToggle {
|
||||
label: "Enable dashboard"
|
||||
icon: ""
|
||||
setting: "dashboard.enabled"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Open from clock"
|
||||
description: "Click the bar clock to toggle it"
|
||||
icon: ""
|
||||
setting: "dashboard.openFromClock"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Remember last tab"
|
||||
description: "Otherwise it opens on the first tab"
|
||||
icon: ""
|
||||
setting: "dashboard.rememberTab"
|
||||
}
|
||||
SettingRow {
|
||||
title: "Preview"
|
||||
icon: ""
|
||||
GlassButton {
|
||||
objectName: "dashboardOpenButton"
|
||||
text: "Open dashboard"
|
||||
enabled: root.options.enabled
|
||||
onClicked: ShellState.openDashboard("")
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Placement"
|
||||
PreferenceChoice {
|
||||
label: "Position"
|
||||
icon: ""
|
||||
setting: "dashboard.position"
|
||||
choices: root.placements
|
||||
}
|
||||
SettingRow {
|
||||
title: "Screen"
|
||||
description: "Click a spot to move the dashboard"
|
||||
icon: ""
|
||||
below: Item {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 150
|
||||
// Miniature screen with the bar and the four possible spots.
|
||||
Rectangle {
|
||||
id: screenPreview
|
||||
objectName: "dashboardPlacementPreview"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: 240
|
||||
height: 140
|
||||
radius: 10
|
||||
color: Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
Rectangle {
|
||||
x: 6
|
||||
y: 6
|
||||
width: parent.width - 12
|
||||
height: 8
|
||||
radius: 4
|
||||
color: Theme.surfaceVariant
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
}
|
||||
Repeater {
|
||||
model: root.placements
|
||||
Rectangle {
|
||||
id: spot
|
||||
required property string modelData
|
||||
readonly property bool active: root.options.position === modelData
|
||||
objectName: "dashboardSpot-" + modelData
|
||||
width: 64
|
||||
height: 38
|
||||
radius: 7
|
||||
x: modelData === "top-left" ? 10 : modelData === "top-right" ? screenPreview.width - width - 10 : (screenPreview.width - width) / 2
|
||||
y: modelData === "center" ? 76 : 22
|
||||
color: active ? Qt.alpha(Theme.accent, 0.55) : spotArea.containsMouse ? Theme.hover : Theme.transparent
|
||||
border.width: 1
|
||||
border.color: active ? Theme.accentVivid : Qt.alpha(Theme.text, 0.18)
|
||||
z: active ? 2 : 1
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.duration
|
||||
}
|
||||
}
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: spot.active || spotArea.containsMouse
|
||||
text: spot.modelData
|
||||
color: Theme.text
|
||||
font.pixelSize: 10
|
||||
}
|
||||
MouseArea {
|
||||
id: spotArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ConfigService.setValue("dashboard.position", spot.modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Tabs"
|
||||
description: "Order and visibility of the dashboard tabs"
|
||||
Repeater {
|
||||
model: root.options.tabs
|
||||
SettingRow {
|
||||
id: tabRow
|
||||
required property var modelData
|
||||
required property int index
|
||||
readonly property var entry: DashboardRegistry.entry(modelData.id)
|
||||
title: entry ? entry.title : modelData.id + " (unavailable)"
|
||||
description: entry ? entry.description : ""
|
||||
icon: entry ? entry.glyph : ""
|
||||
GlassIconButton {
|
||||
objectName: "dash-up-" + tabRow.modelData.id
|
||||
text: "↑"
|
||||
enabled: tabRow.index > 0
|
||||
onClicked: root.move(tabRow.index, -1)
|
||||
Accessible.name: "Move " + tabRow.title + " up"
|
||||
}
|
||||
GlassIconButton {
|
||||
objectName: "dash-down-" + tabRow.modelData.id
|
||||
text: "↓"
|
||||
enabled: tabRow.index < root.options.tabs.length - 1
|
||||
onClicked: root.move(tabRow.index, 1)
|
||||
Accessible.name: "Move " + tabRow.title + " down"
|
||||
}
|
||||
GlassToggle {
|
||||
objectName: "dash-enable-" + tabRow.modelData.id
|
||||
checked: tabRow.modelData.enabled
|
||||
// Keep at least one tab.
|
||||
enabled: !checked || root.options.tabs.filter(t => t.enabled).length > 1
|
||||
onClicked: root.edit(tabRow.index, checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
Flow {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 8
|
||||
spacing: 8
|
||||
visible: addRepeater.count > 0
|
||||
Repeater {
|
||||
id: addRepeater
|
||||
model: Object.keys(DashboardRegistry.tabs).filter(id => !root.options.tabs.some(t => t.id === id))
|
||||
GlassButton {
|
||||
required property string modelData
|
||||
text: "+ " + DashboardRegistry.tabs[modelData].title
|
||||
onClicked: ConfigService.setValue("dashboard.tabs", root.options.tabs.concat([
|
||||
{
|
||||
id: modelData,
|
||||
enabled: true
|
||||
}
|
||||
]))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Media"
|
||||
PreferenceToggle {
|
||||
label: "EasyEffects equalizer"
|
||||
description: EasyEffectsService.known && !EasyEffectsService.installed ? "EasyEffects is not installed" : "Ten-band equalizer and presets in the Media tab"
|
||||
icon: ""
|
||||
setting: "dashboard.easyEffects"
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
text: "The equalizer writes its own EasyEffects output preset, glassmxrph_eq, and starts EasyEffects in service mode when you apply. Restart and Shut down ask for confirmation."
|
||||
}
|
||||
Component.onCompleted: EasyEffectsService.refresh()
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../controlcenter/modules" as Modules
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
|
||||
SettingsPage {
|
||||
SettingNote {
|
||||
Layout.leftMargin: 4
|
||||
text: "Backlight brightness and Night Light. Display modes remain managed by Hyprland."
|
||||
}
|
||||
Modules.Brightness {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Modules.NightLight {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Brightness"
|
||||
PreferenceChoice {
|
||||
label: "Backlight device"
|
||||
icon: ""
|
||||
setting: "system.brightness.device"
|
||||
choices: ["auto"].concat(SystemService.state.brightness && SystemService.state.brightness.devices ? SystemService.state.brightness.devices.map(d => d.id) : [])
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Night Light"
|
||||
PreferenceSlider {
|
||||
label: "Night temperature"
|
||||
icon: ""
|
||||
setting: "system.nightLight.temperature"
|
||||
from: 1000
|
||||
to: 6500
|
||||
step: 100
|
||||
unit: " K"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Providers"
|
||||
description: "Optional providers: status commands return JSON; set commands accept {value} (brightness percent or temperature) and {enabled} (Night Light boolean). Empty arrays use brightnessctl and an already running wl-gammarelay. Commands run only when a control is used or while its panel is open."
|
||||
padded: true
|
||||
CommandPreference {
|
||||
label: "Brightness status arguments"
|
||||
setting: "system.brightness.statusCommand"
|
||||
}
|
||||
CommandPreference {
|
||||
label: "Brightness set arguments"
|
||||
setting: "system.brightness.setCommand"
|
||||
}
|
||||
CommandPreference {
|
||||
label: "Night Light status arguments"
|
||||
setting: "system.nightLight.statusCommand"
|
||||
}
|
||||
CommandPreference {
|
||||
label: "Night Light set arguments"
|
||||
setting: "system.nightLight.setCommand"
|
||||
}
|
||||
GlassButton {
|
||||
text: "Refresh providers"
|
||||
onClicked: SystemService.refresh()
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: SystemService.error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
import "../../dock"
|
||||
|
||||
SettingsPage {
|
||||
id: root
|
||||
readonly property var options: DockModel.options
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: ApplicationsService.error
|
||||
}
|
||||
SettingsSection {
|
||||
PreferenceToggle {
|
||||
label: "Enable dock"
|
||||
description: "Floating dock with pinned and running applications"
|
||||
icon: ""
|
||||
setting: "dock.enabled"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Placement"
|
||||
enabled: root.options.enabled
|
||||
PreferenceChoice {
|
||||
label: "Monitor"
|
||||
icon: ""
|
||||
setting: "dock.monitor"
|
||||
choices: ["primary"].concat(Quickshell.screens.map(s => s.name))
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Position"
|
||||
icon: ""
|
||||
setting: "dock.position"
|
||||
choices: ["bottom", "left", "right"]
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Visibility"
|
||||
description: "Intelligent hides only when a window overlaps the dock"
|
||||
icon: ""
|
||||
setting: "dock.visibility"
|
||||
choices: ["always", "auto", "intelligent"]
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Appearance"
|
||||
enabled: root.options.enabled
|
||||
PreferenceSlider {
|
||||
label: "Icon size"
|
||||
icon: ""
|
||||
setting: "dock.iconSize"
|
||||
from: 24
|
||||
to: 80
|
||||
step: 1
|
||||
unit: " px"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Spacing"
|
||||
icon: ""
|
||||
setting: "dock.spacing"
|
||||
from: 0
|
||||
to: 24
|
||||
step: 1
|
||||
unit: " px"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Margin"
|
||||
icon: ""
|
||||
setting: "dock.margin"
|
||||
from: 0
|
||||
to: 80
|
||||
step: 1
|
||||
unit: " px"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Magnification"
|
||||
description: "Enlarge icons near the pointer"
|
||||
icon: ""
|
||||
setting: "dock.magnification"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Magnification strength"
|
||||
icon: ""
|
||||
setting: "dock.magnificationStrength"
|
||||
enabled: root.options.magnification
|
||||
from: 0
|
||||
to: 0.8
|
||||
step: 0.05
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Animation speed"
|
||||
icon: ""
|
||||
setting: "dock.animationSpeed"
|
||||
from: 0.25
|
||||
to: 3
|
||||
step: 0.05
|
||||
unit: "×"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Behaviour"
|
||||
enabled: root.options.enabled
|
||||
PreferenceToggle {
|
||||
label: "Show running apps"
|
||||
description: "Include unpinned applications with open windows"
|
||||
icon: ""
|
||||
setting: "dock.showRunningApps"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Running indicators"
|
||||
icon: ""
|
||||
setting: "dock.runningIndicators"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Tooltips"
|
||||
icon: ""
|
||||
setting: "dock.tooltips"
|
||||
}
|
||||
SettingRow {
|
||||
title: "Terminal launcher"
|
||||
description: "JSON argument array for Terminal=true apps: your terminal executable and its execute flag. No terminal is assumed."
|
||||
icon: ""
|
||||
setting: "dock.terminalCommand"
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 240
|
||||
text: JSON.stringify(root.options.terminalCommand)
|
||||
placeholderText: "[]"
|
||||
onEditingFinished: {
|
||||
try {
|
||||
ConfigService.setValue("dock.terminalCommand", JSON.parse(text));
|
||||
} catch (error) {
|
||||
ApplicationsService.error = "Terminal launcher must be a JSON argument array.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Pinned applications"
|
||||
description: "Drag pinned icons in the dock, or use the arrows below."
|
||||
Repeater {
|
||||
model: root.options.pinnedApps
|
||||
SettingRow {
|
||||
id: pinned
|
||||
required property string modelData
|
||||
required property int index
|
||||
readonly property var entry: ApplicationsService.byId(modelData)
|
||||
title: entry ? entry.name : modelData + " (unavailable)"
|
||||
Image {
|
||||
source: ApplicationsService.icon(pinned.entry)
|
||||
sourceSize.width: 28
|
||||
sourceSize.height: 28
|
||||
Layout.preferredWidth: 28
|
||||
Layout.preferredHeight: 28
|
||||
Layout.rightMargin: 4
|
||||
}
|
||||
GlassIconButton {
|
||||
text: "↑"
|
||||
enabled: pinned.index > 0
|
||||
onClicked: DockModel.reorder(pinned.modelData, root.options.pinnedApps[pinned.index - 1])
|
||||
}
|
||||
GlassIconButton {
|
||||
text: "↓"
|
||||
enabled: pinned.index < root.options.pinnedApps.length - 1
|
||||
onClicked: DockModel.reorder(pinned.modelData, root.options.pinnedApps[pinned.index + 1])
|
||||
}
|
||||
GlassButton {
|
||||
text: "Unpin"
|
||||
onClicked: DockModel.unpin(pinned.modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
visible: root.options.pinnedApps.length === 0
|
||||
text: "No pinned applications yet."
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Pin an application"
|
||||
GlassTextField {
|
||||
id: search
|
||||
placeholderText: "Find an application to pin…"
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 8
|
||||
}
|
||||
Repeater {
|
||||
model: ApplicationsService.launchable.filter(e => e.name.toLowerCase().includes(search.text.toLowerCase()) && !root.options.pinnedApps.some(id => id.replace(/\.desktop$/i, "") === e.id.replace(/\.desktop$/i, ""))).slice(0, 30)
|
||||
SettingRow {
|
||||
id: app
|
||||
required property var modelData
|
||||
title: modelData.name
|
||||
description: modelData.comment || ""
|
||||
Image {
|
||||
source: ApplicationsService.icon(app.modelData)
|
||||
sourceSize.width: 28
|
||||
sourceSize.height: 28
|
||||
Layout.preferredWidth: 28
|
||||
Layout.preferredHeight: 28
|
||||
Layout.rightMargin: 4
|
||||
}
|
||||
GlassButton {
|
||||
text: "Pin"
|
||||
onClicked: DockModel.pin(app.modelData.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
|
||||
ColumnLayout {
|
||||
spacing: 22
|
||||
SettingsSection {
|
||||
title: "Search"
|
||||
description: "Search installed applications, or type > to find a Settings command. The launcher opens on the active monitor."
|
||||
PreferenceSlider {
|
||||
label: "Width"
|
||||
icon: ""
|
||||
setting: "launcher.width"
|
||||
from: 420
|
||||
to: 960
|
||||
step: 20
|
||||
unit: " px"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Maximum results"
|
||||
icon: ""
|
||||
setting: "launcher.maxResults"
|
||||
from: 10
|
||||
to: 100
|
||||
step: 1
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Show descriptions"
|
||||
description: "Show application comments under their names"
|
||||
icon: ""
|
||||
setting: "launcher.showDescriptions"
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
text: "Super+D / Super+Space: binding instructions are in docs/phase-4.md. Existing shortcuts have not been changed. Recent files are not indexed in this phase."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../lock"
|
||||
import "../../theme"
|
||||
import "../../services"
|
||||
|
||||
SettingsPage {
|
||||
SettingsSection {
|
||||
SettingRow {
|
||||
title: "Lock screen"
|
||||
description: "Check your password below before locking for the first time."
|
||||
icon: ""
|
||||
GlassButton {
|
||||
objectName: "lockPreview"
|
||||
text: "Preview"
|
||||
onClicked: LockState.preview()
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "lockNow"
|
||||
text: "Lock now"
|
||||
accented: true
|
||||
onClicked: LockState.lock()
|
||||
}
|
||||
}
|
||||
SettingRow {
|
||||
title: "Test password"
|
||||
description: LockState.testResult === "accepted" ? "Password accepted. Unlocking will work." : LockState.testResult === "rejected" ? "Password rejected. Check it, or the PAM service below." : LockState.testResult === "error" ? "Authentication is unavailable with this PAM service." : "Runs the same authentication as the lock screen, without locking."
|
||||
icon: ""
|
||||
GlassTextField {
|
||||
id: testPassword
|
||||
objectName: "lockTestPassword"
|
||||
Layout.preferredWidth: 200
|
||||
echoMode: TextInput.Password
|
||||
placeholderText: "Password"
|
||||
enabled: !LockState.busy
|
||||
onAccepted: {
|
||||
LockState.test(text);
|
||||
clear();
|
||||
}
|
||||
}
|
||||
GlassButton {
|
||||
text: LockState.busy ? "Checking…" : "Test"
|
||||
enabled: !LockState.busy && testPassword.text !== ""
|
||||
onClicked: {
|
||||
LockState.test(testPassword.text);
|
||||
testPassword.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Use for Lock buttons"
|
||||
description: "Control Center and the power menu lock with this screen instead of an external locker"
|
||||
icon: ""
|
||||
setting: "lock.enabled"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Appearance"
|
||||
PreferenceChoice {
|
||||
label: "Backdrop"
|
||||
description: "Your wallpaper, like macOS, or a snapshot of the desktop taken when locking"
|
||||
icon: ""
|
||||
setting: "lock.backdrop"
|
||||
choices: ["wallpaper", "screenshot"]
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Liquid glass"
|
||||
description: "Refraction, dispersion and highlights rendered on the lock screen itself, using your HyprGlass values"
|
||||
icon: ""
|
||||
setting: "lock.glass"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Now Playing"
|
||||
icon: ""
|
||||
setting: "lock.media"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Power buttons"
|
||||
description: "Sleep, Restart and Shut Down below the password field"
|
||||
icon: ""
|
||||
setting: "lock.powerButtons"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Authentication"
|
||||
SettingRow {
|
||||
title: "PAM service"
|
||||
description: "Blank uses the bundled password check (pam_unix). Or name a service in /etc/pam.d, such as hyprlock."
|
||||
icon: ""
|
||||
setting: "lock.pamService"
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 160
|
||||
text: LockState.options.pamService
|
||||
placeholderText: "bundled"
|
||||
onEditingFinished: ConfigService.setValue("lock.pamService", text.trim())
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Keybinds and recovery"
|
||||
padded: true
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.text
|
||||
font.family: "monospace"
|
||||
font.pixelSize: 11
|
||||
textFormat: Text.PlainText
|
||||
text: "bind = SUPER, L, exec, glassmxrph lock\n# hypridle: general { lock_cmd = glassmxrph lock }"
|
||||
}
|
||||
SettingNote {
|
||||
Layout.leftMargin: 0
|
||||
text: "If the shell ever stops while locked, Hyprland keeps the session locked. From another TTY (Ctrl+Alt+F3): hyprctl --instance 0 'keyword misc:allow_session_lock_restore 1', then start glassMxrph again and lock/unlock once."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
import "../../media"
|
||||
import "../../services/SettingsLogic.js" as Logic
|
||||
|
||||
SettingsPage {
|
||||
id: root
|
||||
function moduleOn(id) {
|
||||
return ConfigService.data.bar.modules.some(m => m.id === id && m.enabled);
|
||||
}
|
||||
// Adds the module to the centre lane the first time, then just toggles it.
|
||||
function setModule(id, on) {
|
||||
const modules = ConfigService.data.bar.modules;
|
||||
if (modules.some(m => m.id === id))
|
||||
ConfigService.setValue("bar.modules", Logic.editModule(modules, id, "enabled", on));
|
||||
else if (on)
|
||||
ConfigService.setValue("bar.modules", modules.concat([
|
||||
{
|
||||
id: id,
|
||||
position: "center",
|
||||
enabled: true
|
||||
}
|
||||
]));
|
||||
}
|
||||
SettingsSection {
|
||||
description: "Shared playback controls for all compatible MPRIS players."
|
||||
padded: true
|
||||
MediaCard {
|
||||
compact: true
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Bar"
|
||||
description: "Playback and an audio visualizer in the bar. Cava shows system audio, not only the selected player, and only runs while something plays."
|
||||
SettingRow {
|
||||
title: "Now playing"
|
||||
description: "Play/pause and the current track"
|
||||
icon: ""
|
||||
GlassToggle {
|
||||
objectName: "mediaBarNowPlaying"
|
||||
checked: root.moduleOn("nowPlaying")
|
||||
onToggled: root.setModule("nowPlaying", checked)
|
||||
}
|
||||
}
|
||||
SettingRow {
|
||||
title: "Visualizer"
|
||||
description: CavaService.error ? "Cava: " + CavaService.error : "Cava bars; click opens the dashboard's Media tab"
|
||||
icon: ""
|
||||
GlassToggle {
|
||||
objectName: "mediaBarCava"
|
||||
checked: root.moduleOn("cava")
|
||||
onToggled: root.setModule("cava", checked)
|
||||
}
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Visualizer bars"
|
||||
icon: ""
|
||||
setting: "bar.cava.bars"
|
||||
from: 4
|
||||
to: 24
|
||||
step: 1
|
||||
enabled: root.moduleOn("cava")
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Visualizer style"
|
||||
icon: ""
|
||||
setting: "bar.cava.style"
|
||||
choices: ["bars", "mirror"]
|
||||
enabled: root.moduleOn("cava")
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Hide while paused"
|
||||
description: "Collapse the visualizer when nothing is playing"
|
||||
icon: ""
|
||||
setting: "bar.cava.hideWhenIdle"
|
||||
enabled: root.moduleOn("cava")
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Media cards"
|
||||
description: "The player in the Control Center, dashboard and this page"
|
||||
PreferenceToggle {
|
||||
label: "Album artwork"
|
||||
icon: ""
|
||||
setting: "media.showAlbumArt"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Track progress"
|
||||
icon: ""
|
||||
setting: "media.showProgress"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Album name"
|
||||
icon: ""
|
||||
setting: "media.showAlbum"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Visualizer in cards"
|
||||
description: "Cava bars under the track"
|
||||
icon: ""
|
||||
setting: "media.showCava"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Player"
|
||||
PreferenceChoice {
|
||||
label: "Preferred player"
|
||||
icon: ""
|
||||
setting: "media.preferredPlayer"
|
||||
choices: ["automatic"].concat(MediaService.players.map(p => p.dbusName)).concat(MediaService.players.some(p => p.dbusName === ConfigService.data.media.preferredPlayer) || ConfigService.data.media.preferredPlayer === "automatic" ? [] : [ConfigService.data.media.preferredPlayer])
|
||||
}
|
||||
SettingRow {
|
||||
title: "Player ID"
|
||||
description: "Preferred MPRIS player ID, or automatic"
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 240
|
||||
text: ConfigService.data.media.preferredPlayer
|
||||
onEditingFinished: ConfigService.setValue("media.preferredPlayer", text || "automatic")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
import "../../metrics"
|
||||
|
||||
SettingsPage {
|
||||
SettingsSection {
|
||||
padded: true
|
||||
MetricsCard {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Collection"
|
||||
description: "GPU updates at most every 5 seconds; storage every 15 seconds. All views share one collector."
|
||||
PreferenceSlider {
|
||||
label: "Sampling interval"
|
||||
icon: ""
|
||||
setting: "metrics.interval"
|
||||
from: 1
|
||||
to: 30
|
||||
step: 1
|
||||
unit: " s"
|
||||
}
|
||||
SettingRow {
|
||||
title: "GPU"
|
||||
icon: ""
|
||||
setting: "metrics.gpu"
|
||||
GlassComboBox {
|
||||
Layout.preferredWidth: 240
|
||||
model: [
|
||||
{
|
||||
id: "auto",
|
||||
name: "Automatic"
|
||||
}
|
||||
].concat(MetricsService.gpus).concat(ConfigService.data.metrics.gpu === "auto" || MetricsService.gpus.some(g => g.id === ConfigService.data.metrics.gpu) ? [] : [
|
||||
{
|
||||
id: ConfigService.data.metrics.gpu,
|
||||
name: "Unavailable · " + ConfigService.data.metrics.gpu
|
||||
}
|
||||
])
|
||||
textRole: "name"
|
||||
valueRole: "id"
|
||||
currentIndex: model.findIndex(g => g.id === ConfigService.data.metrics.gpu)
|
||||
onActivated: ConfigService.setValue("metrics.gpu", currentValue)
|
||||
}
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Network interface"
|
||||
description: "Auto totals physical interfaces to avoid counting VPN/bridge traffic twice"
|
||||
icon: ""
|
||||
setting: "metrics.networkInterface"
|
||||
choices: Array.from(new Set(["auto", ConfigService.data.metrics.networkInterface].concat((MetricsService.network.interfaces || []).map(i => i.name))))
|
||||
}
|
||||
SettingRow {
|
||||
title: "Storage paths"
|
||||
description: "JSON array, up to eight local paths. Remote filesystem paths can block the collector."
|
||||
icon: ""
|
||||
setting: "metrics.storagePaths"
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 240
|
||||
text: JSON.stringify(ConfigService.data.metrics.storagePaths)
|
||||
onEditingFinished: {
|
||||
try {
|
||||
ConfigService.setValue("metrics.storagePaths", JSON.parse(text));
|
||||
} catch (e) {
|
||||
text = JSON.stringify(ConfigService.data.metrics.storagePaths);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
text: "Missing sensor values are shown as —. CPU temperature is the hottest supported CPU hwmon sensor. RAM usage excludes available cache; storage free includes reserved blocks."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Networking
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
|
||||
SettingsPage {
|
||||
Component.onCompleted: NetworkService.scanning = true
|
||||
Component.onDestruction: NetworkService.scanning = false
|
||||
SettingsSection {
|
||||
SettingRow {
|
||||
title: "Wi-Fi"
|
||||
description: NetworkService.available ? NetworkService.summary : "No Wi-Fi adapter. Wired connections and advanced options are available in your network manager."
|
||||
icon: ""
|
||||
GlassToggle {
|
||||
checked: NetworkService.enabled
|
||||
enabled: NetworkService.available && NetworkService.backend.wifiHardwareEnabled
|
||||
onClicked: {
|
||||
NetworkService.toggle();
|
||||
checked = Qt.binding(() => NetworkService.enabled);
|
||||
}
|
||||
Accessible.name: "Wi-Fi"
|
||||
}
|
||||
}
|
||||
SettingRow {
|
||||
title: "Advanced connections"
|
||||
description: "VPN, enterprise and wired settings in your network manager"
|
||||
icon: ""
|
||||
GlassButton {
|
||||
text: "Open…"
|
||||
enabled: !SystemService.acting
|
||||
onClicked: SystemService.action("manager", "network", false)
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Networks"
|
||||
visible: networks.count > 0
|
||||
Repeater {
|
||||
id: networks
|
||||
model: NetworkService.networks
|
||||
SettingRow {
|
||||
id: entry
|
||||
required property var modelData
|
||||
readonly property bool psk: [WifiSecurityType.WpaPsk, WifiSecurityType.Wpa2Psk, WifiSecurityType.Sae].includes(modelData.security)
|
||||
readonly property bool supported: modelData.known || modelData.device.type === DeviceType.Wired || modelData.security === WifiSecurityType.Open || psk
|
||||
title: modelData.name + " · " + modelData.device.name
|
||||
description: modelData.connected ? "Connected" : modelData.stateChanging ? "Connecting…" : modelData.known ? "Saved connection" : supported ? "Available" : "Use advanced connections for this security type"
|
||||
icon: modelData.connected ? "" : ""
|
||||
GlassTextField {
|
||||
id: password
|
||||
visible: entry.psk && !entry.modelData.known && !entry.modelData.connected
|
||||
echoMode: TextInput.Password
|
||||
placeholderText: "Wi-Fi password"
|
||||
Layout.preferredWidth: 180
|
||||
inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
|
||||
Accessible.name: "Wi-Fi password"
|
||||
}
|
||||
GlassButton {
|
||||
text: entry.modelData.connected ? "Disconnect" : "Connect"
|
||||
accented: !entry.modelData.connected
|
||||
enabled: entry.supported && !entry.modelData.stateChanging && !NetworkService.pending
|
||||
onClicked: {
|
||||
NetworkService.connectNetwork(entry.modelData, password.text);
|
||||
password.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: NetworkService.error
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: SystemService.error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../controlcenter/modules" as Modules
|
||||
import "../../services"
|
||||
|
||||
SettingsPage {
|
||||
Modules.Dnd {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: SystemService.error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../core"
|
||||
import "../../theme"
|
||||
|
||||
SettingsPage {
|
||||
SettingsSection {
|
||||
title: "Overlay"
|
||||
description: "A glass capsule shows volume, microphone and brightness changes from any source, including existing keybinds."
|
||||
PreferenceToggle {
|
||||
label: "Show overlay"
|
||||
description: "Hidden while Control Center is open"
|
||||
icon: ""
|
||||
setting: "osd.enabled"
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Position"
|
||||
icon: ""
|
||||
setting: "osd.position"
|
||||
choices: ["top-right", "top-center", "bottom-center"]
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Animation"
|
||||
description: "Slide out of the bar, drop down, fade, or shrink to nothing"
|
||||
icon: ""
|
||||
setting: "osd.animation"
|
||||
choices: ["slide", "drop", "fade", "shrink"]
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Duration"
|
||||
description: "Stays open while hovered or dragged"
|
||||
icon: ""
|
||||
setting: "osd.timeout"
|
||||
from: 500
|
||||
to: 5000
|
||||
step: 100
|
||||
unit: " ms"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Step"
|
||||
description: "Change per key press or scroll on the bar volume module"
|
||||
icon: ""
|
||||
setting: "osd.step"
|
||||
from: 1
|
||||
to: 20
|
||||
step: 1
|
||||
unit: "%"
|
||||
}
|
||||
SettingRow {
|
||||
title: "Preview"
|
||||
icon: ""
|
||||
Repeater {
|
||||
model: ["volume", "microphone", "brightness"]
|
||||
GlassButton {
|
||||
required property string modelData
|
||||
objectName: "osdPreview-" + modelData
|
||||
text: modelData.charAt(0).toUpperCase() + modelData.slice(1)
|
||||
onClicked: if (ShellState.osdWindow)
|
||||
ShellState.osdWindow.show(modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Keybinds"
|
||||
description: "Volume changed by wpctl or pamixer already shows the overlay. These commands also change the level and work for brightness:"
|
||||
padded: true
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.text
|
||||
font.family: "monospace"
|
||||
font.pixelSize: 11
|
||||
textFormat: Text.PlainText
|
||||
text: "bindel = , XF86AudioRaiseVolume, exec, glassmxrph osd volumeUp\nbindel = , XF86AudioLowerVolume, exec, glassmxrph osd volumeDown\nbindl = , XF86AudioMute, exec, glassmxrph osd mute\nbindl = , XF86AudioMicMute, exec, glassmxrph osd micMute\nbindel = , XF86MonBrightnessUp, exec, glassmxrph osd brightnessUp\nbindel = , XF86MonBrightnessDown, exec, glassmxrph osd brightnessDown"
|
||||
}
|
||||
SettingNote {
|
||||
Layout.leftMargin: 0
|
||||
text: "Use the full path to scripts/glassmxrph in your clone if it is not on PATH. Existing keybinds are not changed."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,560 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
|
||||
SettingsPage {
|
||||
id: root
|
||||
// Plugin awaiting removal confirmation.
|
||||
property string confirmRemove: ""
|
||||
// Marketplace listing awaiting install confirmation.
|
||||
property string confirmInstall: ""
|
||||
// Plugin whose own settings screen is open (Noctalia Settings.qml);
|
||||
// "open plugin settings" from a plugin sets it.
|
||||
property string openSettings: PluginService.focusedSettings
|
||||
onOpenSettingsChanged: if (openSettings)
|
||||
tab = "installed"
|
||||
property string tab: "installed"
|
||||
onTabChanged: if (tab === "browse" && PluginService.market.items.length === 0)
|
||||
PluginService.browse(false)
|
||||
Component.onCompleted: PluginService.refresh()
|
||||
readonly property var capabilityLabels: ({
|
||||
"privilege": "Uses sudo",
|
||||
"package-manager": "Installs packages",
|
||||
"service-management": "Manages services",
|
||||
"installer": "Runs installers",
|
||||
"network": "Uses the network",
|
||||
"credentials": "Handles credentials",
|
||||
"filesystem": "Writes files"
|
||||
})
|
||||
readonly property var accents: ({
|
||||
"violet": "#8b5cf6",
|
||||
"purple": "#a855f7",
|
||||
"blue": "#3b82f6",
|
||||
"sky": "#0ea5e9",
|
||||
"cyan": "#06b6d4",
|
||||
"teal": "#14b8a6",
|
||||
"green": "#22c55e",
|
||||
"lime": "#84cc16",
|
||||
"yellow": "#eab308",
|
||||
"amber": "#f59e0b",
|
||||
"orange": "#f97316",
|
||||
"red": "#ef4444",
|
||||
"rose": "#f43f5e",
|
||||
"pink": "#ec4899",
|
||||
"slate": "#64748b"
|
||||
})
|
||||
|
||||
SettingsSection {
|
||||
title: "Plugins"
|
||||
description: "Shell plugins from Omarchy (plugins.omarchy.org) and Noctalia v4. Their bar widgets sit in the bar like built-in modules and their panels open as bar drawers, styled by glassMxrph."
|
||||
GlassSegmented {
|
||||
objectName: "pluginTabs"
|
||||
Layout.leftMargin: 14
|
||||
Layout.bottomMargin: 4
|
||||
model: ["installed", "browse"]
|
||||
currentIndex: model.indexOf(root.tab)
|
||||
onActivated: (index, value) => root.tab = value
|
||||
}
|
||||
SettingNote {
|
||||
Layout.leftMargin: 0
|
||||
text: "Plugins run inside the shell with your user's permissions, the same as in Omarchy and Noctalia: a plugin can read your files and run commands. Only install plugins from authors you trust, and use View source to check what one does."
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
visible: root.tab === "installed"
|
||||
title: "Add a plugin"
|
||||
description: "A git URL or a local folder holding an Omarchy or Noctalia v4 plugin. Repositories with several plugins install them all."
|
||||
SettingRow {
|
||||
title: "Source"
|
||||
icon: ""
|
||||
GlassTextField {
|
||||
id: sourceField
|
||||
objectName: "pluginSource"
|
||||
Layout.preferredWidth: 300
|
||||
placeholderText: "https://github.com/user/plugin"
|
||||
onAccepted: installButton.clicked()
|
||||
}
|
||||
GlassButton {
|
||||
id: installButton
|
||||
objectName: "pluginInstall"
|
||||
text: PluginService.busy ? "Installing…" : "Install"
|
||||
accented: true
|
||||
enabled: !PluginService.busy && sourceField.text.trim() !== ""
|
||||
onClicked: PluginService.install(sourceField.text, "")
|
||||
}
|
||||
}
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 14
|
||||
Layout.bottomMargin: 8
|
||||
visible: text !== ""
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: 12
|
||||
color: PluginService.error ? Theme.urgent : Theme.textSecondary
|
||||
text: {
|
||||
if (PluginService.error)
|
||||
return PluginService.error;
|
||||
const r = PluginService.lastResult || {};
|
||||
const parts = [];
|
||||
if (r.installed && r.installed.length)
|
||||
parts.push("Installed " + r.installed.join(", ") + ". Turn it on below.");
|
||||
if (r.rejected && r.rejected.length)
|
||||
parts.push("Skipped " + r.rejected.map(x => x.dir + " (" + x.problems.join("; ") + ")").join(", "));
|
||||
return parts.join(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
visible: root.tab === "installed"
|
||||
title: "Installed"
|
||||
description: PluginService.plugins.length ? "Turn a plugin on to load it. Bar widgets then appear under Bar → Modules (and can go on a single screen); their options are on the module's cog." : ""
|
||||
Text {
|
||||
visible: PluginService.loaded && PluginService.plugins.length === 0
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 14
|
||||
text: "No plugins installed yet."
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 12
|
||||
}
|
||||
Repeater {
|
||||
model: PluginService.plugins
|
||||
SettingRow {
|
||||
id: row
|
||||
required property var modelData
|
||||
readonly property var manifest: modelData.manifest || {}
|
||||
readonly property bool enabledNow: PluginService.isEnabled(modelData.id)
|
||||
readonly property bool inBar: ConfigService.data.bar.modules.some(m => m.id === "plugin:" + modelData.id)
|
||||
objectName: "plugin-" + modelData.id
|
||||
title: manifest.name || modelData.id
|
||||
description: [manifest.description || "", [manifest.version ? "v" + manifest.version : "", manifest.author || ""].filter(x => x).join(" · ")].filter(x => x).join("\n")
|
||||
icon: ""
|
||||
GlassButton {
|
||||
objectName: "plugin-add-" + row.modelData.id
|
||||
visible: row.enabledNow && (row.manifest.kinds || []).includes("bar-widget") && !row.inBar
|
||||
text: "Add to bar"
|
||||
onClicked: PluginService.addToBar(row.modelData.id)
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "plugin-settings-" + row.modelData.id
|
||||
visible: row.enabledNow && (row.modelData.kinds || []).includes("settings")
|
||||
text: root.openSettings === row.modelData.id ? "Close settings" : "Settings"
|
||||
accented: root.openSettings === row.modelData.id
|
||||
onClicked: root.openSettings = root.openSettings === row.modelData.id ? "" : row.modelData.id
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "plugin-source-" + row.modelData.id
|
||||
text: "View source"
|
||||
onClicked: Qt.openUrlExternally(/^https?:\/\//.test(row.modelData.source) ? row.modelData.source : "file://" + row.modelData.dir)
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "plugin-remove-" + row.modelData.id
|
||||
text: root.confirmRemove === row.modelData.id ? "Confirm remove" : "Remove"
|
||||
accented: root.confirmRemove === row.modelData.id
|
||||
onClicked: {
|
||||
if (root.confirmRemove === row.modelData.id) {
|
||||
root.confirmRemove = "";
|
||||
PluginService.remove(row.modelData.id);
|
||||
} else
|
||||
root.confirmRemove = row.modelData.id;
|
||||
}
|
||||
}
|
||||
GlassToggle {
|
||||
objectName: "plugin-enable-" + row.modelData.id
|
||||
checked: row.enabledNow
|
||||
enabled: row.modelData.problems.length === 0
|
||||
onToggled: PluginService.setEnabled(row.modelData.id, checked)
|
||||
}
|
||||
below: ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 10
|
||||
Flow {
|
||||
Layout.fillWidth: true
|
||||
spacing: 6
|
||||
Repeater {
|
||||
model: [
|
||||
{
|
||||
text: row.modelData.ecosystem === "noctalia" ? "Noctalia" : "Omarchy",
|
||||
tone: "plain"
|
||||
}
|
||||
].concat((row.modelData.kinds || []).map(k => ({
|
||||
text: k,
|
||||
tone: "plain"
|
||||
}))).concat(row.modelData.problems.map(p => ({
|
||||
text: p,
|
||||
tone: "bad"
|
||||
}))).concat(row.modelData.unsupportedImports.map(i => ({
|
||||
text: "Needs " + i + " (not supported)",
|
||||
tone: "bad"
|
||||
}))).concat((row.modelData.missingCommands || []).map(c => ({
|
||||
text: "Missing " + c,
|
||||
tone: "warn"
|
||||
}))).concat(row.modelData.customColors > 0 ? [
|
||||
{
|
||||
text: "Custom colors · " + row.modelData.customColors,
|
||||
tone: "warn"
|
||||
}
|
||||
] : []).concat(row.modelData.commit ? [
|
||||
{
|
||||
text: "Pinned " + row.modelData.commit.slice(0, 8),
|
||||
tone: "plain"
|
||||
}
|
||||
] : [])
|
||||
Rectangle {
|
||||
id: badge
|
||||
required property var modelData
|
||||
implicitWidth: badgeText.implicitWidth + 16
|
||||
implicitHeight: 22
|
||||
radius: 11
|
||||
color: badge.modelData.tone === "bad" ? Qt.alpha(Theme.urgent, 0.2) : badge.modelData.tone === "warn" ? Qt.alpha(Theme.urgent, 0.12) : Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
Text {
|
||||
id: badgeText
|
||||
anchors.centerIn: parent
|
||||
text: badge.modelData.text
|
||||
color: badge.modelData.tone === "plain" ? Theme.textSecondary : Theme.urgent
|
||||
font.pixelSize: 11
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
visible: !!row.modelData.source
|
||||
text: row.modelData.source
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
elide: Text.ElideMiddle
|
||||
width: Math.min(implicitWidth, 360)
|
||||
height: 22
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
// The plugin's own settings screen (Noctalia Settings.qml), with
|
||||
// its pluginApi; Save calls the plugin's saveSettings().
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
visible: root.openSettings === row.modelData.id
|
||||
implicitHeight: visible ? settingsColumn.implicitHeight + 24 : 0
|
||||
radius: 12
|
||||
color: Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
ColumnLayout {
|
||||
id: settingsColumn
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: 12
|
||||
spacing: 10
|
||||
Loader {
|
||||
id: pluginSettings
|
||||
Layout.fillWidth: true
|
||||
active: root.openSettings === row.modelData.id
|
||||
onActiveChanged: if (active)
|
||||
setSource(row.modelData.entryUrls.settings, {
|
||||
pluginApi: PluginService.noctaliaApi(row.modelData.id)
|
||||
})
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
GlassButton {
|
||||
text: "Cancel"
|
||||
onClicked: root.openSettings = ""
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "plugin-settings-save-" + row.modelData.id
|
||||
text: "Save"
|
||||
accented: true
|
||||
onClicked: {
|
||||
PluginService.callIfPresent(pluginSettings.item, "saveSettings");
|
||||
root.openSettings = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
visible: root.tab === "installed"
|
||||
text: "Custom colors: the plugin draws some of its own colors, so those parts keep the plugin's look instead of your theme. Everything drawn with the plugin toolkit (buttons, toggles, panels, tooltips) uses the glassMxrph style."
|
||||
}
|
||||
SettingsSection {
|
||||
visible: root.tab === "browse"
|
||||
title: PluginService.marketSource === "noctalia" ? "Noctalia plugins" : "plugins.omarchy.org"
|
||||
description: !PluginService.market.total ? "Community plugins." : PluginService.marketSource === "noctalia" ? PluginService.market.total + " Noctalia v4 plugins, run through glassMxrph's compatibility layer: most bar widgets, panels and settings work; some plugins rely on Noctalia parts glassMxrph does not have (the Installed tab lists them)." : PluginService.market.total + " plugins. Installs use the commit the marketplace last validated. Verified means the marketplace's automated review passed at that commit."
|
||||
GlassSegmented {
|
||||
objectName: "marketSource"
|
||||
Layout.leftMargin: 12
|
||||
Layout.topMargin: 6
|
||||
model: ["omarchy", "noctalia"]
|
||||
currentIndex: model.indexOf(PluginService.marketSource)
|
||||
onActivated: (index, value) => PluginService.marketSource = value
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 12
|
||||
spacing: 8
|
||||
GlassTextField {
|
||||
objectName: "marketSearch"
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "Search plugins"
|
||||
text: PluginService.marketQuery
|
||||
onTextChanged: PluginService.marketQuery = text
|
||||
}
|
||||
GlassComboBox {
|
||||
objectName: "marketCategory"
|
||||
Layout.preferredWidth: 160
|
||||
model: ["all"].concat(PluginService.market.categories || [])
|
||||
displayText: currentText === "all" ? "All categories" : currentText
|
||||
currentIndex: Math.max(0, model.indexOf(PluginService.marketCategory))
|
||||
onActivated: PluginService.marketCategory = currentText
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.bottomMargin: 10
|
||||
spacing: 10
|
||||
GlassSegmented {
|
||||
objectName: "marketSort"
|
||||
model: ["popular", "recent", "name"]
|
||||
currentIndex: model.indexOf(PluginService.marketSort)
|
||||
onActivated: (index, value) => PluginService.marketSort = value
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: "Verified only"
|
||||
color: Theme.text
|
||||
font.pixelSize: 12
|
||||
}
|
||||
GlassToggle {
|
||||
objectName: "marketVerified"
|
||||
checked: PluginService.marketVerifiedOnly
|
||||
onToggled: PluginService.marketVerifiedOnly = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
visible: root.tab === "browse"
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 14
|
||||
visible: text !== ""
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: 12
|
||||
color: PluginService.marketError || PluginService.error ? Theme.urgent : Theme.textSecondary
|
||||
text: PluginService.error || PluginService.marketError || ((PluginService.lastResult.installed || []).length ? "Installed " + PluginService.lastResult.installed.join(", ") + ". Turn it on under Installed." : "") || (PluginService.marketBusy && PluginService.market.items.length === 0 ? "Loading the plugin catalog…" : PluginService.market.total === 0 && !PluginService.marketBusy ? "No plugins match." : "")
|
||||
}
|
||||
Repeater {
|
||||
model: PluginService.market.items
|
||||
Item {
|
||||
id: listing
|
||||
required property var modelData
|
||||
readonly property bool installed: PluginService.isInstalled(modelData.id)
|
||||
readonly property bool confirming: root.confirmInstall === modelData.id
|
||||
readonly property bool usable: modelData.installable && modelData.support !== "unsupported"
|
||||
objectName: "listing-" + modelData.id
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: card.implicitHeight + 16
|
||||
ColumnLayout {
|
||||
id: card
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: 12
|
||||
spacing: 6
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 12
|
||||
Rectangle {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
radius: 12
|
||||
color: Qt.alpha(root.accents[listing.modelData.accent] || Theme.accent, 0.35)
|
||||
border.width: 1
|
||||
border.color: Qt.alpha(root.accents[listing.modelData.accent] || Theme.accent, 0.6)
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: listing.modelData.initials || listing.modelData.name.slice(0, 2).toUpperCase()
|
||||
color: Theme.text
|
||||
font.pixelSize: 14
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 2
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
text: listing.modelData.name
|
||||
color: Theme.text
|
||||
font.pixelSize: 14
|
||||
font.weight: Font.DemiBold
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
text: [listing.modelData.author ? "by " + listing.modelData.author : "", listing.modelData.version ? "v" + listing.modelData.version : "", "★ " + listing.modelData.stars].filter(x => x).join(" · ")
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "listing-page-" + listing.modelData.id
|
||||
text: "Details"
|
||||
onClicked: Qt.openUrlExternally(listing.modelData.page)
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "listing-install-" + listing.modelData.id
|
||||
text: listing.installed ? "Installed" : !listing.usable ? "Not available" : listing.confirming ? "Cancel" : "Install"
|
||||
enabled: !listing.installed && listing.usable && !PluginService.busy
|
||||
onClicked: root.confirmInstall = listing.confirming ? "" : listing.modelData.id
|
||||
}
|
||||
}
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
visible: text !== ""
|
||||
text: listing.modelData.description
|
||||
color: Theme.text
|
||||
opacity: 0.85
|
||||
font.pixelSize: 12
|
||||
wrapMode: Text.Wrap
|
||||
maximumLineCount: 2
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Flow {
|
||||
Layout.fillWidth: true
|
||||
spacing: 6
|
||||
Repeater {
|
||||
model: [
|
||||
{
|
||||
text: listing.modelData.kind,
|
||||
tone: "plain"
|
||||
},
|
||||
{
|
||||
text: listing.modelData.kind === "Noctalia v4" ? "Best effort" : listing.modelData.support === "supported" ? "Works in glassMxrph" : listing.modelData.support === "partial" ? "Partly supported" : "Not supported",
|
||||
tone: listing.modelData.support === "supported" ? "good" : listing.modelData.support === "partial" ? "warn" : "bad"
|
||||
},
|
||||
{
|
||||
text: listing.modelData.official ? "Official" : listing.modelData.kind === "Noctalia v4" ? "Community" : listing.modelData.verified ? "Verified" : "Unverified",
|
||||
tone: listing.modelData.official || listing.modelData.verified ? "good" : listing.modelData.kind === "Noctalia v4" ? "plain" : "warn"
|
||||
}
|
||||
].concat((listing.modelData.capabilities || []).map(c => ({
|
||||
text: root.capabilityLabels[c] || c,
|
||||
tone: "warn"
|
||||
}))).concat([
|
||||
{
|
||||
text: listing.modelData.category,
|
||||
tone: "plain"
|
||||
}
|
||||
])
|
||||
Rectangle {
|
||||
id: tag
|
||||
required property var modelData
|
||||
implicitWidth: tagText.implicitWidth + 16
|
||||
implicitHeight: 22
|
||||
radius: 11
|
||||
color: tag.modelData.tone === "good" ? Qt.alpha(Theme.accent, 0.22) : tag.modelData.tone === "bad" ? Qt.alpha(Theme.urgent, 0.2) : tag.modelData.tone === "warn" ? Qt.alpha(Theme.urgent, 0.12) : Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
Text {
|
||||
id: tagText
|
||||
anchors.centerIn: parent
|
||||
text: tag.modelData.text
|
||||
color: tag.modelData.tone === "plain" ? Theme.textSecondary : tag.modelData.tone === "good" ? Theme.text : Theme.urgent
|
||||
font.pixelSize: 11
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Install confirmation: exactly what will be cloned, and the trust warning.
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
visible: listing.confirming
|
||||
implicitHeight: confirmBody.implicitHeight + 20
|
||||
radius: 12
|
||||
color: Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
ColumnLayout {
|
||||
id: confirmBody
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: 10
|
||||
spacing: 8
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.text
|
||||
font.pixelSize: 12
|
||||
text: "Install " + listing.modelData.name + " from " + listing.modelData.repo + (listing.modelData.commit ? " at commit " + listing.modelData.commit.slice(0, 10) : " (current version)") + "? It will run inside the shell with your permissions" + ((listing.modelData.capabilities || []).length ? " and its review flagged: " + listing.modelData.capabilities.map(c => (root.capabilityLabels[c] || c).toLowerCase()).join(", ") : "") + "."
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
visible: listing.modelData.support === "partial"
|
||||
text: listing.modelData.kind === "Noctalia v4" ? "Noctalia plugins are best effort: check its badges under Installed." : "Overlay and menu plugins keep some of their own styling."
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: listing.modelData.support !== "partial"
|
||||
}
|
||||
GlassButton {
|
||||
text: "View source"
|
||||
onClicked: Qt.openUrlExternally(listing.modelData.repo)
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "listing-confirm-" + listing.modelData.id
|
||||
text: PluginService.busy ? "Installing…" : "Install"
|
||||
accented: true
|
||||
enabled: !PluginService.busy
|
||||
onClicked: {
|
||||
root.confirmInstall = "";
|
||||
PluginService.installListing(listing.modelData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 12
|
||||
anchors.rightMargin: 12
|
||||
height: 1
|
||||
color: Theme.hairline
|
||||
}
|
||||
}
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "marketMore"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.margins: 10
|
||||
visible: PluginService.market.items.length < PluginService.market.total
|
||||
text: PluginService.marketBusy ? "Loading…" : "Show more (" + (PluginService.market.total - PluginService.market.items.length) + ")"
|
||||
enabled: !PluginService.marketBusy
|
||||
onClicked: PluginService.browse(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../controlcenter/modules" as Modules
|
||||
import "../../services"
|
||||
|
||||
SettingsPage {
|
||||
Modules.Power {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Modules.Profiles {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Lock screen"
|
||||
padded: true
|
||||
CommandPreference {
|
||||
label: "Lock command arguments (empty = detected existing locker)"
|
||||
setting: "system.power.lockCommand"
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
warning: true
|
||||
text: SystemService.error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
ColumnLayout {
|
||||
spacing: 22
|
||||
SettingsSection {
|
||||
title: "Tray"
|
||||
PreferenceToggle { label: "System tray"; description: "Show StatusNotifier applications in the bar"; icon: ""; setting: "tray.enabled" }
|
||||
PreferenceToggle { label: "Hover menus"; description: "Open application menus on hover"; icon: ""; setting: "tray.hoverMenus" }
|
||||
PreferenceChoice { label: "Background"; icon: ""; setting: "tray.background"; choices: ["pill", "transparent", "icons"] }
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Sizing"
|
||||
Repeater {
|
||||
model: [{key:"hoverDelay",label:"Hover delay",min:100,max:2000,step:50,unit:" ms"},{key:"iconSize",label:"Icon size",min:16,max:32,step:1,unit:" px"},{key:"spacing",label:"Spacing",min:0,max:24,step:1,unit:" px"}]
|
||||
SettingRow {
|
||||
id: sizing
|
||||
required property var modelData
|
||||
title: modelData.label
|
||||
setting: "tray." + modelData.key
|
||||
GlassSlider { Layout.preferredWidth: 240; from: sizing.modelData.min; to: sizing.modelData.max; stepSize: sizing.modelData.step; value: TrayService.options[sizing.modelData.key]; onMoved: ConfigService.setValue("tray." + sizing.modelData.key, Math.round(value)) }
|
||||
Text { text: TrayService.options[sizing.modelData.key] + sizing.modelData.unit; color: Theme.textSecondary; font.pixelSize: 12; horizontalAlignment: Text.AlignRight; Layout.preferredWidth: 52 }
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote { text: "Right-click opens the application menu. Shift + right-click uses the native menu. Only registered tray applications appear." }
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
import "../../core"
|
||||
|
||||
SettingsPage {
|
||||
id: root
|
||||
property string selected: ""
|
||||
Component.onCompleted: {
|
||||
WallpaperService.refresh();
|
||||
WallpaperService.scan();
|
||||
}
|
||||
SettingsSection {
|
||||
SettingRow {
|
||||
title: "Wallpaper picker"
|
||||
description: "Browse large wallpaper cards, search your folders and revisit recent wallpapers. The built-in backend works without Serpantinum."
|
||||
icon: ""
|
||||
GlassButton {
|
||||
objectName: "openWallpaperPicker"
|
||||
text: "Open picker"
|
||||
accented: true
|
||||
onClicked: ShellState.openWallpaperPicker()
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Gallery"
|
||||
description: "Select an image, then apply it to the chosen monitor"
|
||||
padded: true
|
||||
GridView {
|
||||
id: grid
|
||||
objectName: "wallpaperGrid"
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 300
|
||||
clip: true
|
||||
model: WallpaperService.images
|
||||
cellWidth: Math.max(140, width / Math.max(1, Math.floor(width / 170)))
|
||||
cellHeight: 125
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
delegate: Rectangle {
|
||||
id: tile
|
||||
required property var modelData
|
||||
readonly property bool chosen: root.selected === modelData.path
|
||||
width: grid.cellWidth - 8
|
||||
height: 117
|
||||
radius: Math.max(8, Theme.radius * 0.55)
|
||||
color: tileArea.containsMouse ? Theme.hover : Theme.surfaceVariant
|
||||
border.width: chosen ? 2 : 1
|
||||
border.color: chosen ? Theme.accent : Theme.border
|
||||
scale: tileArea.containsMouse ? 1 + 0.02 * Theme.intensity : 1
|
||||
Behavior on scale {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Image {
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: 4
|
||||
}
|
||||
height: 82
|
||||
source: tile.modelData.url
|
||||
sourceSize: Qt.size(220, 140)
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
clip: true
|
||||
}
|
||||
Text {
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: 8
|
||||
}
|
||||
text: (WallpaperService.currentPath === tile.modelData.path ? "✓ " : "") + tile.modelData.name
|
||||
color: Theme.text
|
||||
elide: Text.ElideMiddle
|
||||
font.pixelSize: 12
|
||||
}
|
||||
MouseArea {
|
||||
id: tileArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.selected = tile.modelData.path
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
visible: WallpaperService.images.length === 0
|
||||
text: WallpaperService.scanning ? "Loading images…" : "Add a folder containing PNG, JPEG, WebP or BMP images."
|
||||
color: Theme.textSecondary
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Text {
|
||||
text: WallpaperService.error || WallpaperService.notice
|
||||
color: WallpaperService.error ? Theme.urgent : Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "wallpaperApply"
|
||||
text: WallpaperService.busy ? "Applying…" : "Apply selected wallpaper"
|
||||
accented: root.selected !== ""
|
||||
enabled: root.selected !== "" && !WallpaperService.busy
|
||||
onClicked: WallpaperService.apply(root.selected)
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Wallpaper folders"
|
||||
description: "One absolute path per line"
|
||||
padded: true
|
||||
GlassTextArea {
|
||||
id: folders
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 72
|
||||
text: ConfigService.data.wallpaper.directories.join("\n")
|
||||
wrapMode: TextEdit.NoWrap
|
||||
selectByMouse: true
|
||||
}
|
||||
RowLayout {
|
||||
GlassButton {
|
||||
text: "Save folders"
|
||||
onClicked: {
|
||||
if (ConfigService.setValue("wallpaper.directories", folders.text.split("\n").map(s => s.trim()).filter(Boolean)))
|
||||
WallpaperService.scan();
|
||||
}
|
||||
}
|
||||
GlassButton {
|
||||
text: "Use Pictures"
|
||||
onClicked: {
|
||||
ConfigService.setValue("wallpaper.directories", [Quickshell.env("HOME") + "/Pictures"]);
|
||||
WallpaperService.scan();
|
||||
}
|
||||
}
|
||||
GlassButton {
|
||||
text: "Refresh"
|
||||
enabled: !WallpaperService.scanning
|
||||
onClicked: {
|
||||
WallpaperService.refresh();
|
||||
WallpaperService.scan();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Output"
|
||||
description: "Detected: " + WallpaperService.backend + " · Current: " + (WallpaperService.currentPath || "unknown")
|
||||
SettingRow {
|
||||
title: "Apply to monitor"
|
||||
description: "“all” sets every connected display"
|
||||
icon: ""
|
||||
GlassComboBox {
|
||||
Layout.preferredWidth: 240
|
||||
model: ["all", "primary"].concat(Quickshell.screens.map(s => s.name))
|
||||
currentIndex: Math.max(0, model.indexOf(WallpaperService.selectedMonitor))
|
||||
onActivated: WallpaperService.selectedMonitor = currentText
|
||||
}
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Backend"
|
||||
description: "Tool that sets the wallpaper"
|
||||
icon: ""
|
||||
setting: "wallpaper.backend"
|
||||
choices: ["native", "auto", "serpantinum", "awww", "custom"]
|
||||
}
|
||||
SettingRow {
|
||||
visible: ConfigService.data.wallpaper.backend === "custom"
|
||||
title: "Custom command"
|
||||
description: "JSON argument array; {path} and {monitor} are substituted"
|
||||
setting: "wallpaper.command"
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 280
|
||||
text: JSON.stringify(ConfigService.data.wallpaper.command)
|
||||
placeholderText: '["your-tool", "{path}", "{monitor}"]'
|
||||
onEditingFinished: {
|
||||
try {
|
||||
ConfigService.setValue("wallpaper.command", JSON.parse(text));
|
||||
} catch (error) {
|
||||
WallpaperService.error = "Custom command must be a JSON argument array.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PreferenceChoice {
|
||||
label: "Palette monitor"
|
||||
description: "Wallpaper used for Matugen palette generation"
|
||||
icon: ""
|
||||
setting: "wallpaper.paletteMonitor"
|
||||
choices: ["primary"].concat(Quickshell.screens.map(s => s.name))
|
||||
}
|
||||
SettingNote {
|
||||
visible: WallpaperService.backend === "serpantinum"
|
||||
text: "Serpantinum applies its own wallpaper hooks. glassMxrph generates its palette separately without app hooks."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../widgets"
|
||||
|
||||
SettingsPage {
|
||||
SettingsSection {
|
||||
SettingRow {
|
||||
title: "Edit widgets"
|
||||
description: "Add, move and resize widgets on the desktop. You can also right-click any widget, or run glassmxrph widgets."
|
||||
icon: ""
|
||||
GlassButton {
|
||||
objectName: "editWidgets"
|
||||
text: "Edit desktop"
|
||||
accented: true
|
||||
onClicked: WidgetState.edit("")
|
||||
}
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Snap to grid"
|
||||
description: "20 px grid while editing; otherwise widgets snap to edges, centres and each other"
|
||||
icon: ""
|
||||
setting: "desktopWidgets.grid"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Your widgets"
|
||||
description: WidgetState.items.length ? "" : "No widgets yet. Choose Edit desktop to add some."
|
||||
Repeater {
|
||||
model: WidgetState.items
|
||||
SettingRow {
|
||||
id: entry
|
||||
required property var modelData
|
||||
readonly property var type: WidgetRegistry.type(modelData.type)
|
||||
title: type ? type.name + (type.variants ? " · " + type.variants[modelData.variant] : "") : modelData.type + " (unavailable)"
|
||||
description: modelData.monitor + " · " + modelData.w + "×" + modelData.h + " at " + modelData.x + ", " + modelData.y
|
||||
icon: type ? type.icon : "?"
|
||||
GlassButton {
|
||||
text: "Edit"
|
||||
onClicked: WidgetState.edit(entry.modelData.id)
|
||||
}
|
||||
GlassButton {
|
||||
objectName: "removeWidget-" + entry.modelData.id
|
||||
text: "Remove"
|
||||
onClicked: WidgetState.remove(entry.modelData.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
text: "The Music widget and System Metrics pages keep their existing corner widgets; desktop widgets are independent and can be placed anywhere."
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user