mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-15 07:44:01 -04:00
102 lines
2.2 KiB
QML
102 lines
2.2 KiB
QML
import QtQuick
|
|
|
|
Loader {
|
|
id: root
|
|
|
|
required property var grid
|
|
property var widgetData: ({})
|
|
property int savedIndex: -1
|
|
property real columns: 1
|
|
property real rows: 1
|
|
property bool compact: false
|
|
property bool small: false
|
|
property bool docked: false
|
|
|
|
sourceComponent: grid.model ? grid.model.componentForWidget(widgetData) : null
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "widgetData"
|
|
value: root.widgetData
|
|
when: root.item !== null
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "widgetDef"
|
|
value: root.grid.model?.getWidgetForId(root.widgetData.id || "") ?? null
|
|
when: root.item !== null
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "host"
|
|
value: root.grid
|
|
when: root.item !== null
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "live"
|
|
value: root.grid.live
|
|
when: root.item !== null
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "interactive"
|
|
value: !root.grid.editMode
|
|
when: root.item !== null
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "columns"
|
|
value: root.columns
|
|
when: root.item !== null
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "rows"
|
|
value: root.rows
|
|
when: root.item !== null
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "compact"
|
|
value: root.compact
|
|
when: root.item !== null
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "small"
|
|
value: root.small
|
|
when: root.item !== null && "small" in root.item
|
|
}
|
|
|
|
Binding {
|
|
target: root.item
|
|
property: "docked"
|
|
value: root.docked
|
|
when: root.item !== null && "docked" in root.item
|
|
}
|
|
|
|
Connections {
|
|
target: root.item
|
|
ignoreUnknownSignals: true
|
|
|
|
function onExpandClicked() {
|
|
if (root.grid.editMode)
|
|
return;
|
|
root.grid.expandClicked(root.widgetData);
|
|
}
|
|
|
|
function onOptionChanged(key, value) {
|
|
root.grid.model?.setOption(root.savedIndex, key, value);
|
|
}
|
|
}
|
|
}
|