diff options
| author | Belal <belalkoko00@gmail.com> | 2025-09-03 12:56:50 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-03 19:56:50 +1000 |
| commit | 04d867b1499974de007ccbb7e33c238671e0347f (patch) | |
| tree | ff9a41258711dfa13e45b62caba41b70a06f25a7 /modules/bar/components/StatusIcons.qml | |
| parent | filedialog: anim empty text (diff) | |
| download | caelestia-shell-04d867b1499974de007ccbb7e33c238671e0347f.tar.gz caelestia-shell-04d867b1499974de007ccbb7e33c238671e0347f.tar.bz2 caelestia-shell-04d867b1499974de007ccbb7e33c238671e0347f.zip | |
bar/statusicons: add lock keys indicator (#514)
* [StatusIcons] Add caps lock indicator
* Seprate CapsLock icon
* Use material icon
* fixes
---------
Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Diffstat (limited to 'modules/bar/components/StatusIcons.qml')
| -rw-r--r-- | modules/bar/components/StatusIcons.qml | 91 |
1 files changed, 82 insertions, 9 deletions
diff --git a/modules/bar/components/StatusIcons.qml b/modules/bar/components/StatusIcons.qml index 2a61e3f..23be57b 100644 --- a/modules/bar/components/StatusIcons.qml +++ b/modules/bar/components/StatusIcons.qml @@ -21,14 +21,88 @@ StyledRect { clip: true implicitWidth: Config.bar.sizes.innerWidth - implicitHeight: iconColumn.implicitHeight + Appearance.padding.normal * 2 + implicitHeight: iconColumn.implicitHeight + Appearance.padding.normal * 2 - (Config.bar.status.showLockStatus && !Hypr.capsLock && !Hypr.numLock ? iconColumn.spacing : 0) ColumnLayout { id: iconColumn - anchors.centerIn: parent + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.bottomMargin: Appearance.padding.normal + spacing: Appearance.spacing.smaller / 2 + // Lock keys status + WrappedLoader { + name: "lockstatus" + active: Config.bar.status.showLockStatus + + sourceComponent: ColumnLayout { + spacing: 0 + + Item { + implicitWidth: capslockIcon.implicitWidth + implicitHeight: Hypr.capsLock ? capslockIcon.implicitHeight : 0 + + MaterialIcon { + id: capslockIcon + + anchors.centerIn: parent + + scale: Hypr.capsLock ? 1 : 0.5 + opacity: Hypr.capsLock ? 1 : 0 + + text: "keyboard_capslock_badge" + color: root.colour + + Behavior on opacity { + Anim {} + } + + Behavior on scale { + Anim {} + } + } + + Behavior on implicitHeight { + Anim {} + } + } + + Item { + Layout.topMargin: Hypr.capsLock && Hypr.numLock ? iconColumn.spacing : 0 + + implicitWidth: numlockIcon.implicitWidth + implicitHeight: Hypr.numLock ? numlockIcon.implicitHeight : 0 + + MaterialIcon { + id: numlockIcon + + anchors.centerIn: parent + + scale: Hypr.numLock ? 1 : 0.5 + opacity: Hypr.numLock ? 1 : 0 + + text: "looks_one" + color: root.colour + + Behavior on opacity { + Anim {} + } + + Behavior on scale { + Anim {} + } + } + + Behavior on implicitHeight { + Anim {} + } + } + } + } + // Audio icon WrappedLoader { name: "audio" @@ -68,6 +142,8 @@ StyledRect { // Bluetooth section WrappedLoader { + Layout.preferredHeight: implicitHeight + name: "bluetooth" active: Config.bar.status.showBluetooth @@ -124,6 +200,10 @@ StyledRect { } } } + + Behavior on Layout.preferredHeight { + Anim {} + } } // Battery icon @@ -157,13 +237,6 @@ StyledRect { } } - Behavior on implicitHeight { - Anim { - duration: Appearance.anim.durations.large - easing.bezierCurve: Appearance.anim.curves.emphasized - } - } - component WrappedLoader: Loader { required property string name |