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>
47 lines
1.5 KiB
QML
47 lines
1.5 KiB
QML
import QtQuick
|
|
import "../theme"
|
|
|
|
// Icon tile: a Nerd Font glyph when one is installed, otherwise the fallback text.
|
|
Rectangle {
|
|
id: root
|
|
property string glyph: ""
|
|
property string fallback: ""
|
|
// An image (e.g. the project crest) replaces the glyph when set.
|
|
property url image: ""
|
|
property bool active: false
|
|
property int size: 30
|
|
property int glyphSize: Math.round(size * 0.5)
|
|
property color glyphColor: active ? Theme.accentText : Theme.text
|
|
implicitWidth: size
|
|
implicitHeight: size
|
|
radius: Math.min(size / 2, Math.max(6, Theme.radius * 0.4))
|
|
color: active ? Theme.accent : Theme.surfaceVariant
|
|
border.width: active ? 0 : 1
|
|
border.color: Theme.hairline
|
|
Behavior on color {
|
|
ColorAnimation {
|
|
duration: Theme.duration
|
|
}
|
|
}
|
|
Image {
|
|
anchors.fill: parent
|
|
anchors.margins: Math.round(root.size * 0.12)
|
|
visible: root.image.toString() !== ""
|
|
source: root.image
|
|
sourceSize: Qt.size(root.size * 2, root.size * 2)
|
|
fillMode: Image.PreserveAspectFit
|
|
smooth: true
|
|
mipmap: true
|
|
asynchronous: true
|
|
}
|
|
Text {
|
|
anchors.centerIn: parent
|
|
visible: root.image.toString() === ""
|
|
text: Icons.available && root.glyph ? root.glyph : root.fallback
|
|
font.family: Icons.available && root.glyph ? Icons.family : ""
|
|
font.pixelSize: Icons.available && root.glyph ? root.glyphSize : Math.round(root.glyphSize * 0.9)
|
|
font.weight: Font.DemiBold
|
|
color: root.glyphColor
|
|
}
|
|
}
|