Prevent NPanel dragging when popup are open.

This commit is contained in:
ItsLemmy
2025-09-22 13:40:38 -04:00
parent 64001152ef
commit c20773d60b
6 changed files with 24 additions and 16 deletions
+5 -3
View File
@@ -52,9 +52,11 @@ NIconButton {
width: root.width * 0.8
height: width
source: {
if (customIconPath !== "") return customIconPath;
if (useDistroLogo) return DistroLogoService.osLogo;
return "";
if (customIconPath !== "")
return customIconPath
if (useDistroLogo)
return DistroLogoService.osLogo
return ""
}
visible: source !== ""
smooth: true
@@ -26,7 +26,7 @@ Popup {
height: content.implicitHeight + padding * 2
padding: Style.marginXL * scaling
modal: true
onOpened: {
// Mark this popup has opened in the PanelService
PanelService.willOpenPopup(widgetSettings)
@@ -120,7 +120,7 @@ Popup {
}
}
function loadWidgetSettings() {
function loadWidgetSettings() {
const widgetSettingsMap = {
"ActiveWindow": "WidgetSettings/ActiveWindowSettings.qml",
"Battery": "WidgetSettings/BatterySettings.qml",
@@ -147,5 +147,4 @@ Popup {
})
}
}
}
@@ -38,7 +38,6 @@ ColumnLayout {
}
}
RowLayout {
spacing: Style.marginM * scaling
@@ -79,9 +78,9 @@ ColumnLayout {
id: iconPicker
initialIcon: valueIcon
onIconSelected: iconName => {
valueIcon = iconName
valueCustomIconPath = ""
}
valueIcon = iconName
valueCustomIconPath = ""
}
}
NFilePicker {
@@ -89,4 +88,4 @@ ColumnLayout {
title: "Select a custom icon"
onAccepted: paths => valueCustomIconPath = paths[0]
}
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ NPanel {
panelKeyboardFocus: true
draggable: true
draggable: (PanelService.openedPopup === null)
// Tabs enumeration, order is NOT relevant
enum Tab {
@@ -18,7 +18,8 @@ NPanel {
panelAnchorHorizontalCenter: true
panelAnchorVerticalCenter: true
panelKeyboardFocus: true
draggable: true
draggable: (PanelService.openedPopup === null)
panelContent: Rectangle {
id: wallpaperPanel
+10 -3
View File
@@ -26,7 +26,14 @@ Popup {
y: (parent.height - height) * 0.5
modal: true
clip: true
onOpened: {
PanelService.willOpenPopup(root)
}
onClosed: {
PanelService.willClosePopup(root)
}
function rgbToHsv(r, g, b) {
r /= 255
@@ -110,9 +117,9 @@ Popup {
border.width: Math.max(1, Style.borderM * scaling)
}
NScrollView {
contentItem: NScrollView {
id: scrollView
anchors.fill: parent
width: parent.width
verticalPolicy: ScrollBar.AlwaysOff
horizontalPolicy: ScrollBar.AlwaysOff