1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Center add widget in cc

This commit is contained in:
bbedward
2025-10-02 13:45:52 -04:00
parent 2428b22171
commit 8c4aba5479
2 changed files with 5 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ Row {
id: root
property var availableWidgets: []
property Item popoutContent: null
signal addWidget(string widgetId)
signal resetToDefault()
@@ -19,7 +20,9 @@ Row {
Popup {
id: addWidgetPopup
anchors.centerIn: parent
parent: popoutContent
x: parent ? Math.round((parent.width - width) / 2) : 0
y: parent ? Math.round((parent.height - height) / 2) : 0
width: 400
height: 300
modal: true

View File

@@ -171,6 +171,7 @@ DankPopout {
EditControls {
width: parent.width
visible: editMode
popoutContent: controlContent
availableWidgets: {
const existingIds = (SettingsData.controlCenterWidgets || []).map(w => w.id)
return widgetModel.baseWidgetDefinitions.filter(w => w.allowMultiple || !existingIds.includes(w.id))