summaryrefslogtreecommitdiff
path: root/modules/controlcenter
diff options
context:
space:
mode:
Diffstat (limited to 'modules/controlcenter')
-rw-r--r--modules/controlcenter/NavRail.qml119
1 files changed, 1 insertions, 118 deletions
diff --git a/modules/controlcenter/NavRail.qml b/modules/controlcenter/NavRail.qml
index 234f447..8432f17 100644
--- a/modules/controlcenter/NavRail.qml
+++ b/modules/controlcenter/NavRail.qml
@@ -30,129 +30,12 @@ Item {
PropertyChanges {
layout.spacing: Appearance.spacing.small
- menuIcon.opacity: 0
- menuIconExpanded.opacity: 1
- menuIcon.rotation: 180
- menuIconExpanded.rotation: 0
}
}
transitions: Transition {
Anim {
- properties: "spacing,opacity,rotation"
- }
- }
-
- Item {
- id: menuBtn
-
- Layout.topMargin: Appearance.spacing.large
- implicitWidth: menuIcon.implicitWidth + menuIcon.anchors.leftMargin * 2
- implicitHeight: menuIcon.implicitHeight + Appearance.padding.normal * 2
-
- StateLayer {
- radius: Appearance.rounding.small
-
- function onClicked(): void {
- root.session.navExpanded = !root.session.navExpanded;
- }
- }
-
- MaterialIcon {
- id: menuIcon
-
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- anchors.leftMargin: Appearance.padding.large
-
- text: "menu"
- font.pointSize: Appearance.font.size.large
- }
-
- MaterialIcon {
- id: menuIconExpanded
-
- anchors.fill: menuIcon
- text: "menu_open"
- font.pointSize: menuIcon.font.pointSize
- opacity: 0
- rotation: -180
- }
- }
-
- Loader {
- asynchronous: true
- active: !root.session.floating
- visible: active
-
- sourceComponent: StyledRect {
- readonly property int nonAnimWidth: normalWinIcon.implicitWidth + (root.session.navExpanded ? normalWinLabel.anchors.leftMargin + normalWinLabel.implicitWidth : 0) + normalWinIcon.anchors.leftMargin * 2
-
- implicitWidth: nonAnimWidth
- implicitHeight: root.session.navExpanded ? normalWinIcon.implicitHeight + Appearance.padding.normal * 2 : nonAnimWidth
-
- color: Colours.palette.m3primaryContainer
- radius: Appearance.rounding.small
-
- StateLayer {
- id: normalWinState
-
- color: Colours.palette.m3onPrimaryContainer
-
- function onClicked(): void {
- root.session.root.close();
- WindowFactory.create(null, {
- screen: root.screen,
- active: root.session.active,
- navExpanded: root.session.navExpanded
- });
- }
- }
-
- MaterialIcon {
- id: normalWinIcon
-
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- anchors.leftMargin: Appearance.padding.large
-
- text: "select_window"
- color: Colours.palette.m3onPrimaryContainer
- font.pointSize: Appearance.font.size.large
- fill: 1
- }
-
- StyledText {
- id: normalWinLabel
-
- anchors.left: normalWinIcon.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.leftMargin: Appearance.spacing.normal
-
- text: qsTr("Float window")
- color: Colours.palette.m3onPrimaryContainer
- opacity: root.session.navExpanded ? 1 : 0
-
- Behavior on opacity {
- Anim {
- duration: Appearance.anim.durations.small
- }
- }
- }
-
- Behavior on implicitWidth {
- Anim {
- duration: Appearance.anim.durations.expressiveDefaultSpatial
- easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
- }
- }
-
- Behavior on implicitHeight {
- Anim {
- duration: Appearance.anim.durations.expressiveDefaultSpatial
- easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
- }
- }
+ properties: "spacing"
}
}