64 ImGuiIO& io = ImGui::GetIO();
68 ImVec2 pos(io.DisplaySize.x - 16.f, 48.f);
86 text_color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
91 text_color = ImVec4(0.0f, 0.0f, 0.0f, 1.0f);
96 text_color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
100 ImGui::SetNextWindowBgAlpha(bg.w);
101 ImGui::SetNextWindowPos(pos, ImGuiCond_Always, ImVec2(1.f, 0.f));
102 ImGuiWindowFlags flags =
103 ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize |
104 ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoNav |
105 ImGuiWindowFlags_NoFocusOnAppearing;
107 ImGui::PushStyleColor(ImGuiCol_WindowBg, bg);
108 ImGui::PushStyleColor(ImGuiCol_Text, text_color);
109 ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 6.0f);
110 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(12.0f, 8.0f));
113 char window_name[32];
114 snprintf(window_name,
sizeof(window_name),
"##toast_%p", (
void*)&t);
116 if (ImGui::Begin(window_name,
nullptr, flags)) {
117 ImGui::TextUnformatted(t.
message.c_str());
121 ImGui::PopStyleVar(2);
122 ImGui::PopStyleColor(2);
130 pos.y += ImGui::GetItemRectSize().y + 8.f;