init view abstractions

This commit is contained in:
m-aXimilian
2025-06-16 13:19:28 +02:00
committed by Kueffner, Maximilian
parent 6370bfdff6
commit 790c55c0bb
7 changed files with 72 additions and 26 deletions
+13 -5
View File
@@ -117,9 +117,19 @@ int pixelarium::ui::AppGLFW::Run()
this->MenuBar();
if (demop_) ImGui::ShowDemoWindow(&this->demop_);
if (this->image_view_)
// if (this->image_view_)
// {
// this->image_view_->ShowImage();
// }
if (ImGui::BeginListBox("ListBox"))
{
this->image_view_->ShowImage();
pool_.EnumerateResources([](size_t id, const imaging::PixelariumImage& img) -> void
{
ImGui::Selectable(std::format("Image {}", id).c_str());
});
ImGui::EndListBox();
}
// Rendering
@@ -198,8 +208,6 @@ void pixelarium::ui::AppGLFW::LoadImageProt()
{
this->logger_.Debug(std::format("{}: Creating image {}", __FUNCTION__, p));
auto img = std::make_shared<PixelariumImage>(p);
this->image_view_ = std::make_shared<PixelariumImageView>(img);
this->image_view_->ToggleView(true);
image_view_model_->AddImage(std::move(std::make_unique<PixelariumImage>(p)));
}
}