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:
@@ -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
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user