controlcenter: hide float button when floating
This commit is contained in:
parent
d7e3be861f
commit
964d5deaa2
4 changed files with 64 additions and 61 deletions
|
|
@ -12,9 +12,9 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
property bool floating
|
|
||||||
readonly property int rounding: floating ? 0 : Appearance.rounding.normal
|
readonly property int rounding: floating ? 0 : Appearance.rounding.normal
|
||||||
|
|
||||||
|
property alias floating: session.floating
|
||||||
property alias active: session.active
|
property alias active: session.active
|
||||||
property alias navExpanded: session.navExpanded
|
property alias navExpanded: session.navExpanded
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,81 +80,84 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledRect {
|
Loader {
|
||||||
id: normalWinBtn
|
asynchronous: true
|
||||||
|
active: !root.session.floating
|
||||||
|
visible: active
|
||||||
|
|
||||||
readonly property int nonAnimWidth: normalWinIcon.implicitWidth + (root.session.navExpanded ? normalWinLabel.anchors.leftMargin + normalWinLabel.implicitWidth : 0) + normalWinIcon.anchors.leftMargin * 2
|
sourceComponent: StyledRect {
|
||||||
|
readonly property int nonAnimWidth: normalWinIcon.implicitWidth + (root.session.navExpanded ? normalWinLabel.anchors.leftMargin + normalWinLabel.implicitWidth : 0) + normalWinIcon.anchors.leftMargin * 2
|
||||||
|
|
||||||
Layout.bottomMargin: Appearance.spacing.large * 2
|
implicitWidth: nonAnimWidth
|
||||||
|
implicitHeight: root.session.navExpanded ? normalWinIcon.implicitHeight + Appearance.padding.normal * 2 : nonAnimWidth
|
||||||
|
|
||||||
implicitWidth: nonAnimWidth
|
color: Colours.palette.m3primaryContainer
|
||||||
implicitHeight: root.session.navExpanded ? normalWinIcon.implicitHeight + Appearance.padding.normal * 2 : nonAnimWidth
|
radius: Appearance.rounding.small
|
||||||
|
|
||||||
color: Colours.palette.m3primaryContainer
|
StateLayer {
|
||||||
radius: Appearance.rounding.small
|
id: normalWinState
|
||||||
|
|
||||||
StateLayer {
|
color: Colours.palette.m3onPrimaryContainer
|
||||||
id: normalWinState
|
|
||||||
|
|
||||||
color: Colours.palette.m3onPrimaryContainer
|
function onClicked(): void {
|
||||||
|
root.session.root.close();
|
||||||
function onClicked(): void {
|
WindowFactory.create(null, {
|
||||||
root.session.root.close();
|
screen: root.screen,
|
||||||
WindowFactory.create(null, {
|
active: root.session.active,
|
||||||
screen: root.screen,
|
navExpanded: root.session.navExpanded
|
||||||
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 {
|
MaterialIcon {
|
||||||
Anim {
|
id: normalWinIcon
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
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
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
StyledText {
|
||||||
Anim {
|
id: normalWinLabel
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
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 {
|
NavItem {
|
||||||
|
Layout.topMargin: Appearance.spacing.large * 2
|
||||||
icon: "network_manage"
|
icon: "network_manage"
|
||||||
label: "network"
|
label: "network"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ QtObject {
|
||||||
readonly property list<string> panes: ["network", "bluetooth", "audio"]
|
readonly property list<string> panes: ["network", "bluetooth", "audio"]
|
||||||
|
|
||||||
required property var root
|
required property var root
|
||||||
|
property bool floating: false
|
||||||
property string active: panes[0]
|
property string active: panes[0]
|
||||||
property int activeIndex: 0
|
property int activeIndex: 0
|
||||||
property bool navExpanded: false
|
property bool navExpanded: false
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import qs.config
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue