controlcenter: changed to popout vs floating to match the other settings buttons (fixed issues with resizing)
This commit is contained in:
parent
d3124c34ac
commit
21e715468e
7 changed files with 14 additions and 123 deletions
|
|
@ -21,7 +21,9 @@ Item {
|
|||
radius: Appearance.rounding.full
|
||||
|
||||
function onClicked(): void {
|
||||
WindowFactory.create();
|
||||
WindowFactory.create(null, {
|
||||
active: "appearance"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ Item {
|
|||
radius: Appearance.rounding.full
|
||||
|
||||
function onClicked(): void {
|
||||
WindowFactory.create();
|
||||
WindowFactory.create(null, {
|
||||
active: "appearance"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ Item {
|
|||
|
||||
visibilities: root.visibilities
|
||||
sidebar: sidebar
|
||||
popouts: popouts
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ Item {
|
|||
|
||||
required property var props
|
||||
required property var visibilities
|
||||
required property Item popouts
|
||||
|
||||
implicitWidth: layout.implicitWidth
|
||||
implicitHeight: layout.implicitHeight
|
||||
|
|
@ -28,6 +29,7 @@ Item {
|
|||
|
||||
Toggles {
|
||||
visibilities: root.visibilities
|
||||
popouts: root.popouts
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ Item {
|
|||
|
||||
required property var visibilities
|
||||
required property Item sidebar
|
||||
required property Item popouts
|
||||
|
||||
readonly property PersistentProperties props: PersistentProperties {
|
||||
property bool recordingListExpanded: false
|
||||
|
|
@ -89,6 +90,7 @@ Item {
|
|||
implicitWidth: root.implicitWidth - Appearance.padding.large * 2
|
||||
props: root.props
|
||||
visibilities: root.visibilities
|
||||
popouts: root.popouts
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ StyledRect {
|
|||
id: root
|
||||
|
||||
required property var visibilities
|
||||
required property Item popouts
|
||||
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: layout.implicitHeight + Appearance.padding.large * 2
|
||||
|
|
@ -67,9 +68,7 @@ StyledRect {
|
|||
toggle: false
|
||||
onClicked: {
|
||||
root.visibilities.utilities = false;
|
||||
WindowFactory.create(null, {
|
||||
screen: QsWindow.window?.screen ?? null
|
||||
});
|
||||
root.popouts.detach("appearance");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue