Files
glassMxrph/quickshell/settings/pages/Appearance.qml
T
mxandClaude Opus 5.5 d6a6cf69f4 Style in-window tooltips as glass instead of the stock Basic look
Dock items, the launcher mode button and the settings hints used the attached
ToolTip, which only gets the Basic style. GlassToolTip wraps ToolTip with a
GlassPanel background, theme text and a Theme.duration fade, matching the
bar's tooltip popout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 23:50:24 +02:00

282 lines
11 KiB
QML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
pragma ComponentBehavior: Bound
import QtQuick
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
GlassToolTip {
visible: swatchArea.containsMouse
delay: 400
text: swatch.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
}
}
}
}