controlcenter: restored floating window toggle
This commit is contained in:
parent
522bc40afa
commit
8a33ad9905
1 changed files with 77 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
|
|||
import qs.components
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.modules.controlcenter
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
@ -39,6 +40,82 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
Layout.topMargin: Appearance.spacing.large
|
||||
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, {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NavItem {
|
||||
Layout.topMargin: Appearance.spacing.large * 2
|
||||
icon: "router"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue