mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
No need to track open popups anymore. Avoid widgets to include services directly
This commit is contained in:
@@ -25,19 +25,12 @@ Popup {
|
||||
anchors.centerIn: parent
|
||||
|
||||
onOpened: {
|
||||
// Mark this popup has opened in the PanelService
|
||||
PanelService.willOpenPopup(root)
|
||||
|
||||
// Load settings when popup opens with data
|
||||
if (widgetData && widgetId) {
|
||||
loadWidgetSettings()
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
PanelService.willClosePopup(root)
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
id: bgRect
|
||||
|
||||
|
||||
@@ -23,16 +23,11 @@ Popup {
|
||||
anchors.centerIn: parent
|
||||
|
||||
onOpened: {
|
||||
PanelService.willOpenPopup(root)
|
||||
if (widgetData && widgetId) {
|
||||
loadWidgetSettings()
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
PanelService.willClosePopup(root)
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: Color.mSurface
|
||||
radius: Style.radiusL
|
||||
|
||||
@@ -12,7 +12,7 @@ SmartPanel {
|
||||
id: root
|
||||
|
||||
preferredWidth: Math.round(820 * Style.uiScaleRatio)
|
||||
preferredHeight: Math.round(900 * Style.uiScaleRatio)
|
||||
preferredHeight: Math.round(910 * Style.uiScaleRatio)
|
||||
|
||||
readonly property bool attachToBar: Settings.data.ui.settingsPanelAttachToBar
|
||||
readonly property string barPosition: Settings.data.bar.position
|
||||
|
||||
@@ -16,12 +16,6 @@ Singleton {
|
||||
signal willOpen
|
||||
signal didClose
|
||||
|
||||
// Currently opened popups, can have more than one.
|
||||
// ex: when opening an NIconPicker from a widget setting.
|
||||
property var openedPopups: []
|
||||
property bool hasOpenedPopup: false
|
||||
signal popupChanged
|
||||
|
||||
// Register this panel (called after panel is loaded)
|
||||
function registerPanel(panel) {
|
||||
registeredPanels[panel.objectName] = panel
|
||||
@@ -77,17 +71,4 @@ Singleton {
|
||||
// emit signal
|
||||
didClose()
|
||||
}
|
||||
|
||||
// Popups
|
||||
function willOpenPopup(popup) {
|
||||
openedPopups.push(popup)
|
||||
hasOpenedPopup = (openedPopups.length !== 0)
|
||||
popupChanged()
|
||||
}
|
||||
|
||||
function willClosePopup(popup) {
|
||||
openedPopups = openedPopups.filter(p => p !== popup)
|
||||
hasOpenedPopup = (openedPopups.length !== 0)
|
||||
popupChanged()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,14 +26,6 @@ Popup {
|
||||
|
||||
modal: true
|
||||
|
||||
onOpened: {
|
||||
PanelService.willOpenPopup(root)
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
PanelService.willClosePopup(root)
|
||||
}
|
||||
|
||||
function rgbToHsv(r, g, b) {
|
||||
r /= 255
|
||||
g /= 255
|
||||
|
||||
@@ -108,14 +108,6 @@ RowLayout {
|
||||
implicitHeight: Math.min(root.popupHeight, contentItem.implicitHeight + Style.marginM * 2)
|
||||
padding: Style.marginM
|
||||
|
||||
onOpened: {
|
||||
PanelService.willOpenPopup(root)
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
PanelService.willClosePopup(root)
|
||||
}
|
||||
|
||||
contentItem: NListView {
|
||||
model: combo.popup.visible ? root.model : null
|
||||
implicitHeight: contentHeight
|
||||
|
||||
@@ -17,9 +17,6 @@ Popup {
|
||||
width: 180
|
||||
padding: Style.marginS
|
||||
|
||||
onOpened: PanelService.willOpenPopup(root)
|
||||
onClosed: PanelService.willClosePopup(root)
|
||||
|
||||
background: Rectangle {
|
||||
color: Color.mSurfaceVariant
|
||||
border.color: Color.mOutline
|
||||
|
||||
@@ -27,14 +27,6 @@ Popup {
|
||||
signal accepted(var paths)
|
||||
signal cancelled
|
||||
|
||||
onOpened: {
|
||||
PanelService.willOpenPopup(root)
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
PanelService.willClosePopup(root)
|
||||
}
|
||||
|
||||
function openFilePicker() {
|
||||
if (!root.currentPath)
|
||||
root.currentPath = root.initialPath
|
||||
|
||||
@@ -4,7 +4,6 @@ import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
import qs.Services.UI
|
||||
|
||||
Popup {
|
||||
id: root
|
||||
@@ -36,11 +35,6 @@ Popup {
|
||||
selectedIcon = initialIcon
|
||||
query = initialIcon
|
||||
searchInput.forceActiveFocus()
|
||||
PanelService.willOpenPopup(root)
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
PanelService.willClosePopup(root)
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
|
||||
@@ -158,14 +158,6 @@ RowLayout {
|
||||
height: root.popupHeight + 60
|
||||
padding: Style.marginM
|
||||
|
||||
onOpened: {
|
||||
PanelService.willOpenPopup(root)
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
PanelService.willClosePopup(root)
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: Style.marginS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user