mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
NPanel: if bar opacity < 33%, detach panel from bar and dont match bg opacity.
This commit is contained in:
+8
-5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user