mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
- CC Color picker widget - Tooltips in more places - Attempt to improve niri screen transitiosn
71 lines
2.3 KiB
QML
71 lines
2.3 KiB
QML
import QtQuick
|
|
import qs.Common
|
|
|
|
Item {
|
|
id: root
|
|
|
|
property var widgetsModel: null
|
|
property var components: null
|
|
property bool noBackground: false
|
|
required property var axis
|
|
|
|
readonly property bool isVertical: axis?.isVertical ?? false
|
|
|
|
implicitHeight: layoutLoader.item ? (layoutLoader.item.implicitHeight || layoutLoader.item.height) : 0
|
|
implicitWidth: layoutLoader.item ? (layoutLoader.item.implicitWidth || layoutLoader.item.width) : 0
|
|
|
|
Loader {
|
|
id: layoutLoader
|
|
anchors.fill: parent
|
|
sourceComponent: root.isVertical ? columnComp : rowComp
|
|
}
|
|
|
|
Component {
|
|
id: rowComp
|
|
Row {
|
|
spacing: noBackground ? 2 : Theme.spacingXS
|
|
Repeater {
|
|
model: root.widgetsModel
|
|
Item {
|
|
width: widgetLoader.item ? widgetLoader.item.width : 0
|
|
height: widgetLoader.item ? widgetLoader.item.height : 0
|
|
WidgetHost {
|
|
id: widgetLoader
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
widgetId: model.widgetId
|
|
widgetData: model
|
|
spacerSize: model.size || 20
|
|
components: root.components
|
|
isInColumn: false
|
|
axis: root.axis
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Component {
|
|
id: columnComp
|
|
Column {
|
|
width: Math.max(parent.width, 200)
|
|
spacing: noBackground ? 2 : Theme.spacingXS
|
|
Repeater {
|
|
model: root.widgetsModel
|
|
Item {
|
|
width: parent.width
|
|
height: widgetLoader.item ? widgetLoader.item.height : 0
|
|
WidgetHost {
|
|
id: widgetLoader
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
widgetId: model.widgetId
|
|
widgetData: model
|
|
spacerSize: model.size || 20
|
|
components: root.components
|
|
isInColumn: true
|
|
axis: root.axis
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |