mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-15 07:44:01 -04:00
them towards theme controlCenter: make a real grid, add numerous more tile varieties, add icon size option surfaces: fix elevation levels in general, and shift them down settings: restyles and re-org sliders: scale down universally
40 lines
1.3 KiB
QML
40 lines
1.3 KiB
QML
import QtQuick
|
|
import qs.Common
|
|
import qs.Services
|
|
|
|
CcTile {
|
|
id: root
|
|
|
|
readonly property string widgetId: widgetData.id || ""
|
|
readonly property bool isBuiltin: widgetId.startsWith("builtin_")
|
|
readonly property string pluginId: isBuiltin ? "" : widgetId.replace("plugin_", "")
|
|
readonly property var instance: isBuiltin ? (host?.model?.builtinInstances[widgetId] ?? null) : pluginHost.instance
|
|
readonly property bool hasDetail: (instance?.ccDetailContent ?? null) !== null
|
|
|
|
iconName: instance?.ccWidgetIcon || widgetDef?.icon || "extension"
|
|
title: instance?.ccWidgetPrimaryText || widgetDef?.text || I18n.tr("Plugin")
|
|
subtitle: instance?.ccWidgetSecondaryText || ""
|
|
active: instance?.ccWidgetIsActive ?? false
|
|
toggle: instance?.ccWidgetIsToggle ?? true
|
|
showExpand: hasDetail
|
|
opensPage: (!toggle || compact) && hasDetail
|
|
expandedContent: instance?.ccExpandedContent ?? null
|
|
expandedMinimumHeight: instance?.ccExpandedMinimumHeight ?? Theme.listItemHeight
|
|
enabled: instance !== null
|
|
|
|
onClicked: {
|
|
if ((compact || !toggle) && hasDetail) {
|
|
expandClicked();
|
|
return;
|
|
}
|
|
instance?.ccWidgetToggled();
|
|
}
|
|
|
|
onExpandClicked: instance?.ccWidgetExpanded()
|
|
|
|
PluginInstanceHost {
|
|
id: pluginHost
|
|
pluginId: root.pluginId
|
|
}
|
|
}
|