add gallery toggle

This commit is contained in:
Maximilian Kueffner
2025-08-19 00:03:06 +02:00
parent 6f83a13b63
commit 55c7fdd254
8 changed files with 26 additions and 24 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
#include "uiresources_app.h"
#include "app_resources_default.h"
static void glfw_error_callback(int error, const char* description)
{
+2 -2
View File
@@ -1,6 +1,6 @@
set(PIXELARIUM_TITLE ${CMAKE_PROJECT_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uiresources_app.h.in
${CMAKE_BINARY_DIR}/uiresources_app.h @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/app_resources_default.h.in
${CMAKE_BINARY_DIR}/app_resources_default.h @ONLY)
set(APPLIBSRC
AppGLFW.cpp
+2 -2
View File
@@ -1,4 +1,4 @@
message(STATUS "Configuring Resources")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uiresources_local.h.in
${CMAKE_BINARY_DIR}/uiresources_local.h @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/app_resources_local.h.in
${CMAKE_BINARY_DIR}/app_resources_local.h @ONLY)
+11 -8
View File
@@ -6,13 +6,17 @@
#include "imaging/PixelariumImage.hpp"
#include "imgui.h"
#include "portable-file-dialogs.h"
#include "uiresources_app.h"
#include "uiresources_local.h"
#include "app_resources_default.h"
#include "app_resources_local.h"
#include "utilities/ILog.hpp"
using namespace pixelarium::imaging;
void pixelarium::ui::MyApp::MenuBarOptionsColumn1() { ImGui::MenuItem(SHOWIMGUIDEMOS, NULL, &this->demop_); }
void pixelarium::ui::MyApp::MenuBarOptionsColumn1()
{
ImGui::MenuItem(SHOWIMGUIDEMOS, NULL, &this->demop_);
ImGui::MenuItem(SHOWIMAGEGALLERY, NULL, &this->image_listp_);
}
void pixelarium::ui::MyApp::MenuBarOptionsColumn2()
{
@@ -30,12 +34,11 @@ void pixelarium::ui::MyApp::MenuBarOptionsColumn2()
void pixelarium::ui::MyApp::Run()
{
if (demop_) ImGui::ShowDemoWindow(&this->demop_);
if (image_listp_) this->ImageGalleryRender();
}
// if (this->image_view_)
// {
// this->image_view_->ShowImage();
// }
void pixelarium::ui::MyApp::ImageGalleryRender()
{
if (ImGui::BeginListBox("ListBox"))
{
pool_.EnumerateResources([](size_t id, const imaging::PixelariumImage&) -> void
+2 -1
View File
@@ -26,11 +26,12 @@ class MyApp : public application::AppGLFW
private:
void LoadImageProt();
void ImageGalleryRender();
private:
resources::ImageResourcePool& pool_;
std::unique_ptr<ImageViewFactory> image_view_model_;
bool imagep_{false};
bool image_listp_{false};
bool demop_{false};
ImVec2 curr_dim_;
};
+8
View File
@@ -0,0 +1,8 @@
#pragma once
// Currently, there is no need for this to be a configurable header.
// It is left as such to keep the API open for possible build-system
// injections in future.
#define SHOWIMGUIDEMOS "ImGui Demos"
#define SHOWIMAGEGALLERY "Image Gallery"
-10
View File
@@ -1,10 +0,0 @@
#pragma once
/*-- Gets filled in during the cmake configuration step --*/
// #cmakedefine PIXELARIUM_TITLE "@PIXELARIUM_TITLE@"
// #define MAINMENUNAME "Menu"
// #define FILEMENUNAME "File"
// #define LOGLEVELSELECT "Log Level"
#define SHOWIMGUIDEMOS "ImGui Demos"