Skip to content

Commit 02bf2d3

Browse files
Add link icon to update label
1 parent bfa330d commit 02bf2d3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

editor/project_manager/engine_update_label.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "editor/editor_string_names.h"
3535
#include "editor/settings/editor_settings.h"
3636
#include "scene/main/http_request.h"
37+
#include "scene/resources/texture_2d.h"
3738

3839
bool EngineUpdateLabel::_can_check_updates() const {
3940
return int(EDITOR_GET("network/connection/network_mode")) == EditorSettings::NETWORK_ONLINE &&
@@ -186,19 +187,22 @@ void EngineUpdateLabel::_set_status(UpdateStatus p_status) {
186187
}
187188
set_accessibility_live(DisplayServer::AccessibilityLiveMode::LIVE_OFF);
188189
set_tooltip_text("");
190+
set_icon(Ref<Texture2D>());
189191
break;
190192
}
191193

192194
case UpdateStatus::ERROR: {
193195
set_disabled(false);
194196
set_accessibility_live(DisplayServer::AccessibilityLiveMode::LIVE_POLITE);
195197
set_tooltip_text(TTR("An error has occurred. Click to try again."));
198+
set_icon(Ref<Texture2D>());
196199
} break;
197200

198201
case UpdateStatus::UPDATE_AVAILABLE: {
199202
set_disabled(false);
200203
set_accessibility_live(DisplayServer::AccessibilityLiveMode::LIVE_POLITE);
201204
set_tooltip_text(TTR("Click to open download page."));
205+
set_icon(get_editor_theme_icon(SNAME("ExternalLink")));
202206
} break;
203207

204208
default: {
@@ -264,6 +268,7 @@ void EngineUpdateLabel::_notification(int p_what) {
264268
} break;
265269

266270
case NOTIFICATION_READY: {
271+
set_icon_alignment(ICON_ALIGNMENT_RIGHT);
267272
if (_can_check_updates()) {
268273
_check_update();
269274
} else {

editor/project_manager/engine_update_label.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030

3131
#pragma once
3232

33-
#include "scene/gui/link_button.h"
33+
#include "scene/gui/button.h"
3434

3535
class HTTPRequest;
3636

37-
class EngineUpdateLabel : public LinkButton {
38-
GDCLASS(EngineUpdateLabel, LinkButton);
37+
class EngineUpdateLabel : public Button {
38+
GDCLASS(EngineUpdateLabel, Button);
3939

4040
public:
4141
enum class UpdateMode {

0 commit comments

Comments
 (0)