1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04: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 id: root
property var availableWidgets: [] property var availableWidgets: []
property Item popoutContent: null
signal addWidget(string widgetId) signal addWidget(string widgetId)
signal resetToDefault() signal resetToDefault()
@@ -19,7 +20,9 @@ Row {
Popup { Popup {
id: addWidgetPopup 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 width: 400
height: 300 height: 300
modal: true modal: true

View File

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