Skip to content

Commit e8b60bc

Browse files
committed
chore: show warning text if the widget is placed on the desktop
1 parent 15c4935 commit e8b60bc

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

package/contents/ui/CompactRepresentation.qml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import QtQuick
22
import "components" as Components
33
import org.kde.kirigami as Kirigami
44
import org.kde.plasma.core as PlasmaCore
5+
import org.kde.plasma.components as PC3
56

67
MouseArea {
78
id: compact
@@ -30,7 +31,16 @@ MouseArea {
3031

3132
height: Kirigami.Units.iconSizes.roundedIconSize(Math.min(parent.width, parent.height))
3233
width: height
33-
source: icon
34+
source: compact.icon
35+
}
36+
37+
PC3.Label {
38+
font: Kirigami.Theme.smallFont
39+
text: main.toolTipSubText
40+
width: compact.width
41+
wrapMode: PC3.Label.WordWrap
42+
visible: main.onDesktop
43+
textFormat: PC3.Label.RichText
3444
}
3545
}
3646
}

package/contents/ui/main.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ PlasmoidItem {
890890
toolTipSubText: {
891891
let text = "";
892892
if (onDesktop) {
893-
text = "<font color='" + Kirigami.Theme.neutralTextColor + "'>Panel not found, this widget must be child of a panel</font>";
893+
text = `<font color="${Kirigami.Theme.neutralTextColor}">` + i18n("This widget must be placed in a panel to work!") + "</font>";
894894
} else if (Plasmoid.configuration.isEnabled) {
895895
const name = Plasmoid.configuration.lastPreset.split("/");
896896
if (name.length) {
@@ -899,7 +899,7 @@ PlasmoidItem {
899899
}
900900
return text;
901901
}
902-
toolTipTextFormat: Text.PlainText
902+
toolTipTextFormat: Text.RichText
903903

904904
function updatePlasmoidStatus() {
905905
Plasmoid.status = (editMode || !hideWidget || !runningLatest) ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus;

0 commit comments

Comments
 (0)