Add some Localization, Language Switcher, Window Persistence, and UI Improvements (v1.0.1.0) - #71
Add some Localization, Language Switcher, Window Persistence, and UI Improvements (v1.0.1.0)#71syahdafahreza wants to merge 15 commits into
Conversation
Add Indonesian (id_ID) localization and a selectable UI language option. Key changes: - Add src/localization_id_id.h and register Indonesian in localization arrays; expose localization_get_language_name. - Add config_language (default = auto) to config.c/.h and persist/load it from settings. - Add language combobox and related UI strings/controls in resource.h and .rc; include a UTF-8 .rc copy (res/voidImageViewer_utf8.rc). - Bump application version to 1.0.1.0 (nsis/version.nsh and resource version info) and add scratch_version.ps1 to help update versions. - Adjust some default config values (store settings in %APPDATA% by default, change navigation sort to name ascending). - Minor UI layout adjustments and new control IDs for reset window, commands, and keyboard shortcut labels. - Add auxiliary files: comments.json, issues.json, test_math.c, and update project file (vs2026/voidImageViewer.vcxproj). These changes add language support and UI elements to let users choose their preferred language and ensure the new strings/resources are included and versioned.
|
Thank you for your work on VIV syahdafahreza, There's a lot of changes here and I will need to go over them. I have already adjusted the zoom levels (0.01 - 0.2 curve) and will need more time to review. The window state was already persistent, so I will have to check your changes. I might move the options dialog size to the translation template. Thanks again for your work. |
|
Hi, Thank you for taking the time to review my PR and for the detailed feedback! I really appreciate it. Just let me know if you need to make any further adjustments or revert any specific commits. Thanks again! |
|
@syahdafahreza Quick tip: Keep a branch in your fork matching upstream main exactly. Build your PR branches on top of it, so you won’t accidentally include files like your repo README in the PR. |
Introduce a new Zoom options tab (IDD_ZOOM) with localized UI (en/ID/zh-CN). Add config entries (zoom_calc_method, zoom_step, zoom_fixed_table) with defaults and INI persistence. Implement zoom calculation methods: Relative (% multiplier), Absolute (additive %), and Fixed table (custom list) including parser and _viv_calculate_next_zoom. Preserve pixel under cursor during zoom, add custom-zoom state, toolbar updates, and related UI handling. Bump version to 1.1.0.0 and add changelog to README.
Introduce a new Compare Images side-by-side comparison window with synchronized/individual zoom & pan, per-pane mini toolbars (browse, zoom, 1:1, fit, rotate, select), and a top control bar (tips, Auto-Fit, Smooth, Filename overlay, Close). Implement full UI, painting, input handling, image loading, mipmap usage and overlays; register new menu item and default hotkey Ctrl+Alt+C. Add multilingual strings (en-US, id-ID, zh-CN), bump product/version to 1.2.0.0 in resources and installer, and update README/Changes.txt.
Increase localization_id_t to unsigned short and set LOCALIZATION_ID_INVALID to 65535 to allow larger localization ID range (src/localization.h). In src/viv.c, correct several formatting and type issues in _viv_compare_format_filesize and _viv_compare_paint: switch format specifiers and casts for filesize and bytes output, render zoom percent as integer, obtain filename_part as a const wchar_t* from string_get_filename_part, and adjust overlay string formatting. These changes address type/overflow and incorrect printf format usage.
This change makes compare mode zoom all panes around their viewport centers so the zoom behavior stays consistent across panes. It also removes the automatic initial image pairing in compare view, leaving panes empty until the user selects images manually.
Introduce a 'Use Current Image' option in the image comparison pane. Adds a new localization id and strings (en,id,zh). Adds UI state (use_current) and rect, a new compare button id, layout and hit-test handling, and painting support via _viv_compare_draw_checkbox_ex. Enforces only one pane can use the current image at a time, toggles loading/clearing the current playlist image into a pane, and updates related event handling and drawing logic.
Add WebP decoding fallback and alpha/orientation handling for the compare pane. Introduces _viv_compare_webp_ctx_t, _viv_compare_webp_info_proc and _viv_compare_webp_frame_proc to decode WebP frames, convert RGBA->BGR, composite alpha against the configured window background, create an HBITMAP and set pane properties. Update GDI+ compositing to use SourceOver when images have alpha (based on image flags) and tighten the orientation check to >1. If GDI+ image loading fails, call webp_load(stream, ...) as a fallback.
Add drag-and-drop support for the compare window and a localized placeholder string. Introduce LOCALIZATION_ID_COMPARE_NO_IMAGE_DROP and provide English/Indonesian/Chinese translations. Use the localized text when no image is present. Enable file drops via WS_EX_ACCEPTFILES/DragAcceptFiles and implement WM_DROPFILES handling to accept one or two dropped files, load them into the appropriate compare panes, manage use_current/playlist state, and call DragFinish. Minor UI wiring in _viv_compare_proc and _viv_compare_show to accept and process dropped image files.
This commit expands the Compare Images window with drag-and-drop loading, per-pane "Use Current Image" toggles, synchronized zoom/pan controls, per-pane toolbars, and improved navigation options. It also adds WebP fallback decoding and proper alpha blending for transparent PNG/ICO/GIF images, and completes English, Indonesian, and Simplified Chinese localization for the new UI.
Bump product/version to 1.2.1.0 (nsis/version.nsh, res/voidImageViewer*.rc, src/version.h). Add a new LOCALIZATION_ID_SMOOTH and translations (src/localization.h, localization_en_us.h, localization_id_id.h, localization_zh_cn.h). Introduce VIV_ID_VIEW_SMOOTH and wire it into menus and context handling (src/viv.h, src/viv.c): menu entry, context menu id, toggle command that switches shrink blit mode and magnification filter, and menu check state. This provides a user-toggleable smoothing option for image scaling.
This release adds a Smooth (Halftone/Bilinear) toggle to the main viewer's View menu and context menu, with configuration persistence and compare-mode integration. It also introduces a side-by-side Compare Images mode with synchronized or independent zoom/pan, drag-and-drop support, and per-pane 'Use Current Image' toggles.
This Pull Request introduces several features, improvements, and bug fixes to enhance the user experience and expand accessibility. I have also bumped the version to 1.0.1.0 across all components.
Key Changes:
1. Localization & Language Support
id-ID) localization support viasrc/localization_id_id.h.IDC_STATIClabels in the resource file. This enables dynamic localization of all UI elements without falling back to hardcoded English strings.2. Window Management & Persistence
3. UI/UX Refinements (Scroll Zoom & Layout)
Code Comparison (Before vs After):
A. Robust & Smooth Scroll Zoom
I refined the zoom logic to be resolution-aware, preventing jumpy zooming on small icons while maintaining speed on high-res photos.
B. Options Dialog Layout (Widened)
Increased the width of the Options dialog to prevent clipping of long localization strings (common in Indonesian and Chinese).
C. Localizable Static Labels
Assigned unique IDs to static labels that were previously hardcoded as
IDC_STATIC, allowing them to be dynamically updated viaos_SetDlgItemText_localization_id.D. Window Persistence (config.c):
Note to Maintainer:
Please review the changes carefully, particularly the resource ID changes in
voidImageViewer.rcandresource.h. I have bumped the version to 1.0.1.0 as these changes introduce new functional features and significant UI improvements. I have tested these changes on Windows 10/11 and they appear stable. However, if any part of this PR does not align with the project's vision, feel free to request changes or decline the PR. Thank you for your time and for maintaining this excellent tool!