diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-14 21:07:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 21:07:22 +0200 |
commit | c9e3fe73ff530e2f56d8ff6d93be298ae1ceb6af (patch) | |
tree | 897a15ff28e93adb4bb3c133ff03743c2f895140 /editor | |
parent | ab58d94deab2cb441e10d62f00346604371d66ef (diff) | |
parent | 54c9a481a0c651e36a5ddf4a099510627d1483a8 (diff) |
Merge pull request #62009 from KoBeWi/rings_a_bell
Improve toaster buttons
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_toaster.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/editor_toaster.cpp b/editor/editor_toaster.cpp index 7ca88bd2a2..4986bccc35 100644 --- a/editor/editor_toaster.cpp +++ b/editor/editor_toaster.cpp @@ -234,6 +234,16 @@ void EditorToaster::_auto_hide_or_free_toasts() { to_delete[i]->queue_delete(); toasts.erase(to_delete[i]); } + + if (toasts.is_empty()) { + main_button->set_tooltip(TTR("No notifications.")); + main_button->set_modulate(Color(0.5, 0.5, 0.5)); + main_button->set_disabled(true); + } else { + main_button->set_tooltip(TTR("Show notifications.")); + main_button->set_modulate(Color(1, 1, 1)); + main_button->set_disabled(false); + } } void EditorToaster::_draw_button() { @@ -508,6 +518,9 @@ EditorToaster::EditorToaster() { // Main button. main_button = memnew(Button); + main_button->set_tooltip(TTR("No notifications.")); + main_button->set_modulate(Color(0.5, 0.5, 0.5)); + main_button->set_disabled(true); main_button->set_flat(true); main_button->connect("pressed", callable_mp(this, &EditorToaster::_set_notifications_enabled), varray(true)); main_button->connect("pressed", callable_mp(this, &EditorToaster::_repop_old)); @@ -521,6 +534,7 @@ EditorToaster::EditorToaster() { add_child(disable_notifications_panel); disable_notifications_button = memnew(Button); + disable_notifications_button->set_tooltip(TTR("Silence the notifications.")); disable_notifications_button->set_flat(true); disable_notifications_button->connect("pressed", callable_mp(this, &EditorToaster::_set_notifications_enabled), varray(false)); disable_notifications_panel->add_child(disable_notifications_button); |