Skip to content

Commit 9a1f7ea

Browse files
committed
feat: show when the C++ plugin is not installed from widget settings
1 parent 04c1bc8 commit 9a1f7ea

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

package/contents/ui/components/FormWidgetSettings.qml

+15-11
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ ColumnLayout {
2222
property var config: handleString ? JSON.parse(configString) : undefined
2323
property var configLocal: keyName ? config[keyName] : config
2424
signal updateConfigString(configString: string, config: var)
25-
2625
property alias isEnabled: isEnabled.checked
27-
2826
property int currentTab
27+
property var panelColorizer: null
2928

3029
signal tabChanged(currentTab: int)
3130

@@ -60,6 +59,15 @@ ColumnLayout {
6059
// console.error(JSON.stringify(configLocal, null, null))
6160
}
6261

62+
Component.onCompleted: {
63+
try {
64+
panelColorizer = Qt.createQmlObject("import org.kde.plasma.panelcolorizer 1.0; PanelColorizer { id: panelColorizer }", backgroundRoot)
65+
console.error("QML Plugin org.kde.plasma.panelcolorizer loaded");
66+
} catch (err) {
67+
console.error("QML Plugin org.kde.plasma.panelcolorizer not found");
68+
}
69+
}
70+
6371
RowLayout {
6472
Layout.leftMargin: Kirigami.Units.mediumSpacing
6573
Layout.rightMargin: Kirigami.Units.smallSpacing
@@ -132,20 +140,16 @@ ColumnLayout {
132140
}
133141
enabled: isEnabled.checked
134142
}
135-
Button {
136-
checkable: true
137-
checked: showBlurMessage
138-
onClicked: {
139-
showBlurMessage = !showBlurMessage
140-
}
141-
text: i18n("Not working? Read this (click to show)")
143+
Kirigami.ContextualHelpButton {
144+
toolTipText: i18n("Draw a custom blur mask behind the custom background(s).<br><strong>Native panel background must be enabled with opacity of 0 for this to work as intended.</strong>")
142145
}
143146
}
144147
Kirigami.InlineMessage {
145148
id: warningResources
146149
Layout.fillWidth: true
147-
text: i18n("Draw a custom blur mask behind the custom background(s).<br>Requires the C++ plugin to work, check the repository README on GitHub for details.<br><strong>Native panel background must be enabled with opacity of 0 for this to work as intended.</strong>")
148-
visible: showBlurMessage
150+
text: i18n("C++ plugin not installed, <b>Blur custom background</b> will not work.<br>Check the repository README on GitHub for details.")
151+
visible: panelColorizer === null
152+
type: Kirigami.MessageType.Warning
149153
actions: [
150154
Kirigami.Action {
151155
icon.name: "view-readermode-symbolic"

0 commit comments

Comments
 (0)