diff --git a/lib/app/AppGLFW.cpp b/lib/app/AppGLFW.cpp index 77bc66d..67b7ca6 100644 --- a/lib/app/AppGLFW.cpp +++ b/lib/app/AppGLFW.cpp @@ -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) { diff --git a/lib/app/CMakeLists.txt b/lib/app/CMakeLists.txt index ca33070..d2140d0 100644 --- a/lib/app/CMakeLists.txt +++ b/lib/app/CMakeLists.txt @@ -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 diff --git a/lib/app/uiresources_app.h.in b/lib/app/app_resources_default.h.in similarity index 100% rename from lib/app/uiresources_app.h.in rename to lib/app/app_resources_default.h.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6e49acd..d8cfb57 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/MyApp.cpp b/src/MyApp.cpp index bee0ba1..8d1c1d2 100644 --- a/src/MyApp.cpp +++ b/src/MyApp.cpp @@ -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 diff --git a/src/MyApp.hpp b/src/MyApp.hpp index e536275..60fc038 100644 --- a/src/MyApp.hpp +++ b/src/MyApp.hpp @@ -26,11 +26,12 @@ class MyApp : public application::AppGLFW private: void LoadImageProt(); + void ImageGalleryRender(); private: resources::ImageResourcePool& pool_; std::unique_ptr image_view_model_; - bool imagep_{false}; + bool image_listp_{false}; bool demop_{false}; ImVec2 curr_dim_; }; diff --git a/src/app_resources_local.h.in b/src/app_resources_local.h.in new file mode 100644 index 0000000..1fb160c --- /dev/null +++ b/src/app_resources_local.h.in @@ -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" diff --git a/src/uiresources_local.h.in b/src/uiresources_local.h.in deleted file mode 100644 index ef78617..0000000 --- a/src/uiresources_local.h.in +++ /dev/null @@ -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"