mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-16 00:04:01 -04:00
35 lines
845 B
QML
35 lines
845 B
QML
import QtQuick
|
|
import qs.Common
|
|
import qs.Modules.ControlCenter
|
|
|
|
CcTile {
|
|
id: root
|
|
|
|
readonly property string action: widgetData?.id ?? ""
|
|
readonly property bool finishing: action === "edit" && (host?.editMode ?? false)
|
|
|
|
toggle: false
|
|
active: finishing
|
|
tooltips: !finishing
|
|
iconName: finishing ? "check" : widgetDef?.icon ?? ""
|
|
title: widgetDef?.text ?? ""
|
|
restIconColor: action === "power" ? Theme.error : CcMetrics.tileInactiveIcon
|
|
|
|
onClicked: {
|
|
switch (action) {
|
|
case "lock":
|
|
host?.lockRequested();
|
|
return;
|
|
case "power":
|
|
host?.powerRequested();
|
|
return;
|
|
case "settings":
|
|
host?.settingsRequested();
|
|
return;
|
|
case "edit":
|
|
host?.editRequested();
|
|
return;
|
|
}
|
|
}
|
|
}
|