* First pass at hiding systray icons Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com> * Don't dump all IDs for no reason >_< Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com> * Better handling for hiding tray icons Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com> * Re-add EOF newline Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com> * Hide popouts too Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com> * Hide the expand icon if no icons are visible Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com> * Update modules/bar/components/Tray.qml Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> * Update modules/bar/components/Tray.qml Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> * Update modules/bar/components/Tray.qml Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> * That needs to be inverted * Clean up Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com> * fix --------- Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com> Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
121 lines
3.4 KiB
QML
121 lines
3.4 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import qs.components
|
|
import qs.services
|
|
import qs.config
|
|
import Quickshell
|
|
import Quickshell.Services.SystemTray
|
|
import QtQuick
|
|
|
|
StyledRect {
|
|
id: root
|
|
|
|
readonly property alias layout: layout
|
|
readonly property alias items: items
|
|
readonly property alias expandIcon: expandIcon
|
|
|
|
readonly property int padding: Config.bar.tray.background ? Appearance.padding.normal : Appearance.padding.small
|
|
readonly property int spacing: Config.bar.tray.background ? Appearance.spacing.small : 0
|
|
|
|
property bool expanded
|
|
|
|
readonly property real nonAnimHeight: {
|
|
if (!Config.bar.tray.compact)
|
|
return layout.implicitHeight + padding * 2;
|
|
return (expanded ? expandIcon.implicitHeight + layout.implicitHeight + spacing : expandIcon.implicitHeight) + padding * 2;
|
|
}
|
|
|
|
clip: true
|
|
visible: height > 0
|
|
|
|
implicitWidth: Config.bar.sizes.innerWidth
|
|
implicitHeight: nonAnimHeight
|
|
|
|
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, (Config.bar.tray.background && items.count > 0) ? Colours.tPalette.m3surfaceContainer.a : 0)
|
|
radius: Appearance.rounding.full
|
|
|
|
Column {
|
|
id: layout
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.top: parent.top
|
|
anchors.topMargin: root.padding
|
|
spacing: Appearance.spacing.small
|
|
|
|
opacity: root.expanded || !Config.bar.tray.compact ? 1 : 0
|
|
|
|
add: Transition {
|
|
Anim {
|
|
properties: "scale"
|
|
from: 0
|
|
to: 1
|
|
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
|
}
|
|
}
|
|
|
|
move: Transition {
|
|
Anim {
|
|
properties: "scale"
|
|
to: 1
|
|
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
|
}
|
|
Anim {
|
|
properties: "x,y"
|
|
}
|
|
}
|
|
|
|
Repeater {
|
|
id: items
|
|
|
|
model: ScriptModel {
|
|
values: SystemTray.items.values.filter(i => !Config.bar.tray.hiddenIcons.includes(i.id))
|
|
}
|
|
|
|
TrayItem {}
|
|
}
|
|
|
|
Behavior on opacity {
|
|
Anim {}
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
id: expandIcon
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.bottom: parent.bottom
|
|
|
|
active: Config.bar.tray.compact && items.count > 0
|
|
|
|
sourceComponent: Item {
|
|
implicitWidth: expandIconInner.implicitWidth
|
|
implicitHeight: expandIconInner.implicitHeight - Appearance.padding.small * 2
|
|
|
|
MaterialIcon {
|
|
id: expandIconInner
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.bottom: parent.bottom
|
|
anchors.bottomMargin: Config.bar.tray.background ? Appearance.padding.small : -Appearance.padding.small
|
|
text: "expand_less"
|
|
font.pointSize: Appearance.font.size.large
|
|
rotation: root.expanded ? 180 : 0
|
|
|
|
Behavior on rotation {
|
|
Anim {}
|
|
}
|
|
|
|
Behavior on anchors.bottomMargin {
|
|
Anim {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Behavior on implicitHeight {
|
|
Anim {
|
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
|
}
|
|
}
|
|
}
|