Skip to content

Commit 6235eae

Browse files
committed
Add Image List UI and Preferences window
Add a new Image List UI (imiv_image_list_ui.*) and a dedicated Preferences window (imiv_preferences_window.cpp), and wire them into the build (imiv_sources.cmake). Replace the previous image_window_title function with an inline constexpr k_image_window_title and update call sites. Move large preference-related UI code out of imiv_aux_windows.cpp into the new preferences file and clean up related helper functions. Update persistence paths to use string literals for legacy filenames, and adjust includes across several modules (developer tools, frame, etc.) to reference the new headers. Also include minor adjustments to test-engine hooks to use the new image title constant and other housekeeping to integrate the new UI components. Signed-off-by: Vlad <shaamaan@gmail.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
1 parent 27e95f6 commit 6235eae

27 files changed

+2099
-1987
lines changed

src/imiv/cmake/imiv_sources.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set (_imiv_shared_sources
1212
imiv_file_actions.cpp
1313
imiv_file_dialog.cpp
1414
imiv_frame.cpp
15+
imiv_image_list_ui.cpp
1516
imiv_image_save.cpp
1617
imiv_image_library.cpp
1718
imiv_image_view.cpp
@@ -22,6 +23,8 @@ set (_imiv_shared_sources
2223
imiv_parse.cpp
2324
imiv_persistence.cpp
2425
imiv_overlays.cpp
26+
imiv_preferences_window.cpp
27+
imiv_probe_data.cpp
2528
imiv_probe_overlay.cpp
2629
imiv_preview_shader_text.cpp
2730
imiv_renderer.cpp

src/imiv/imiv_app.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,6 @@ namespace {
194194
return sanitize_backend_kind(ui_state.renderer_backend);
195195
}
196196

197-
std::string build_main_window_title(BackendKind active_backend)
198-
{
199-
return Strutil::fmt::format("ImIv v.{} [{}]", OIIO_VERSION_STRING,
200-
backend_cli_name(active_backend));
201-
}
202-
203197
void apply_glfw_topmost_state_to_platform_windows(GLFWwindow* main_window,
204198
bool always_on_top)
205199
{
@@ -403,7 +397,9 @@ run(const AppConfig& config)
403397
}
404398
}
405399

406-
const std::string window_title = build_main_window_title(active_backend);
400+
const std::string window_title
401+
= Strutil::fmt::format("ImIv v.{} [{}]", OIIO_VERSION_STRING,
402+
backend_cli_name(active_backend));
407403
GLFWwindow* window
408404
= platform_glfw_create_main_window(active_backend, 1600, 900,
409405
window_title.c_str(), startup_error);
@@ -686,7 +682,7 @@ run(const AppConfig& config)
686682
ViewerStateJsonWriteContext test_engine_state_ctx
687683
= { &viewer, &workspace, &ui_state, active_backend };
688684
TestEngineHooks test_engine_hooks;
689-
test_engine_hooks.image_window_title = image_window_title();
685+
test_engine_hooks.image_window_title = k_image_window_title;
690686
test_engine_hooks.screen_capture = renderer_screen_capture;
691687
test_engine_hooks.screen_capture_user_data = &renderer_state;
692688
test_engine_hooks.write_viewer_state_json

src/imiv/imiv_aux_windows.cpp

Lines changed: 0 additions & 434 deletions
Large diffs are not rendered by default.

src/imiv/imiv_developer_tools.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#include "imiv_developer_tools.h"
66

77
#include "imiv_file_actions.h"
8+
#include "imiv_image_list_ui.h"
89
#include "imiv_ocio.h"
910
#include "imiv_parse.h"
1011
#include "imiv_workspace.h"
11-
#include "imiv_workspace_ui.h"
1212

1313
#include <cstdio>
1414
#include <fstream>

src/imiv/imiv_frame.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "imiv_developer_tools.h"
1010
#include "imiv_drag_drop.h"
1111
#include "imiv_frame_actions.h"
12+
#include "imiv_image_list_ui.h"
1213
#include "imiv_image_view.h"
1314
#include "imiv_menu.h"
1415
#include "imiv_parse.h"
@@ -65,7 +66,7 @@ namespace {
6566
bool primary)
6667
{
6768
if (primary)
68-
return std::string(image_window_title());
69+
return std::string(k_image_window_title);
6970
return Strutil::fmt::format("Image {}###imiv_image_view_{}", view.id,
7071
view.id);
7172
}

src/imiv/imiv_frame.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ namespace Imiv {
1616

1717
struct DeveloperUiState;
1818

19-
const char*
20-
image_window_title();
19+
inline constexpr const char* k_image_window_title = "Image";
2120

2221
void
2322
draw_viewer_ui(MultiViewWorkspace& workspace, ImageLibraryState& library,

0 commit comments

Comments
 (0)