MainScreen+SmartPanel: Allow click on the bar when a panel is open.

This commit is contained in:
ItsLemmy
2025-11-14 20:26:05 -05:00
parent 312d1b6d22
commit edef856895
3 changed files with 19 additions and 17 deletions
+3 -14
View File
@@ -112,7 +112,7 @@ PanelWindow {
return monitors.length === 0 || monitors.includes(screenName)
}
// Fully reactive mask system, make everything click-through except bar and open panels
// Make everything click-through except bar
mask: Region {
id: clickableMask
@@ -123,9 +123,7 @@ PanelWindow {
height: root.height
intersection: Intersection.Xor
// Only include regions that are actually needed
// panelRegions is handled by PanelService, bar is local to this screen
regions: [barMaskRegion, backgroundMaskRegion]
regions: [barMaskRegion]
// Bar region - subtract bar area from mask (only if bar should be shown on this screen)
Region {
@@ -133,21 +131,12 @@ PanelWindow {
x: barPlaceholder.x
y: barPlaceholder.y
// Set width/height to 0 if bar shouldn't show on this screen (makes region empty)
width: root.barShouldShow ? barPlaceholder.width : 0
height: root.barShouldShow ? barPlaceholder.height : 0
intersection: Intersection.Subtract
}
// Background region for click-to-close - reactive sizing
Region {
id: backgroundMaskRegion
x: 0
y: 0
width: root.isPanelOpen && !isPanelClosing ? root.width : 0
height: root.isPanelOpen && !isPanelClosing ? root.height : 0
intersection: Intersection.Subtract
}
}
// --------------------------------------
+11 -3
View File
@@ -71,6 +71,14 @@ PanelWindow {
right: true
}
// Margins to exclude bar area so bar remains clickable
margins {
top: placeholder.barPosition === "top" ? (placeholder.barMarginV + Style.barHeight) : 0
bottom: placeholder.barPosition === "bottom" ? (placeholder.barMarginV + Style.barHeight) : 0
left: placeholder.barPosition === "left" ? (placeholder.barMarginH + Style.barHeight) : 0
right: placeholder.barPosition === "right" ? (placeholder.barMarginH + Style.barHeight) : 0
}
// Sync state to placeholder
onIsPanelVisibleChanged: {
placeholder.isPanelVisible = isPanelVisible
@@ -243,9 +251,9 @@ PanelWindow {
// Content wrapper with opacity animation
Item {
id: contentWrapper
// Position at placeholder location within fullscreen window
x: placeholder.panelItem.x
y: placeholder.panelItem.y
// Position at placeholder location, compensating for window margins
x: placeholder.panelItem.x - (placeholder.barPosition === "left" ? (placeholder.barMarginH + Style.barHeight) : 0)
y: placeholder.panelItem.y - (placeholder.barPosition === "top" ? (placeholder.barMarginV + Style.barHeight) : 0)
width: placeholder.panelItem.width
height: placeholder.panelItem.height
z: 1 // Above click-to-close MouseArea