rewrite bar with quickshell
This commit is contained in:
60
quickshell/Modules/Bar/Components/TrayExpander.qml
Normal file
60
quickshell/Modules/Bar/Components/TrayExpander.qml
Normal file
@@ -0,0 +1,60 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Constants
|
||||
import qs.Modules.Bar.Misc
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property ShellScreen screen
|
||||
|
||||
implicitHeight: parent.height
|
||||
implicitWidth: layout.implicitWidth
|
||||
|
||||
RowLayout {
|
||||
id: layout
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
SymbolButton {
|
||||
symbol: Icons.tray
|
||||
buttonColor: Colors.green
|
||||
}
|
||||
|
||||
Item {
|
||||
id: trayContainer
|
||||
|
||||
implicitHeight: parent.height
|
||||
implicitWidth: mouseArea.containsMouse ? expandedTray.implicitWidth : 0
|
||||
clip: true
|
||||
|
||||
SystemTray {
|
||||
id: expandedTray
|
||||
|
||||
screen: root.screen
|
||||
}
|
||||
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.NoButton
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user