Files
glassMxrph/quickshell/dashboard/DashButton.qml
T
mxandClaude Opus 5.5 99e64a7713 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>
2026-10-07 22:36:17 +02:00

55 lines
1.8 KiB
QML

import QtQuick
import "../theme"
// Round glyph button used by the media controls and the power tab.
Rectangle {
id: root
property string glyph
property string fallback
property int size: 36
property real glyphScale: 0.45
property bool accented: false
property bool active: false
property bool danger: false
property bool interactive: true
signal clicked
implicitWidth: size
implicitHeight: size
radius: size / 2
opacity: interactive ? 1 : 0.4
color: accented ? (area.pressed ? Theme.accentPressed : area.containsMouse ? Theme.accentHover : Theme.accent)
: danger && area.containsMouse ? Qt.alpha("#ff5f57", 0.85)
: active ? Qt.alpha(Theme.accent, 0.28)
: area.containsMouse ? Theme.hover : Theme.fill
border.width: accented ? 0 : 1
border.color: active ? Qt.alpha(Theme.accent, 0.6) : Theme.hairline
scale: area.pressed ? 1 - 0.06 * Theme.intensity : 1
Behavior on color {
ColorAnimation {
duration: Theme.duration / 2
}
}
Behavior on scale {
NumberAnimation {
duration: Theme.duration / 2
easing.type: Easing.OutCubic
}
}
Text {
anchors.centerIn: parent
text: Icons.available && root.glyph ? root.glyph : root.fallback
font.family: Icons.available && root.glyph ? Icons.family : ""
font.pixelSize: Math.round(root.size * root.glyphScale)
color: root.accented ? Theme.accentText : root.active ? Theme.accentVivid : Theme.text
}
MouseArea {
id: area
anchors.fill: parent
hoverEnabled: true
enabled: root.interactive
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()
}
Accessible.role: Accessible.Button
}