Skip to content

Commit 574e678

Browse files
committed
ui/reload: add textual fallback for copy and close icons
1 parent 823456b commit 574e678

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

src/ui/ReloadPopup.qml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ PanelWindow {
5858

5959
component TopButton: WrapperMouseArea {
6060
id: buttonMouse
61-
property alias image: image.source
61+
required property string icon
62+
required property string fallbackText
6263
property bool red: false
6364

6465
hoverEnabled: true
@@ -95,7 +96,20 @@ PanelWindow {
9596
Behavior on color { ColorAnimation { duration: 100 } }
9697
Behavior on border.color { ColorAnimation { duration: 100 } }
9798

98-
IconImage { id: image; implicitSize: 22 }
99+
IconImage {
100+
id: image
101+
source: Quickshell.iconPath(buttonMouse.icon, true)
102+
implicitSize: 22
103+
visible: source != ""
104+
}
105+
106+
Text {
107+
id: fallback
108+
text: buttonMouse.fallbackText
109+
color: buttonMouse.red ? "white" : palette.active.buttonText
110+
}
111+
112+
child: image.visible ? image : fallback
99113
}
100114
}
101115

@@ -130,7 +144,8 @@ PanelWindow {
130144
TopButton {
131145
id: copyButton
132146
visible: root.failed
133-
image: Quickshell.iconPath("edit-copy")
147+
icon: "edit-copy"
148+
fallbackText: "Copy"
134149
onClicked: {
135150
Quickshell.clipboardText = root.errorString;
136151
copyTooltip.showAction();
@@ -146,7 +161,8 @@ PanelWindow {
146161
}
147162

148163
TopButton {
149-
image: Quickshell.iconPath("window-close")
164+
icon: "window-close"
165+
fallbackText: "Close"
150166
red: true
151167
onClicked: {
152168
fadeOutAnim.stop()
@@ -216,7 +232,8 @@ PanelWindow {
216232
IconImage {
217233
Layout.fillHeight: true
218234
implicitWidth: height
219-
source: Quickshell.iconPath("edit-copy")
235+
source: Quickshell.iconPath("edit-copy", true)
236+
visible: source != ""
220237
}
221238
}
222239
}

src/ui/reload_popup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void ReloadPopup::closed() {
3939
this->deleting = true;
4040

4141
QTimer::singleShot(0, [this]() {
42-
this->popup->deleteLater();
42+
if (this->popup) this->popup->deleteLater();
4343
this->generation->destroy();
4444
this->deleteLater();
4545
});

0 commit comments

Comments
 (0)