diff options
author | kobewi <kobewi4e@gmail.com> | 2024-04-22 21:36:22 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2024-04-22 21:36:22 +0200 |
commit | b8ee1366bc170115e061d036d20376e6848f6905 (patch) | |
tree | 2a1a812c60cd239403327c4e94024d726b17a1d9 /editor/engine_update_label.cpp | |
parent | 7529c0bec597d70bc61975a82063bb5112ac8879 (diff) | |
download | redot-engine-b8ee1366bc170115e061d036d20376e6848f6905.tar.gz |
Hide update status label when no action is required
Diffstat (limited to 'editor/engine_update_label.cpp')
-rw-r--r-- | editor/engine_update_label.cpp | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/editor/engine_update_label.cpp b/editor/engine_update_label.cpp index 0b20738e99..1d7df806de 100644 --- a/editor/engine_update_label.cpp +++ b/editor/engine_update_label.cpp @@ -180,22 +180,15 @@ void EngineUpdateLabel::_set_message(const String &p_message, const Color &p_col void EngineUpdateLabel::_set_status(UpdateStatus p_status) { status = p_status; - if (compact_mode) { - if (status != UpdateStatus::BUSY && status != UpdateStatus::UPDATE_AVAILABLE) { - hide(); - return; - } else { - show(); - } + if (status == UpdateStatus::DEV || status == UpdateStatus::BUSY || status == UpdateStatus::UP_TO_DATE) { + // Hide the label to prevent unnecessary distraction. + hide(); + return; + } else { + show(); } switch (status) { - case UpdateStatus::DEV: { - set_disabled(true); - _set_message(TTR("Running a development build."), theme_cache.disabled_color); - set_tooltip_text(TTR("Exact version can't be determined for update checking.")); - break; - } case UpdateStatus::OFFLINE: { set_disabled(false); if (int(EDITOR_GET("network/connection/network_mode")) == EditorSettings::NETWORK_OFFLINE) { @@ -206,23 +199,12 @@ void EngineUpdateLabel::_set_status(UpdateStatus p_status) { set_tooltip_text(""); break; } - case UpdateStatus::BUSY: { - set_disabled(true); - _set_message(TTR("Checking for updates..."), theme_cache.default_color); - set_tooltip_text(""); - } break; case UpdateStatus::ERROR: { set_disabled(false); set_tooltip_text(TTR("An error has occurred. Click to try again.")); } break; - case UpdateStatus::UP_TO_DATE: { - set_disabled(false); - _set_message(TTR("Current version up to date."), theme_cache.disabled_color); - set_tooltip_text(TTR("Click to check again.")); - } break; - case UpdateStatus::UPDATE_AVAILABLE: { set_disabled(false); set_tooltip_text(TTR("Click to open download page.")); @@ -315,8 +297,7 @@ void EngineUpdateLabel::pressed() { emit_signal("offline_clicked"); } break; - case UpdateStatus::ERROR: - case UpdateStatus::UP_TO_DATE: { + case UpdateStatus::ERROR: { _check_update(); } break; @@ -329,10 +310,6 @@ void EngineUpdateLabel::pressed() { } } -void EngineUpdateLabel::enable_compact_mode() { - compact_mode = true; -} - EngineUpdateLabel::EngineUpdateLabel() { set_underline_mode(UNDERLINE_MODE_ON_HOVER); |