mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-11 00:02:28 -04:00
plugins/desktop-widgets: create a new "desktop" widget plugin type
- Draggable per-monitor background layer widgets - Add basic dms version checks on plugins - Clock: built-in clock desktop plugin - dgop: built-in system monitor desktop plugin
This commit is contained in:
@@ -120,6 +120,75 @@ FocusScope {
|
||||
}
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
id: incompatWarning
|
||||
property var incompatPlugins: []
|
||||
width: parent.width
|
||||
height: incompatWarningColumn.implicitHeight + Theme.spacingM * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.1)
|
||||
border.color: Theme.error
|
||||
border.width: 1
|
||||
visible: incompatPlugins.length > 0
|
||||
|
||||
function refresh() {
|
||||
incompatPlugins = PluginService.getIncompatiblePlugins();
|
||||
}
|
||||
|
||||
Component.onCompleted: Qt.callLater(refresh)
|
||||
|
||||
Column {
|
||||
id: incompatWarningColumn
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingM
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
Row {
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
DankIcon {
|
||||
name: "error"
|
||||
size: 16
|
||||
color: Theme.error
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Incompatible Plugins Loaded")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.error
|
||||
font.weight: Font.Medium
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Some plugins require a newer version of DMS:") + " " + incompatWarning.incompatPlugins.map(p => p.name + " (" + p.requires_dms + ")").join(", ")
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: PluginService
|
||||
function onPluginLoaded() {
|
||||
incompatWarning.refresh();
|
||||
}
|
||||
function onPluginUnloaded() {
|
||||
incompatWarning.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SystemUpdateService
|
||||
function onSemverVersionChanged() {
|
||||
incompatWarning.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Flow {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Reference in New Issue
Block a user