diff --git a/dep/imgui/include/IconsEmoji.h b/dep/imgui/include/IconsEmoji.h index f0061a5f7..23c7bb6fb 100644 --- a/dep/imgui/include/IconsEmoji.h +++ b/dep/imgui/include/IconsEmoji.h @@ -8,6 +8,7 @@ #define ICON_EMOJI_WARNING "\xe2\x9a\xa0" #define ICON_EMOJI_CHECKMARK_BUTTON "\xe2\x9c\x85" +#define ICON_EMOJI_CROSS_MARK_BUTTON "\xe2\x9d\x8c" #define ICON_EMOJI_OPTICAL_DISK "\xf0\x9f\x92\xbf" #define ICON_EMOJI_FLOPPY_DISK "\xf0\x9f\x92\xbe" #define ICON_EMOJI_INFORMATION "\xe2\x84\xb9" @@ -44,3 +45,5 @@ #define ICON_EMOJI_INDEX_DIVIDERS "\xf0\x9f\x97\x82" #define ICON_EMOJI_CLIPBOARD "\xf0\x9f\x93\x8b" #define ICON_EMOJI_NOTEBOOK "\xf0\x9f\x93\x99" +#define ICON_EMOJI_GEAR "\xe2\x9a\x99" +#define ICON_EMOJI_NO_ENTRY_SIGN "\xe2\x9b\x94" diff --git a/src/util/imgui_manager.cpp b/src/util/imgui_manager.cpp index 99450b214..c169d83bd 100644 --- a/src/util/imgui_manager.cpp +++ b/src/util/imgui_manager.cpp @@ -26,6 +26,7 @@ #include "common/thirdparty/usb_key_code_data.h" #include "common/timer.h" +#include "IconsEmoji.h" #include "IconsFontAwesome.h" #include "fmt/format.h" #include "imgui.h" @@ -847,6 +848,15 @@ void ImGuiManager::AddOSDMessage(OSDMessageType type, std::string key, std::stri else INFO_LOG("OSD: {}{}{}", title.empty() ? "" : "\n", title, message); + static constexpr const std::array(OSDMessageType::MaxCount)> default_icons = { + ICON_EMOJI_NO_ENTRY_SIGN, // Error + ICON_EMOJI_WARNING, // Warning + ICON_EMOJI_INFORMATION, // Info + ICON_EMOJI_INFORMATION, // Quick + }; + if (icon.empty()) + icon = default_icons[static_cast(type)]; + std::unique_lock lock(s_state.osd_messages_lock); s_state.osd_posted_messages.push_back(PostedOSDMessage{ .key = std::move(key),