Bluetooth/Wifi: fix always hide logic

This commit is contained in:
Ly-sec
2025-11-26 13:57:58 +01:00
parent 42211c6eda
commit 60eb9c6e78
2 changed files with 20 additions and 10 deletions
+10 -5
View File
@@ -23,7 +23,7 @@ Item {
property color customBackgroundColor: Color.transparent
property color customTextIconColor: Color.transparent
readonly property bool hiddenByForceClose: forceClose && !forceOpen
readonly property bool collapseToIcon: forceClose && !forceOpen
// Effective shown state (true if hovered/animated open or forced)
readonly property bool revealed: !forceClose && (forceOpen || showPill)
@@ -68,9 +68,8 @@ Item {
}
}
width: hiddenByForceClose ? 0 : pillHeight + Math.max(0, pill.width - pillOverlap)
height: hiddenByForceClose ? 0 : pillHeight
visible: !hiddenByForceClose
width: collapseToIcon ? pillHeight : pillHeight + Math.max(0, pill.width - pillOverlap)
height: pillHeight
Connections {
target: root
@@ -84,7 +83,7 @@ Item {
// Unified background for the entire pill area to avoid overlapping opacity
Rectangle {
id: pillBackground
width: root.width
width: collapseToIcon ? pillHeight : root.width
height: pillHeight
radius: halfPillHeight
color: root.bgColor
@@ -293,6 +292,8 @@ Item {
}
function show() {
if (collapseToIcon)
return;
if (!showPill) {
shouldAnimateHide = autoHide;
showAnim.start();
@@ -303,6 +304,8 @@ Item {
}
function hide() {
if (collapseToIcon)
return;
if (forceOpen) {
return;
}
@@ -313,6 +316,8 @@ Item {
}
function showDelayed() {
if (collapseToIcon)
return;
if (!showPill) {
shouldAnimateHide = autoHide;
showTimer.start();
+10 -5
View File
@@ -24,7 +24,7 @@ Item {
property color customBackgroundColor: Color.transparent
property color customTextIconColor: Color.transparent
readonly property bool hiddenByForceClose: forceClose && !forceOpen
readonly property bool collapseToIcon: forceClose && !forceOpen
signal shown
signal hidden
@@ -77,9 +77,8 @@ Item {
}
// For vertical bars: width is just icon size, height includes pill space
width: hiddenByForceClose ? 0 : buttonSize
height: hiddenByForceClose ? 0 : (revealed ? (buttonSize + maxPillHeight - pillOverlap) : buttonSize)
visible: !hiddenByForceClose
width: buttonSize
height: collapseToIcon ? buttonSize : (revealed ? (buttonSize + maxPillHeight - pillOverlap) : buttonSize)
Connections {
target: root
@@ -94,7 +93,7 @@ Item {
Rectangle {
id: pillBackground
width: buttonSize
height: revealed ? (buttonSize + maxPillHeight - pillOverlap) : buttonSize
height: collapseToIcon ? buttonSize : (revealed ? (buttonSize + maxPillHeight - pillOverlap) : buttonSize)
radius: halfButtonSize
color: root.bgColor
@@ -324,6 +323,8 @@ Item {
}
function show() {
if (collapseToIcon)
return;
if (!showPill) {
shouldAnimateHide = autoHide;
showAnim.start();
@@ -334,6 +335,8 @@ Item {
}
function hide() {
if (collapseToIcon)
return;
if (forceOpen) {
return;
}
@@ -344,6 +347,8 @@ Item {
}
function showDelayed() {
if (collapseToIcon)
return;
if (!showPill) {
shouldAnimateHide = autoHide;
showTimer.start();