File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 30
30
31
31
#include " engine_update_label.h"
32
32
33
- #include " core/io/json.h"
34
33
#include " editor/editor_string_names.h"
35
34
#include " editor/settings/editor_settings.h"
35
+ #include " project_dialog.h"
36
36
#include " scene/main/http_request.h"
37
+ #include " scene/gui/texture_rect.h"
38
+
39
+ void EngineUpdateLabel::set_link_icon (TextureRect *p_icon) {
40
+ icon = p_icon;
41
+ }
37
42
38
43
bool EngineUpdateLabel::_can_check_updates () const {
39
44
return int (EDITOR_GET (" network/connection/network_mode" )) == EditorSettings::NETWORK_ONLINE &&
@@ -171,6 +176,7 @@ void EngineUpdateLabel::_set_status(UpdateStatus p_status) {
171
176
if (status == UpdateStatus::BUSY || status == UpdateStatus::UP_TO_DATE) {
172
177
// Hide the label to prevent unnecessary distraction.
173
178
hide ();
179
+ icon->hide ();
174
180
return ;
175
181
} else {
176
182
show ();
@@ -186,19 +192,22 @@ void EngineUpdateLabel::_set_status(UpdateStatus p_status) {
186
192
}
187
193
set_accessibility_live (DisplayServer::AccessibilityLiveMode::LIVE_OFF);
188
194
set_tooltip_text (" " );
195
+ icon->hide ();
189
196
break ;
190
197
}
191
198
192
199
case UpdateStatus::ERROR: {
193
200
set_disabled (false );
194
201
set_accessibility_live (DisplayServer::AccessibilityLiveMode::LIVE_POLITE);
195
202
set_tooltip_text (TTR (" An error has occurred. Click to try again." ));
203
+ icon->hide ();
196
204
} break ;
197
205
198
206
case UpdateStatus::UPDATE_AVAILABLE: {
199
207
set_disabled (false );
200
208
set_accessibility_live (DisplayServer::AccessibilityLiveMode::LIVE_POLITE);
201
209
set_tooltip_text (TTR (" Click to open download page." ));
210
+ icon->show ();
202
211
} break ;
203
212
204
213
default : {
Original file line number Diff line number Diff line change 31
31
#pragma once
32
32
33
33
#include " scene/gui/link_button.h"
34
+ #include " scene/gui/texture_rect.h"
34
35
35
36
class HTTPRequest ;
36
37
@@ -45,6 +46,8 @@ class EngineUpdateLabel : public LinkButton {
45
46
NEWEST_PATCH,
46
47
};
47
48
49
+ void set_link_icon (TextureRect *p_icon);
50
+
48
51
private:
49
52
static constexpr int DEV_VERSION = 9999 ; // Version index for unnumbered builds (assumed to always be newest).
50
53
@@ -74,6 +77,7 @@ class EngineUpdateLabel : public LinkButton {
74
77
} theme_cache;
75
78
76
79
HTTPRequest *http = nullptr ;
80
+ TextureRect *icon = nullptr ;
77
81
78
82
UpdateStatus status = UpdateStatus::NONE;
79
83
bool checked_update = false ;
Original file line number Diff line number Diff line change @@ -1670,6 +1670,12 @@ ProjectManager::ProjectManager() {
1670
1670
EngineUpdateLabel *update_label = memnew (EngineUpdateLabel);
1671
1671
footer_bar->add_child (update_label);
1672
1672
update_label->connect (" offline_clicked" , callable_mp (this , &ProjectManager::_show_quick_settings));
1673
+
1674
+ TextureRect *link_icon = memnew (TextureRect);
1675
+ link_icon->set_texture (get_editor_theme_icon (SNAME (" ExternalLink" )));
1676
+ link_icon->hide ();
1677
+ update_label->set_link_icon (link_icon);
1678
+ footer_bar->add_child (link_icon);
1673
1679
#endif
1674
1680
1675
1681
EditorVersionButton *version_btn = memnew (EditorVersionButton (EditorVersionButton::FORMAT_WITH_BUILD));
You can’t perform that action at this time.
0 commit comments