INNER CODE UNIT · C++
notif
oxylusengine/Oxylus · OxylusEditor/src/Editor.cpp:707
auto& notif = *last_notification;
std::string icon_text = {};
switch (notif.type) {
case Notification::Info : icon_text = ICON_MDI_INFORMATION; break;
case Notification::Warn : icon_text = ICON_MDI_ALERT; break;
case Notification::Error : icon_text = ICON_MDI_EXCLAMATION; break;
case Notification::Loading: icon_text = ICON_MDI_CHECK_BOLD; break;
}
auto notif_text = fmt::format("{} {}", icon_text, notif.title);
const float text_width = ImGui::CalcTextSize(notif_text.c_str()).x;
ImGui::SameLine(ImGui::GetWindowWidth() - text_width - UI::scale(16.0f));
ImGui::TextUnformatted(notif_text.c_str());
if (ImGui::IsItemClicked()) {
activity_log_panel_state = !activity_log_panel_state;
}
}
}