controlcenter: hide float button when floating

This commit is contained in:
2 * r + 2 * t 2025-08-07 21:06:42 +10:00
parent d7e3be861f
commit 964d5deaa2
4 changed files with 64 additions and 61 deletions

View file

@ -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

View file

@ -80,13 +80,14 @@ Item {
} }
} }
StyledRect { Loader {
id: normalWinBtn 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 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 implicitWidth: nonAnimWidth
implicitHeight: root.session.navExpanded ? normalWinIcon.implicitHeight + Appearance.padding.normal * 2 : nonAnimWidth implicitHeight: root.session.navExpanded ? normalWinIcon.implicitHeight + Appearance.padding.normal * 2 : nonAnimWidth
@ -153,8 +154,10 @@ Item {
} }
} }
} }
}
NavItem { NavItem {
Layout.topMargin: Appearance.spacing.large * 2
icon: "network_manage" icon: "network_manage"
label: "network" label: "network"
} }

View file

@ -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

View file

@ -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