ui: Add toggle to hide notifications

This commit is contained in:
Matt Borgerson 2023-07-27 19:23:08 -07:00 committed by mborgerson
parent 15bf68594f
commit 5055cc6401
3 changed files with 9 additions and 0 deletions

View file

@ -133,6 +133,9 @@ display:
show_menubar:
type: bool
default: true
show_notifications:
type: bool
default: true
use_animations:
type: bool
default: true

View file

@ -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) {

View file

@ -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();