Revamp toolbar UI, improve UTF-16 handling, and update installer#14
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
DisplayModelto 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:
DisplayModelrendering logic to schedule visible part rendering on the UI thread using the newScheduleRenderVisiblePartsmethod, replacing direct calls toRenderVisiblePartsin several methods (SetViewPortSize,GoToPage,ScrollYTo,ScrollYBy). This helps prevent redundant rendering and improves UI responsiveness. [1] [2] [3] [4] [5]PrecacheLargeDocumentPagesmethod toDisplayModelto pre-render pages around the current page for large documents, improving perceived performance when navigating. [1] [2]Web UI Enhancements and Cleanups:
hybridToolbarBatchUpdatefunction 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.ts(timestamp) field from all command payloads sent viawindow.external.invoke, simplifying the communication protocol between the web UI and the host application. [1] [2] [3] [4] [5] [6] [7] [8]Installer and Documentation Updates:
1.0.0to1.0.1inPrettySumatraPDF.issto reflect recent changes.