NPanel: if bar opacity < 33%, detach panel from bar and dont match bg opacity.

This commit is contained in:
ItsLemmy
2025-10-31 16:12:41 -04:00
parent 87144df024
commit c036ff0d7a
+8 -5
View File
@@ -211,7 +211,10 @@ Loader {
NShapedRectangle {
id: panelBackground
backgroundColor: (attachedToBar && Settings.data.bar.backgroundOpacity > 0 && (topLeftInverted || topRightInverted || bottomLeftInverted || bottomRightInverted)) ? Qt.alpha(panelBackgroundColor, Settings.data.bar.backgroundOpacity) : panelBackgroundColor
property real opacityThreshold: 0.33
backgroundColor: (attachedToBar && Settings.data.bar.backgroundOpacity > opacityThreshold && (topLeftInverted || topRightInverted || bottomLeftInverted || bottomRightInverted)) ? Qt.alpha(panelBackgroundColor, Settings.data.bar.backgroundOpacity) : panelBackgroundColor
topLeftRadius: Style.radiusL
topRightRadius: Style.radiusL
@@ -222,7 +225,7 @@ Loader {
// Top-left corner
topLeftInverted: {
if (!attachedToBar || Settings.data.bar.backgroundOpacity <= 0)
if (!attachedToBar || Settings.data.bar.backgroundOpacity <= opacityThreshold)
return false
// Inverted if panel is anchored to top edge (bar is at top)
@@ -237,7 +240,7 @@ Loader {
// Top-right corner
topRightInverted: {
if (!attachedToBar || Settings.data.bar.backgroundOpacity <= 0)
if (!attachedToBar || Settings.data.bar.backgroundOpacity <= opacityThreshold)
return false
// Inverted if panel is anchored to top edge (bar is at top)
@@ -252,7 +255,7 @@ Loader {
// Bottom-left corner
bottomLeftInverted: {
if (!attachedToBar || Settings.data.bar.backgroundOpacity <= 0)
if (!attachedToBar || Settings.data.bar.backgroundOpacity <= opacityThreshold)
return false
// Inverted if panel is anchored to bottom edge (bar is at bottom)
@@ -267,7 +270,7 @@ Loader {
// Bottom-right corner
bottomRightInverted: {
if (!attachedToBar || Settings.data.bar.backgroundOpacity <= 0)
if (!attachedToBar || Settings.data.bar.backgroundOpacity <= opacityThreshold)
return false
// Inverted if panel is anchored to bottom edge (bar is at bottom)