File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 33
33
#include " core/io/json.h"
34
34
#include " editor/editor_string_names.h"
35
35
#include " editor/settings/editor_settings.h"
36
+ #include " project_dialog.h"
37
+ #include " scene/gui/texture_rect.h"
36
38
#include " scene/main/http_request.h"
37
39
40
+ void EngineUpdateLabel::set_link_icon (TextureRect *p_icon) {
41
+ icon = p_icon;
42
+ }
43
+
38
44
bool EngineUpdateLabel::_can_check_updates () const {
39
45
return int (EDITOR_GET (" network/connection/network_mode" )) == EditorSettings::NETWORK_ONLINE &&
40
46
UpdateMode (int (EDITOR_GET (" network/connection/check_for_updates" ))) != UpdateMode::DISABLED;
@@ -171,6 +177,7 @@ void EngineUpdateLabel::_set_status(UpdateStatus p_status) {
171
177
if (status == UpdateStatus::BUSY || status == UpdateStatus::UP_TO_DATE) {
172
178
// Hide the label to prevent unnecessary distraction.
173
179
hide ();
180
+ icon->hide ();
174
181
return ;
175
182
} else {
176
183
show ();
@@ -186,19 +193,22 @@ void EngineUpdateLabel::_set_status(UpdateStatus p_status) {
186
193
}
187
194
set_accessibility_live (DisplayServer::AccessibilityLiveMode::LIVE_OFF);
188
195
set_tooltip_text (" " );
196
+ icon->hide ();
189
197
break ;
190
198
}
191
199
192
200
case UpdateStatus::ERROR: {
193
201
set_disabled (false );
194
202
set_accessibility_live (DisplayServer::AccessibilityLiveMode::LIVE_POLITE);
195
203
set_tooltip_text (TTR (" An error has occurred. Click to try again." ));
204
+ icon->hide ();
196
205
} break ;
197
206
198
207
case UpdateStatus::UPDATE_AVAILABLE: {
199
208
set_disabled (false );
200
209
set_accessibility_live (DisplayServer::AccessibilityLiveMode::LIVE_POLITE);
201
210
set_tooltip_text (TTR (" Click to open download page." ));
211
+ icon->show ();
202
212
} break ;
203
213
204
214
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