mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-11 00:28:53 +00:00
fix: disable panel dragging during text input and dialog interaction
NPanel: disable DragHandler when popups open, block drag over text inputs BarWidgetSettingsDialog: notify panel of open/close state BarSectionEditor: pass panel reference to dialog
This commit is contained in:
@@ -23,6 +23,9 @@ NBox {
|
||||
signal dragPotentialStarted
|
||||
signal dragPotentialEnded
|
||||
|
||||
property bool hasOpenDialog: false
|
||||
property bool hasOpenPopup: false
|
||||
|
||||
color: Color.mSurface
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumHeight: {
|
||||
@@ -189,11 +192,15 @@ NBox {
|
||||
onClicked: {
|
||||
var component = Qt.createComponent(Qt.resolvedUrl("BarWidgetSettingsDialog.qml"))
|
||||
function instantiateAndOpen() {
|
||||
// Find the settings panel
|
||||
var settingsPanel = findSettingsPanel()
|
||||
|
||||
var dialog = component.createObject(root, {
|
||||
"widgetIndex": index,
|
||||
"widgetData": modelData,
|
||||
"widgetId": modelData.id,
|
||||
"parent": Overlay.overlay
|
||||
"parent": Overlay.overlay,
|
||||
"settingsPanel": settingsPanel
|
||||
})
|
||||
if (dialog) {
|
||||
dialog.open()
|
||||
@@ -201,6 +208,11 @@ NBox {
|
||||
Logger.error("BarSectionEditor", "Failed to create settings dialog instance")
|
||||
}
|
||||
}
|
||||
|
||||
function findSettingsPanel() {
|
||||
var panel = PanelService.getPanel("settingsPanel")
|
||||
return panel
|
||||
}
|
||||
if (component.status === Component.Ready) {
|
||||
instantiateAndOpen()
|
||||
} else if (component.status === Component.Error) {
|
||||
|
||||
@@ -14,6 +14,7 @@ Popup {
|
||||
property int widgetIndex: -1
|
||||
property var widgetData: null
|
||||
property string widgetId: ""
|
||||
property var settingsPanel: null
|
||||
|
||||
// Center popup in parent
|
||||
x: (parent.width - width) * 0.5
|
||||
@@ -23,6 +24,7 @@ Popup {
|
||||
height: content.implicitHeight + padding * 2
|
||||
padding: Style.marginXL * scaling
|
||||
modal: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
background: Rectangle {
|
||||
id: bgRect
|
||||
@@ -37,6 +39,20 @@ Popup {
|
||||
if (widgetData && widgetId) {
|
||||
loadWidgetSettings()
|
||||
}
|
||||
notifySettingsPanel(true)
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
notifySettingsPanel(false)
|
||||
}
|
||||
|
||||
function notifySettingsPanel(isOpen) {
|
||||
if (settingsPanel && settingsPanel.hasOwnProperty('hasOpenPopup')) {
|
||||
settingsPanel.hasOpenPopup = isOpen
|
||||
Logger.log("BarWidgetSettingsDialog", "Notified settings panel popup state:", isOpen, "Panel:", settingsPanel.objectName || "unnamed")
|
||||
} else {
|
||||
Logger.warn("BarWidgetSettingsDialog", "No settings panel reference available to notify popup state:", isOpen)
|
||||
}
|
||||
}
|
||||
|
||||
function loadWidgetSettings() {
|
||||
|
||||
Reference in New Issue
Block a user