From 5055cc64014a16fc9fce0859abe8e63ed380f39e Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Thu, 27 Jul 2023 19:23:08 -0700 Subject: [PATCH] ui: Add toggle to hide notifications --- config_spec.yml | 3 +++ ui/xui/main-menu.cc | 2 ++ ui/xui/notifications.cc | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/config_spec.yml b/config_spec.yml index 8410264e61..5d894a6f86 100644 --- a/config_spec.yml +++ b/config_spec.yml @@ -133,6 +133,9 @@ display: show_menubar: type: bool default: true + show_notifications: + type: bool + default: true use_animations: type: bool default: true diff --git a/ui/xui/main-menu.cc b/ui/xui/main-menu.cc index 34e6904860..50db1aae43 100644 --- a/ui/xui/main-menu.cc +++ b/ui/xui/main-menu.cc @@ -314,6 +314,8 @@ void MainMenuDisplayView::Draw() SectionTitle("Interface"); Toggle("Show main menu bar", &g_config.display.ui.show_menubar, "Show main menu bar when mouse is activated"); + Toggle("Show notifications", &g_config.display.ui.show_notifications, + "Display notifications in upper-right corner"); int ui_scale_idx; if (g_config.display.ui.auto_scale) { diff --git a/ui/xui/notifications.cc b/ui/xui/notifications.cc index 42fbbf9657..f4c5179e23 100644 --- a/ui/xui/notifications.cc +++ b/ui/xui/notifications.cc @@ -89,6 +89,10 @@ void NotificationManager::Draw() void NotificationManager::DrawNotification(float t, const char *msg) { + if (!g_config.display.ui.show_notifications) { + return; + } + const float DISTANCE = 10.0f; static int corner = 1; ImGuiIO& io = ImGui::GetIO();