Skip to content

Revamp toolbar UI, improve UTF-16 handling, and update installer#14

Merged
JaviLendi merged 4 commits into
masterfrom
Improvements
May 30, 2026
Merged

Revamp toolbar UI, improve UTF-16 handling, and update installer#14
JaviLendi merged 4 commits into
masterfrom
Improvements

Conversation

@JaviLendi
Copy link
Copy Markdown
Owner

This pull request introduces several improvements and refactorings to the toolbar web UI and the core document rendering logic, as well as a minor installer version update. The most significant changes are the refactoring of rendering scheduling in DisplayModel to improve UI responsiveness and maintainability, and the addition of a batch update function for the toolbar state in the web UI. Additionally, the codebase has been cleaned up by removing unnecessary timestamp fields in command payloads, and the installer version has been incremented.

Rendering and UI Responsiveness Improvements:

  • Refactored DisplayModel rendering logic to schedule visible part rendering on the UI thread using the new ScheduleRenderVisibleParts method, replacing direct calls to RenderVisibleParts in several methods (SetViewPortSize, GoToPage, ScrollYTo, ScrollYBy). This helps prevent redundant rendering and improves UI responsiveness. [1] [2] [3] [4] [5]
  • Added PrecacheLargeDocumentPages method to DisplayModel to pre-render pages around the current page for large documents, improving perceived performance when navigating. [1] [2]

Web UI Enhancements and Cleanups:

  • Added hybridToolbarBatchUpdate function to the toolbar web UI, allowing multiple toolbar state properties (page, zoom, annotation availability) to be updated in a single call for efficiency and easier integration.
  • Removed the ts (timestamp) field from all command payloads sent via window.external.invoke, simplifying the communication protocol between the web UI and the host application. [1] [2] [3] [4] [5] [6] [7] [8]
  • Removed unused or redundant JavaScript code sections related to UI overrides and adaptive compactness in the toolbar HTML for maintainability.

Installer and Documentation Updates:

  • Bumped the installer version from 1.0.0 to 1.0.1 in PrettySumatraPDF.iss to reflect recent changes.
  • Updated the Inno Setup path in the installer README to use a generic username, improving documentation clarity.

JaviLendi added 4 commits May 26, 2026 15:35
Overhauled the prettysumatra web toolbar (prettysumatra/webui/toolbar.html): replaced large parts of the markup/CSS/JS to provide a modern theme switch, improved search keyboard handling (Ctrl+F / F3), responsive/compact layouts and updated dropdown/color-palette behavior. Adjusted native app code to match the UI changes: updated DisplayModel, RenderCache, MainWindow, SumatraPDF, Theme, and BridgeDispatcher to integrate theme/state changes, refine rendering cache behavior and bridge/IPC handling between the UI and the application. These changes align UI interactions with the app renderer and theme logic, improving responsiveness and UX.
Handle UTF-16 BE BOM case more safely: clarify comment, treat CastToWCHAR result as const, check DupTemp result and return nullptr on allocation failure, and perform byte-swapping on unsigned bytes via reinterpret_cast to avoid unsafe char casts. Also return the duplicated WCHAR buffer directly to ToUtf8Temp.
Include SettingsUseTabs() in the reuse-instance check so new file opens are routed to the existing process when tabbed mode is active. Adds a clarifying comment and uses existingInstanceHwnd for the existing window handle so new files open in a new tab instead of spawning a separate process.
Update Inno Setup script AppVersion to 1.0.1, adjust README installer command path (replace user-specific account path), and add the compiled installer binary scripts/installer/dist/PrettySumatraPDF-Setup-1.0.1.exe to the repository.
@JaviLendi JaviLendi merged commit f2e3647 into master May 30, 2026
4 checks passed
@JaviLendi JaviLendi deleted the Improvements branch May 30, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant