You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Back-ends: Filament
Operating System: web, cross-compiled to WASM
My Issue/Question:
I'm making a console log, and would like the background of each log to be color-coded depending on their type. I have a for loop going through all of the logs and making a Selectable for each log. However it only colors the first log in the loop. I've tried putting each selectable in their own window, and calling PushStyleColor before the window and PopStyleColor after the window end (as well as trying to call it inside the window). However, nothing seems to work. Any ideas how this works? Thanks!
Screenshots/Video
Example Code:
ImGui::ListBoxHeader(
"", (filter_log_) ? log_settings_[filter_by_].count : all_logs_.size());
for (int i = 0; i < all_logs_.size(); ++i) {
if (filter_log_ && all_logs_.at(i).output_kind != filter_by_) {
continue;
}
ImGui::Image(
log_settings_[all_logs_.at(i).output_kind].icon->GetTexture(),
kLogImageSize);
ImGui::SameLine();
ImGui::PushStyleColor(
ImGuiCol_Header,
log_settings_[all_logs_.at(i).output_kind].background_color);
ImGui::Selectable(all_logs_[i].message.c_str(),
(i == selected_item_index_));
ImGui::PopStyleColor();
}
ImGui::ListBoxFooter();
The text was updated successfully, but these errors were encountered:
Version/Branch of Dear ImGui:
Version: v1.75 WIP
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: Filament
Operating System: web, cross-compiled to WASM
My Issue/Question:
I'm making a console log, and would like the background of each log to be color-coded depending on their type. I have a for loop going through all of the logs and making a Selectable for each log. However it only colors the first log in the loop. I've tried putting each selectable in their own window, and calling PushStyleColor before the window and PopStyleColor after the window end (as well as trying to call it inside the window). However, nothing seems to work. Any ideas how this works? Thanks!
Screenshots/Video
Example Code:
The text was updated successfully, but these errors were encountered: