add gallery toggle
This commit is contained in:
+1
-1
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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_;
|
||||
};
|
||||
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user