diff --git a/docs/md/Corrupted-installation.md b/docs/md/Corrupted-installation.md index 596acfd4210a..b52891f34521 100644 --- a/docs/md/Corrupted-installation.md +++ b/docs/md/Corrupted-installation.md @@ -1,10 +1,10 @@ # Corrupted installation -If you're reading this, you might have been told by SumatraPDF that you have a corrupted installation. +If you're reading this, you might have been told by PrettySumatraPDF that you have a corrupted installation. **How can that happen?** -SumatraPDF comes in two flavors: a portable version and an installer. +PrettySumatraPDF comes in two flavors: a portable version and an installer. A portable version is a self-contained executable and cannot be corrupted. @@ -13,11 +13,11 @@ An installer needs to be run to be properly installed. Part of it is extracting There are 2 possible problems: - `libmupdf.dll` is missing -- `libmupdf.dll` is there but its version doesn't match the version of `SumatraPDF.exe` +-- `libmupdf.dll` is there but its version doesn't match the version of `PrettySumatraPDF.exe` **How to solve the problem?** -If you want to place SumatraPDF in any location, under any name, use the self-contained portable flavor. +If you want to place PrettySumatraPDF in any location, under any name, use the self-contained portable flavor. If you insist on using the installable version, just install it. The installer will run if it has `-install` in the name of the `.exe` (which it will if you download [official build](https://www.sumatrapdfreader.org/download-free-pdf-viewer)). diff --git a/docs/md/DDE-Commands.md b/docs/md/DDE-Commands.md index 3d43c51e1495..5d919a10ed55 100644 --- a/docs/md/DDE-Commands.md +++ b/docs/md/DDE-Commands.md @@ -14,7 +14,7 @@ Multiple DDE commands: `[Command1(parameter1, parameter2, ..., )][Command2(...)] You can either use windows api by sending DDE commands to server `SUMATRA` and topic `control`. See [this code](https://github.com/sumatrapdfreader/sumatrapdf/blob/master/src/utils/WinUtil.cpp#L2437) for example of sending DDE command. -Or you can use `-dde` command-line argument to `SumatraPDF.exe` e.g. `SumatraPDF.exe -dde "[SetView(\"c:\\file.pdf\",\"continuous\",-3)]"`. +Or you can use `-dde` command-line argument to `PrettySumatraPDF.exe` e.g. `PrettySumatraPDF.exe -dde "[SetView(\"c:\\file.pdf\",\"continuous\",-3)]"`. Notice escaping of DDE command string: `"` and `\` with `\`. diff --git a/docs/md/Debugging-Sumatra.md b/docs/md/Debugging-Sumatra.md index 66dae3bb0d3b..efde79baf423 100644 --- a/docs/md/Debugging-Sumatra.md +++ b/docs/md/Debugging-Sumatra.md @@ -1,8 +1,8 @@ -# Debugging Sumatra +# Debugging PrettySumatraPDF **Help us debug Sumatra hangs or crashes** -If Sumatra crashes or hangs reliably on your machine but we can't reproduce it ourselves, you can help us by debugging it. Here's a tutorial on how to do it. +If PrettySumatraPDF crashes or hangs reliably on your machine but we can't reproduce it ourselves, you can help us by debugging it. Here's a tutorial on how to do it. Please first test with latest pre-release version from [https://www.sumatrapdfreader.org/prerelease.html](https://www.sumatrapdfreader.org/prerelease.html) @@ -21,7 +21,7 @@ This saves logs to a file and opens default editor for `.txt` files with log fil ## Install necessary software - Install WinDBG debugger from Microsoft Store at [https://www.microsoft.com/en-us/p/windbg-preview/9pgjgd53tn86#activetab=pivot:overviewtab](https://www.microsoft.com/en-us/p/windbg-preview/9pgjgd53tn86#activetab=pivot:overviewtab). Alternatively, you can follow instructions from [https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools) -- In SumatraPDF, use menu `Debug` / `Download symbols`. Symbols are important for the debugger (like WinDBG) to resolve addresses to names that +- In PrettySumatraPDF, use menu `Debug` / `Download symbols`. Symbols are important for the debugger (like WinDBG) to resolve addresses to names that First, vocabulary. `%ProgramFiles%` means the standard directory where Windows installs programs. It's `c:\Program Files` on 32-bit Windows and `c:\Program Files (x86)` on 64-bit Windows. @@ -29,9 +29,9 @@ First, vocabulary. `%ProgramFiles%` means the standard directory where Windows To debug crashes: -- start SumatraPDF.exe under the control of WinDBG +- start PrettySumatraPDF.exe under the control of WinDBG - start WinDBG.exe - - File/Open (Ctrl-E), find and open SumatraPDF.exe executable + - File/Open (Ctrl-E), find and open PrettySumatraPDF.exe executable - In WinDBG, type: - `.sympath+ SRV*c:\symbols*https://msdl.microsoft.com/download/symbols` - `g` @@ -41,9 +41,9 @@ To debug crashes: Here are the steps to follow if Sumatra hangs -1. Start SumatraPDF.exe and get it to hang +1. Start PrettySumatraPDF.exe and get it to hang 2. start WinDBG.exe -3. use File/Attach to process (F6) and select SumatraPDF.exe from the +3. use File/Attach to process (F6) and select PrettySumatraPDF.exe from the 4. In WinDBG, type: - `.sympath+ SRV*c:\symbols*https://msdl.microsoft.com/download/symbols` - `~*kb` diff --git a/docs/md/Failed-to-load-libmupdf.md b/docs/md/Failed-to-load-libmupdf.md index ca4b4196ecaf..0ec1cf81fd71 100644 --- a/docs/md/Failed-to-load-libmupdf.md +++ b/docs/md/Failed-to-load-libmupdf.md @@ -1,7 +1,7 @@ # Failed to load libmupdf.dll -When installed, SumatraPDF consists of 2 files: -* `SumatraPDF.exe` +When installed, PrettySumatraPDF consists of 2 files: +* `PrettySumatraPDF.exe` * `libmupdf.dll` You're reading this page because loading of `libmupdf.dll` failed and we can't proceed. diff --git a/docs/md/LaTeX-integration.md b/docs/md/LaTeX-integration.md index 43bbae522923..9b81663c5aae 100644 --- a/docs/md/LaTeX-integration.md +++ b/docs/md/LaTeX-integration.md @@ -1,13 +1,13 @@ # LaTeX integration -You can use [DDE commands](DDE-Commands.md) from TeX and LaTeX editors to use Sumatra as a previewer. +You can use [DDE commands](DDE-Commands.md) from TeX and LaTeX editors to use PrettySumatraPDF as a previewer. ## notepad++ Launch SumatraPDF from notepad++ enabling forward and backward search: ``` -"C:\Program files\SumatraPDF\SumatraPDF.exe" -forward-search "$(FULL_CURRENT_PATH)" $(CURRENT_LINE) -inverse-search "\"C:/Program Files/Notepad++/notepad++.exe\" \"%f\" -n%l" "$(CURRENT_DIRECTORY)"/"$(NAME_PART)".pdf +"C:\Program files\PrettySumatraPDF\PrettySumatraPDF.exe" -forward-search "$(FULL_CURRENT_PATH)" $(CURRENT_LINE) -inverse-search "\"C:/Program Files/Notepad++/notepad++.exe\" \"%f\" -n%l" "$(CURRENT_DIRECTORY)"/"$(NAME_PART)".pdf ``` ## TexStudio @@ -15,7 +15,7 @@ Launch SumatraPDF from notepad++ enabling forward and backward search: Launch SumatraPDF from TeXStudio enabling forward and backward search: ``` -"C:/Program Files/SumatraPDF/SumatraPDF.exe" -forward-search "?c:am.tex" @ -inverse-search "\"C:/Program Files (x86)/TeXstudio/texstudio.exe\" \"%%f\" -line %%l" "?am.pdf" +"C:/Program Files/PrettySumatraPDF/PrettySumatraPDF.exe" -forward-search "?c:am.tex" @ -inverse-search "\"C:/Program Files (x86)/TeXstudio/texstudio.exe\" \"%%f\" -line %%l" "?am.pdf" ``` ## TeXnicCenter @@ -29,7 +29,7 @@ Configure viewer in [output profiles](https://texniccenter.sourceforge.net/confi - press `Alt + F7` (`Build` > `Define Output Profiles`) - for any one of the PDF Profiles e.g. `LaTeX` > `PDF` - for Executable path it should have something like: - - `C:\Program Files\SumatraPDF\SumatraPDF.exe -inverse-search "\"C:\Program Files (x86)\TeXnicCenter\TeXnicCenter.exe\" /ddecmd \"[goto('%f','%l')]\""` + - `C:\Program Files\PrettySumatraPDF\PrettySumatraPDF.exe -inverse-search "\"C:\Program Files (x86)\TeXnicCenter\TeXnicCenter.exe\" /ddecmd \"[goto('%f','%l')]\""` - `SumatraPDF.exe` path might be different on your computer - go back to the editor and using any simple .TeX press `Ctrl + Shift + F5` (Build and view) - SumatraPDF should have fired up with the compiled PDF @@ -76,12 +76,12 @@ language): ``` def ForwardSearch() var filename_root = expand('%:p:r') - system($'SumatraPDF.exe -forward-search {filename_root}.tex {line(".")} {filename_root}.pdf') + system($'PrettySumatraPDF.exe -forward-search {filename_root}.tex {line(".")} {filename_root}.pdf') enddef ``` Replace `SumatraPDF.exe` with the correct executable filename, -e.g. `SumatraPDFv3-4-5.exe`. +e.g. `PrettySumatraPDF.exe`. Next, you should map this function to some key, for example you could use the following. @@ -104,7 +104,7 @@ def g:BackwardSearch(line: number, filename: string) enddef ``` -Next, open `SumatraPDF` and go to _Settings/Options_. Replace the line in the +Next, open `PrettySumatraPDF` and go to _Settings/Options_. Replace the line in the _Set inverse-search command-line_ box, with the following: ``` diff --git a/docs/md/Uninstalling-SumatraPDF.md b/docs/md/Uninstalling-SumatraPDF.md index 5b20e65d3b04..de6590010269 100644 --- a/docs/md/Uninstalling-SumatraPDF.md +++ b/docs/md/Uninstalling-SumatraPDF.md @@ -1,4 +1,4 @@ -# Uninstalling SumatraPDF +# Uninstalling PrettySumatraPDF ## Are you using official Sumatra build? @@ -6,23 +6,23 @@ Did you download Sumatra from [official Sumatra website](https://www.sumatrapdfr If not, we can't help you because we didn't create the software you're using. -## Uninstalling Sumatra +## Uninstalling PrettySumatraPDF -There are 2 versions of Sumatra: an installer and a portable version (zipped executable). +There are 2 versions of the program: an installer and a portable version (zipped executable). ## Uninstalling portable version -If you're using zipped executable, the only thing you need to do is to delete SumatraPDF.exe. +If you're using zipped executable, the only thing you need to do is to delete PrettySumatraPDF.exe. ## Uninstalling the installer version -If you installed SumatraPDF by running official installer, you uninstall it like every other application. +If you installed PrettySumatraPDF by running an installer, you uninstall it like every other application. On Windows 10 / 11: - start Settings app ([https://www.digitalcitizen.life/introducing-windows-10-ways-open-settings](https://www.digitalcitizen.life/introducing-windows-10-ways-open-settings)) - Select `Apps` -- find `SumatraPDF` on the list, click it and press `Uninstall` button: +- find `PrettySumatraPDF` on the list, click it and press `Uninstall` button: ![Uninstall](img/uninstall.png) diff --git a/RELEASE_DRAFT.md b/docs/releases/RELEASE_DRAFT.md similarity index 67% rename from RELEASE_DRAFT.md rename to docs/releases/RELEASE_DRAFT.md index 5c7b42e4eb8f..8af66ea3f4e3 100644 --- a/RELEASE_DRAFT.md +++ b/docs/releases/RELEASE_DRAFT.md @@ -1,29 +1,29 @@ -# PrettySumatraPDF v1.0.0 — Release Draft - -Release date: 2026-05-09 - -## Summary - -PrettySumatraPDF v1.0.0 is the first official release of the PrettySumatra redesign. It preserves the full functionality of the original SumatraPDF reader while introducing a modern native UI and optional hybrid WebView2 components. - -## Highlights - -- Modern native Win32 toolbar and visual refresh -- All original formats supported (PDF, EPUB, MOBI, CBZ, CBR, FB2, CHM, XPS, DjVu) -- Preserved command behavior, shortcuts, and features -- Improved toolbar density and Windows 11–inspired visuals -- Hybrid WebView2 integration for advanced UI components - -## Download - -(Attach installer and archive artifacts here.) - -## Notes - -See `RELEASE_NOTES_v1.0.0.md` for full details. - ---- - -### How to produce the installer (developer) - -See `scripts/installer/README_INSTALLER.md` for build instructions. +# PrettySumatraPDF v1.0.1 — Release Draft + +Release date: 2026-05-30 + +## Summary + +PrettySumatraPDF v1.0.1 is the first official release of the PrettySumatra redesign. It preserves the full functionality of the original SumatraPDF reader while introducing a modern native UI and optional hybrid WebView2 components. + +## Highlights + +- Modern native Win32 toolbar and visual refresh +- All original formats supported (PDF, EPUB, MOBI, CBZ, CBR, FB2, CHM, XPS, DjVu) +- Preserved command behavior, shortcuts, and features +- Improved toolbar density and Windows 11–inspired visuals +- Hybrid WebView2 integration for advanced UI components + +## Download + +(Attach installer and archive artifacts here.) + +## Notes + +See [RELEASE_NOTES_v1.0.1.md](RELEASE_NOTES_v1.0.1.md) for full details. + +--- + +### How to produce the installer (developer) + +See [../installer/README_INSTALLER.md](../installer/README_INSTALLER.md) for build instructions. \ No newline at end of file diff --git a/RELEASE_NOTES_v1.0.0.md b/docs/releases/RELEASE_NOTES_v1.0.0.md similarity index 67% rename from RELEASE_NOTES_v1.0.0.md rename to docs/releases/RELEASE_NOTES_v1.0.0.md index 1bb13aca2257..0ff6aa9db01c 100644 --- a/RELEASE_NOTES_v1.0.0.md +++ b/docs/releases/RELEASE_NOTES_v1.0.0.md @@ -1,22 +1,22 @@ -# PrettySumatraPDF — v1.0.0 (First Release) - -Release date: 2026-05-09 - -## Overview - -PrettySumatraPDF is the first release of the PrettySumatra redesign. It preserves the full functionality of the original SumatraPDF reader while providing a modernized native UI and optional hybrid WebView2 features. - -## Highlights - -- Modern native Win32 toolbar and visual refresh -- All original formats supported (PDF, EPUB, MOBI, CBZ, CBR, FB2, CHM, XPS, DjVu) -- Preserved command behavior, shortcuts, and features -- Improved toolbar density and Windows 11–inspired visuals -- Hybrid WebView2 integration for advanced UI components - -## Screenshots - -- Toolbar: `docs/md/img/toolbar.png` -- Command palette: `docs/md/img/command-palette-tabs.png` -- Annotation editor: `docs/md/img/annotation-editor.png` -- Settings: `docs/md/img/settings-app.png` +# PrettySumatraPDF — v1.0.0 (First Release) + +Release date: 2026-05-09 + +## Overview + +PrettySumatraPDF is the first release of the PrettySumatra redesign. It preserves the full functionality of the original SumatraPDF reader while providing a modernized native UI and optional hybrid WebView2 features. + +## Highlights + +- Modern native Win32 toolbar and visual refresh +- All original formats supported (PDF, EPUB, MOBI, CBZ, CBR, FB2, CHM, XPS, DjVu) +- Preserved command behavior, shortcuts, and features +- Improved toolbar density and Windows 11–inspired visuals +- Hybrid WebView2 integration for advanced UI components + +## Screenshots + +- Toolbar: [../md/img/toolbar.png](../md/img/toolbar.png) +- Command palette: [../md/img/command-palette-tabs.png](../md/img/command-palette-tabs.png) +- Annotation editor: [../md/img/annotation-editor.png](../md/img/annotation-editor.png) +- Settings: [../md/img/settings-app.png](../md/img/settings-app.png) \ No newline at end of file diff --git a/docs/releases/RELEASE_NOTES_v1.0.1.md b/docs/releases/RELEASE_NOTES_v1.0.1.md new file mode 100644 index 000000000000..30efd09c27c9 --- /dev/null +++ b/docs/releases/RELEASE_NOTES_v1.0.1.md @@ -0,0 +1,22 @@ +# PrettySumatraPDF — v1.0.1 (First Release) + +Release date: 2026-05-30 + +## Overview + +PrettySumatraPDF is the first release of the PrettySumatra redesign. It preserves the full functionality of the original SumatraPDF reader while providing a modernized native UI and optional hybrid WebView2 features. + +## Highlights + +- Modern native Win32 toolbar and visual refresh +- All original formats supported (PDF, EPUB, MOBI, CBZ, CBR, FB2, CHM, XPS, DjVu) +- Preserved command behavior, shortcuts, and features +- Improved toolbar density and Windows 11–inspired visuals +- Hybrid WebView2 integration for advanced UI components + +## Screenshots + +- Toolbar: [../md/img/toolbar.png](../md/img/toolbar.png) +- Command palette: [../md/img/command-palette-tabs.png](../md/img/command-palette-tabs.png) +- Annotation editor: [../md/img/annotation-editor.png](../md/img/annotation-editor.png) +- Settings: [../md/img/settings-app.png](../md/img/settings-app.png) \ No newline at end of file diff --git a/prettysumatra/webui/toolbar.html b/prettysumatra/webui/toolbar.html index 0d3c09e0dc18..1d8d9f4c22d7 100644 --- a/prettysumatra/webui/toolbar.html +++ b/prettysumatra/webui/toolbar.html @@ -19,10 +19,8 @@ try{ const active = document.activeElement; const editable = isEditableElement(active); - if ((e.ctrlKey||e.metaKey) && !editable) { - const k = (e.key||'').toLowerCase(); - if (blockedKeys.has(k)) return; // neutralize webview handlers - } + const k = (e.key||'').toLowerCase(); + if (blockedKeys.has(k)) return; // neutralize webview handlers if (!editable && e.key === 'F3') return; } catch (_) {} return listener.apply(this, arguments); @@ -149,7 +147,7 @@ } .brand { - display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-right: 8px; cursor: default; + display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-right: 0px; cursor: default; } .brand-icon { @@ -177,7 +175,7 @@ } .toolbar-items.toolbar-items--compact { - gap: 6px; + gap: 2px; } .toolbar-items.toolbar-items--compact .control-group, @@ -189,7 +187,7 @@ .toolbar-items.toolbar-items--compact .btn { height: 26px; - padding: 0 10px; + padding: 0 4px; } .toolbar-items.toolbar-items--compact .btn--icon { @@ -262,6 +260,65 @@ border-radius: 20px; gap: 6px; } +.theme-control-group .custom-dropdown { + flex-shrink: 0; + overflow: visible; +} + +.theme-control-group .dropdown-trigger, +.theme-control-group .invert-doc-btn { + width: 32px; + height: 32px; + padding: 0; + border-radius: 999px; + flex-shrink: 0; +} + +.theme-control-group .dropdown-trigger { + justify-content: center; + transition: width 0.18s ease, padding 0.18s ease, margin 0.18s ease, border-width 0.18s ease, opacity 0.18s ease, transform 0.18s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease; +} + +.theme-control-group .dropdown-trigger .dropdown-value { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + transition: opacity 0.18s ease, transform 0.18s ease; + transform-origin: center; +} + +.theme-control-group .custom-dropdown.open .dropdown-trigger .dropdown-value { + opacity: 0; + transform: scale(0.7); +} + +.theme-control-group .custom-dropdown.open .dropdown-trigger { + background: transparent; + box-shadow: none; + width: 0; + padding: 0; + margin: 0; + border-width: 0; + opacity: 0; + transform: scale(0.7); + pointer-events: none; +} + +.theme-control-group .dropdown-menu li { + width: 32px; + height: 32px; + padding: 0; + margin-left: 0; + justify-content: center; +} + +.theme-control-group .dropdown-menu li .material-symbols-rounded, +.theme-control-group .dropdown-menu li .win11-icon { + margin: 0; +} + #openButton { gap: 7px; padding: 0 13px; @@ -498,7 +555,7 @@ @media (max-width: 650px) { .modern-theme-switch { - display: none !important; /* Si quieres seguir ocultándolo en móvil como en el original */ + display: none !important; } } @@ -589,11 +646,11 @@ } .dropdown-trigger { - display: flex; align-items: center; gap: 6px; background: transparent; border: none; color: var(--text-main); font-family: inherit; font-size: 0.85rem; font-weight: 600; padding: 0 10px; height: 32px; cursor: pointer; border-radius: 6px; transition: var(--transition); + display: flex; align-items: center; gap: 6px; background: transparent; border: none; color: var(--text-main); font-family: inherit; font-size: 0.85rem; font-weight: 600; padding: 0 12px; height: 32px; cursor: pointer; border-radius: 999px; transition: var(--transition); } .dropdown-menu { - position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(-10px); background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 6px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.03); padding: 6px; min-width: 140px; list-style: none; margin: 0; opacity: 0; visibility: hidden; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); z-index: 100; pointer-events: none; + position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(-10px); background: var(--bg-input); border-radius: 18px; box-shadow: 0 6px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.03); padding: 6px; min-width: 140px; list-style: none; margin: 0; opacity: 0; visibility: hidden; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); z-index: 100; pointer-events: none; } .custom-dropdown.open .dropdown-menu { @@ -613,7 +670,7 @@ } .dropdown-menu li { - display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 0.85rem; color: var(--text-main); border-radius: 6px; cursor: pointer; transition: background 0.1s ease; position: relative; + display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 12px; font-size: 0.85rem; color: var(--text-main); border-radius: 999px; cursor: pointer; transition: background 0.1s ease; position: relative; } .dropdown-menu li:hover { @@ -845,18 +902,29 @@ @media (max-width: 650px) { .toolbar-container { - padding: 4px; height: 44px; gap: 4px; + padding: 1px; height: 44px; gap: 4px; } .toolbar-items { gap: 2px; - padding: 0 28px; + padding: 0 2px; + margin-left: -8px; } .control-group, .modern-pagination-group { height: 32px; padding: 1px 2px; border-radius: 6px; } + .modern-pagination-group { + gap: 1px; + width: auto; + } + + .toolbar-items.toolbar-items--compact button#pagePrevButton, + .toolbar-items.toolbar-items--compact button#pageNextButton { + width: 8px !important; + } + .modern-pagination-group .page-input { min-width: 20px; max-width: 48px; font-size: 0.8rem; margin: 0; } @@ -874,7 +942,7 @@ } .grp-zoom, .grp-view { - height: 28px; + height: 32px; } .btn { @@ -905,6 +973,11 @@ width: 22px; height: 18px; } + .grp-zoom.compact .btn--icon, .grp-view.compact .btn--icon { + width: 28px; + height: 26px; + } + } .skeleton-container { @@ -949,7 +1022,6 @@ .custom-dropdown.open .dropdown-menu { box-shadow: 0 4px 10px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02); - border: 1px solid var(--border-color); } [data-theme="dark"] .custom-dropdown.open .dropdown-menu { @@ -969,7 +1041,6 @@ .custom-dropdown.open { background: var(--bg-hover); - box-shadow: 0 0 0 1px var(--border-color), var(--shadow-sm); } .custom-dropdown .dropdown-trigger { @@ -1011,10 +1082,10 @@ } .custom-dropdown .dropdown-menu li { - padding: 3px 5px; + padding: 5px 6px; margin-left: 2px; white-space: nowrap; - border-radius: var(--radius-sm); + border-radius: 999px; background: transparent; color: var(--text-muted); flex-shrink: 0; @@ -1331,7 +1402,7 @@ ========================================================================== */ .btn--icon { - width: 32px; + width: 28px; padding: 0; font-size: 1rem; } @@ -1503,12 +1574,17 @@
-
-
- - - +
+ +
+
@@ -1532,7 +1608,7 @@ const viewModeDropdown=document.getElementById('viewModeDropdown'); const continuousToggle=document.getElementById('continuousToggle'); const documentInvertToggle=document.getElementById('documentInvertToggle'); -const themeSwitch=document.getElementById('themeSwitch'); +const themeDropdown=document.getElementById('themeDropdown'); let currentPage=1; let totalPages=1; let lastAppDark=false; let lastWindowsDark=false; let lastFollowWindows=false; let lastDocInverted=false; // ensure toggles expose aria-pressed consistent with class @@ -1614,6 +1690,29 @@ } window.hybridToolbarSetZoomState = setZoomState; +function setThemeState(themeValue) { + if (!themeDropdown) return; + const menu = themeDropdown.querySelector('.dropdown-menu'); + if (!menu) return; + const normalized = String(themeValue || 'auto').toLowerCase(); + const options = Array.from(menu.querySelectorAll('li')); + const match = options.find(li => String(li.dataset.value) === normalized) || options[0]; + options.forEach(li => { + const value = String(li.dataset.value || ''); + const selected = value === normalized || (value === 'invert' && lastDocInverted); + li.classList.toggle('selected', selected); + }); + const display = themeDropdown.querySelector('.dropdown-value'); + if (display && match) { + display.innerHTML = ''; + const icon = match.querySelector('.material-symbols-rounded, .win11-icon'); + if (icon) display.appendChild(icon.cloneNode(true)); + else display.textContent = match.textContent.trim(); + } + themeDropdown.dataset.state = match?.dataset.value || 'auto'; +} +window.hybridToolbarSetThemeState = setThemeState; + function hybridToolbarBatchUpdate(state = {}) { if (!state || typeof state !== 'object') return; if (state.page !== undefined || state.total !== undefined) { @@ -1759,14 +1858,10 @@ root.style.setProperty('--shadow-md', `0 2px 4px ${rgbaFromHex(shadow, shadowAlpha + 0.08) || 'rgba(0,0,0,0.16)'}`); const aD=!!p.appDark; root.dataset.theme=aD?'dark':'light'; lastFollowWindows = !!p.followWindows; lastAppDark = aD; lastWindowsDark = !!p.windowsDark; - if(themeSwitch) themeSwitch.setAttribute('data-state', lastFollowWindows ? 'auto' : (aD ? 'dark' : 'light')); + lastDocInverted = !!p.docInverted; + setThemeState(lastFollowWindows ? 'auto' : (aD ? 'dark' : 'light')); // keep document invert toggle in sync (use centralized setter) if (typeof setToggleStateByExec === 'function') setToggleStateByExec('toggleDocumentInvert', !!p.docInverted); - // ensure theme buttons reflect state visually and via aria - try { - const stateVal = lastFollowWindows ? 'auto' : (lastAppDark ? 'dark' : 'light'); - themeSwitch.querySelectorAll('.mts-btn').forEach(btn => { const active = btn.dataset.val === stateVal; btn.classList.toggle('active', active); btn.setAttribute('aria-pressed', String(active)); }); - } catch(e) {} } window.hybridToolbarApplyTheme=hybridToolbarApplyTheme; if(window.__hybridToolbarThemePayload) hybridToolbarApplyTheme(window.__hybridToolbarThemePayload); @@ -1984,26 +2079,51 @@ setTimeout(() => { focusToolbarSearch(); }, 0); }; -if(themeSwitch) { - themeSwitch.querySelectorAll('.mts-btn').forEach(btn => { - btn.addEventListener('click', () => { - if(isToolbarUnlocked) return; - const val = btn.dataset.val; - if (val === 'auto') { - if (!lastFollowWindows) { - if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleThemeFollowWindows' } })); - } - // Ensure document invert matches Windows theme deterministically - if (lastWindowsDark) { - if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'setDocumentInvertOn' } })); - } else { - if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'setDocumentInvertOff' } })); - } - } - else if (val === 'light') { if (lastFollowWindows) { if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleThemeFollowWindows' } })); } if (lastAppDark) { if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleTheme' } })); } if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'setDocumentInvertOff' } })); } - else if (val === 'dark') { if (lastFollowWindows) { if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleThemeFollowWindows' } })); } if (!lastAppDark) { if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleTheme' } })); } if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'setDocumentInvertOn' } })); } - }); +if(themeDropdown) { + const trigger = themeDropdown.querySelector('.dropdown-trigger'); + const menu = themeDropdown.querySelector('.dropdown-menu'); + trigger?.addEventListener('click', (e) => { + e.stopPropagation(); + document.querySelectorAll('.custom-dropdown.open').forEach(d => { if (d !== themeDropdown) d.classList.remove('open'); d.classList.remove('dropup','inline'); d.querySelector('.dropdown-menu')?.classList.remove('clamped-left','clamped-right'); }); + const willOpen = !themeDropdown.classList.contains('open'); + themeDropdown.classList.toggle('open', willOpen); + setDropdownInline(themeDropdown, willOpen); + trigger.setAttribute('aria-expanded', String(willOpen)); }); + Array.from(menu.querySelectorAll('li')).forEach(li => li.addEventListener('click', () => { + if (isToolbarUnlocked) return; + const val = String(li.dataset.value || 'auto'); + if (val === 'auto') { + if (!lastFollowWindows) { + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleThemeFollowWindows' } })); + } + if (lastWindowsDark) { + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'setDocumentInvertOn' } })); + } else { + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'setDocumentInvertOff' } })); + } + } else if (val === 'light') { + if (lastFollowWindows) { + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleThemeFollowWindows' } })); + } + if (lastAppDark) { + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleTheme' } })); + } + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'setDocumentInvertOff' } })); + } else if (val === 'dark') { + if (lastFollowWindows) { + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleThemeFollowWindows' } })); + } + if (!lastAppDark) { + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'toggleTheme' } })); + } + if (window.external && typeof window.external.invoke === 'function') window.external.invoke(JSON.stringify({ type: 'command', name: 'execCommand', payload: { command: 'setDocumentInvertOn' } })); + } + setThemeState(lastFollowWindows ? 'auto' : (lastAppDark ? 'dark' : 'light')); + themeDropdown.classList.remove('open'); + setDropdownInline(themeDropdown, false); + trigger.setAttribute('aria-expanded', 'false'); + })); } /* =================== CUSTOMIZATION =================== */ @@ -2060,20 +2180,34 @@ return; } + function clearAutoCompactState() { + if (lastCompactState) { + toolbarItemsContainer.classList.remove('toolbar-items--compact'); + toolbarItemsContainer.querySelectorAll('.compact').forEach(el => el.classList.remove('compact')); + lastCompactState = false; + } + if (lastAutoHidden.size) { + lastAutoHidden.forEach(id => { + const el = document.getElementById(id); + if (el) el.classList.remove('auto-hidden'); + }); + lastAutoHidden.clear(); + } + } + + // Measure against the full toolbar so growth can actually release compact mode. + clearAutoCompactState(); + // Compute desired compact state with hysteresis to avoid oscillation near threshold const overflowNow = toolbarItemsContainer.scrollWidth > toolbarItemsContainer.clientWidth + 2; const hasSpareRoom = toolbarItemsContainer.scrollWidth < toolbarItemsContainer.clientWidth - 40; - const needsCompact = lastCompactState ? !hasSpareRoom : overflowNow; + const needsCompact = overflowNow && !hasSpareRoom; // Apply or remove compact mode only if it changed - if (needsCompact && !lastCompactState) { + if (needsCompact) { toolbarItemsContainer.classList.add('toolbar-items--compact'); toolbarItemsContainer.querySelectorAll('.control-group, .modern-pagination-group, .theme-control-group, .search-wrapper').forEach(el => el.classList.add('compact')); lastCompactState = true; - } else if (!needsCompact && lastCompactState) { - toolbarItemsContainer.classList.remove('toolbar-items--compact'); - toolbarItemsContainer.querySelectorAll('.compact').forEach(el => el.classList.remove('compact')); - lastCompactState = false; } // After compacting, if still overflowing, pick auto-hide candidates diff --git a/readme.md b/readme.md index d5bd1325e4d4..1be790a95404 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,8 @@ **PrettySumatraPDF** is a modern redesign of the classic SumatraPDF reader, bringing a fresh Windows 11-style interface while maintaining 100% of the original functionality and features. +**Fork notice:** PrettySumatraPDF is a fork of [SumatraPDF](https://github.com/sumatrapdfreader/sumatrapdf). This repository is maintained by Javi Lendi and preserves the original project's authors and licensing; see the `AUTHORS` and `LICENSE` files for details. + --- ## ✨ Key Features @@ -75,18 +77,18 @@ This project is built on top of the official SumatraPDF codebase. If you want to cd PrettySumatraPDF ``` -2. Run the build: +3. Run the build: ```bash bun ./cmd/build.ts ``` -3. The executable will be located at: `./out/dbg64/SumatraPDF.exe` +4. The executable will be located at: `./out/dbg64/PrettySumatraPDF.exe` ### Debugging To run with the debugger: ```bash -windbgx -Q -o -g ./out/dbg64/SumatraPDF.exe +windbgx -Q -o -g ./out/dbg64/PrettySumatraPDF.exe ``` ### Code Formatting @@ -102,14 +104,20 @@ bun ./cmd/format.ts PrettySumatraPDF is an open-source project licensed under the same terms as SumatraPDF (A)GPLv3, with some code under BSD license. Contributions are welcome! For more information on how to contribute, please visit the [Developer Information](https://www.sumatrapdfreader.org/docs/Contribute-to-SumatraPDF) page. +## Fork notice and attribution + +- This project is a fork of the original [SumatraPDF](https://github.com/sumatrapdfreader/sumatrapdf) project. +- All original authors are credited in the `AUTHORS` file. The maintainer of this fork is **Javi Lendi**. +- Licensing from the upstream project is preserved; do not change `COPYING`/`COPYING.BSD` without legal review. + My goal with PrettySumatraPDF is to create a visually appealing and modernized version of SumatraPDF while ensuring that all existing features and functionalities remain intact. I am committed to maintaining the core principles of SumatraPDF, including its lightweight nature and fast performance, while enhancing the user experience with a fresh design. I am committed to updating PrettySumatraPDF with the latest features and improvements from the original SumatraPDF project, ensuring that users can enjoy the best of both worlds: a modern interface and the full functionality of the classic reader. ### More Information -- 🌐 [SumatraPDF Website](https://www.sumatrapdfreader.org/free-pdf-reader) -- 📚 [Manual](https://www.sumatrapdfreader.org/manual) -- 👨‍💻 [Developer Information](https://www.sumatrapdfreader.org/docs/Contribute-to-SumatraPDF) +- 🌐 [PrettySumatraPDF GitHub](https://github.com/JaviLendi/PrettySumatraPDF) +- 📚 [Manual (docs)](https://github.com/JaviLendi/PrettySumatraPDF/tree/main/docs/md) +- 👨‍💻 [Developer Information (docs)](https://github.com/JaviLendi/PrettySumatraPDF/tree/main/docs/md) - 📄 [License](LICENSE) - ✍️ [Authors](AUTHORS) diff --git a/scripts/installer/README_INSTALLER.md b/scripts/installer/README_INSTALLER.md index 4148ef1df068..c9cb3bfd9908 100644 --- a/scripts/installer/README_INSTALLER.md +++ b/scripts/installer/README_INSTALLER.md @@ -24,7 +24,7 @@ cmd /c "scripts\\build-vs2022.cmd Release x64 SumatraPDF-dll" & 'C:\Users\user\AppData\Local\Programs\Inno Setup 6\ISCC.exe' scripts\\installer\\PrettySumatraPDF.iss ``` -4. The installer will be produced under `scripts\installer\dist\` with filename `PrettySumatraPDF-Setup-1.0.0.exe`. +4. The installer will be produced under `scripts\installer\dist\` with filename `PrettySumatraPDF-Setup-1.0.1.exe`. Notes - The current script packages runtime artifacts from `out\\rel64` (`*.exe`, `*.dll`, `*.dat`, `*.txt`) to keep installer size reasonable. diff --git a/scripts/installer/dist/PrettySumatraPDF-Setup-1.0.1.exe b/scripts/installer/dist/PrettySumatraPDF-Setup-1.0.1.exe index 214b49be5d84..5e5ab9daa86e 100644 Binary files a/scripts/installer/dist/PrettySumatraPDF-Setup-1.0.1.exe and b/scripts/installer/dist/PrettySumatraPDF-Setup-1.0.1.exe differ diff --git a/src/HomePage.cpp b/src/HomePage.cpp index f68e69c9f500..113e4cbadf98 100644 --- a/src/HomePage.cpp +++ b/src/HomePage.cpp @@ -474,13 +474,13 @@ struct AboutLayoutInfoEl { }; static AboutLayoutInfoEl gAboutLayoutInfo[] = { - {_TRN("website"), _TRN("SumatraPDF website"), kWebsiteURL}, + {_TRN("website"), _TRN("PrettySumatraPDF GitHub"), "https://github.com/JaviLendi/PrettySumatraPDF"}, {_TRN("manual"), _TRN("SumatraPDF manual"), kManualURL}, {_TRN("forums"), _TRN("SumatraPDF forums"), "https://github.com/sumatrapdfreader/sumatrapdf/discussions"}, - {_TRN("programming"), _TRN("The Programmers"), - "https://github.com/sumatrapdfreader/sumatrapdf/blob/master/AUTHORS"}, - {_TRN("licenses"), _TRN("Various Open Source"), - "https://github.com/sumatrapdfreader/sumatrapdf/blob/master/AUTHORS"}, + {_TRN("programming"), _TRN("PrettySumatraPDF authors"), + "https://github.com/JaviLendi/PrettySumatraPDF/blob/main/AUTHORS"}, + {_TRN("licenses"), _TRN("PrettySumatraPDF licenses"), + "https://github.com/JaviLendi/PrettySumatraPDF/blob/master/COPYING"}, #if defined(GIT_COMMIT_ID_STR) {_TRN("last change"), _TRN("git commit ") GIT_COMMIT_ID_STR, "https://github.com/sumatrapdfreader/sumatrapdf/commit/" GIT_COMMIT_ID_STR}, @@ -530,49 +530,22 @@ static void DrawSumatraVersion(HDC hdc, Rect rect) { Size prettySz = HdcMeasureText(hdc, "Pretty", fmt, fontSumatraTxt); Size sumatraSz = HdcMeasureText(hdc, "Sumatra", fmt, fontSumatraTxt); Size pdfSz = HdcMeasureText(hdc, "PDF", fmt, fontSumatraTxt); - Size subtitleSz = HdcMeasureText(hdc, _TRA("Focused reading"), fmt, fontSubtitleTxt); + Size subtitleSz = HdcMeasureText(hdc, _TRA("Fork of SumatraPDF"), fmt, fontSubtitleTxt); TempStr ver = GetAppVersionTemp(); Size verSz = HdcMeasureText(hdc, ver, fmt, fontVersionTxt); - int textDy = prettySz.dy + DpiScale(hdc, 16); - int iconSize = textDy + DpiScale(hdc, 8); + int iconSize = prettySz.dy + DpiScale(hdc, 20); int totalDx = iconSize + DpiScale(hdc, 16) + prettySz.dx + sumatraSz.dx + pdfSz.dx; int x0 = rect.x + (rect.dx - totalDx) / 2; int y0 = rect.y + (rect.dy - iconSize) / 2; Rect iconRect(x0, y0, iconSize, iconSize); - { - AutoDeleteBrush brOuter(CreateSolidBrush(RGB(242, 184, 0))); - AutoDeletePen penOuter(CreatePen(PS_SOLID, 1, RGB(215, 167, 0))); - HGDIOBJ oldBrush = SelectObject(hdc, brOuter); - HGDIOBJ oldPen = SelectObject(hdc, penOuter); - RoundRect(hdc, iconRect.x, iconRect.y, iconRect.x + iconRect.dx, iconRect.y + iconRect.dy, DpiScale(hdc, 14), - DpiScale(hdc, 14)); - SelectObject(hdc, oldPen); - SelectObject(hdc, oldBrush); - } - Rect pageRect(iconRect.x + DpiScale(hdc, 11), iconRect.y + DpiScale(hdc, 8), iconRect.dx - DpiScale(hdc, 20), - iconRect.dy - DpiScale(hdc, 16)); - { - AutoDeleteBrush brPage(CreateSolidBrush(RGB(255, 249, 229))); - AutoDeletePen penPage(CreatePen(PS_SOLID, 1, RGB(221, 188, 84))); - HGDIOBJ oldBrush = SelectObject(hdc, brPage); - HGDIOBJ oldPen = SelectObject(hdc, penPage); - RoundRect(hdc, pageRect.x, pageRect.y, pageRect.x + pageRect.dx, pageRect.y + pageRect.dy, DpiScale(hdc, 8), - DpiScale(hdc, 8)); - SelectObject(hdc, oldPen); - SelectObject(hdc, oldBrush); - } - Rect lensRect(iconRect.x + iconRect.dx - DpiScale(hdc, 24), iconRect.y + iconRect.dy - DpiScale(hdc, 24), - DpiScale(hdc, 18), DpiScale(hdc, 18)); - { - AutoDeleteBrush brLens(CreateSolidBrush(RGB(247, 220, 128))); - AutoDeletePen penLens(CreatePen(PS_SOLID, DpiScale(hdc, 2), RGB(204, 151, 0))); - HGDIOBJ oldBrush = SelectObject(hdc, brLens); - HGDIOBJ oldPen = SelectObject(hdc, penLens); - Ellipse(hdc, lensRect.x, lensRect.y, lensRect.x + lensRect.dx, lensRect.y + lensRect.dy); - SelectObject(hdc, oldPen); - SelectObject(hdc, oldBrush); + HMODULE hmod = GetModuleHandleW(nullptr); + HICON hIcon = (HICON)LoadImageW(hmod, MAKEINTRESOURCEW(GetAppIconID()), IMAGE_ICON, iconRect.dx, iconRect.dy, + LR_DEFAULTCOLOR); + if (hIcon) { + DrawIconEx(hdc, iconRect.x, iconRect.y, hIcon, iconRect.dx, iconRect.dy, 0, nullptr, DI_NORMAL); + DestroyIcon(hIcon); } int textX = iconRect.x + iconRect.dx + DpiScale(hdc, 16); @@ -593,7 +566,7 @@ static void DrawSumatraVersion(HDC hdc, Rect rect) { int subY = textY + prettySz.dy + DpiScale(hdc, 1); SetTextColor(hdc, ThemeWindowTextColor()); - HdcDrawText(hdc, _TRA("Focused reading"), Point(textX, subY), fmt, fontSubtitleTxt); + HdcDrawText(hdc, _TRA("Fork of SumatraPDF"), Point(textX, subY), fmt, fontSubtitleTxt); HdcDrawText(hdc, ver, Point(textX + subtitleSz.dx + DpiScale(hdc, 8), subY), fmt, fontVersionTxt); Point p = {textX, subY + DpiScale(hdc, 13)}; @@ -666,7 +639,6 @@ static TempStr TrimGitTemp(const char* s) { to understand without seeing the design. */ static void DrawAbout(HWND hwnd, HDC hdc, Rect rect, Vec& staticLinks) { auto col = ThemeWindowTextColor(); - AutoDeletePen penBorder(CreatePen(PS_SOLID, ABOUT_LINE_OUTER_SIZE, col)); AutoDeletePen penDivideLine(CreatePen(PS_SOLID, ABOUT_LINE_SEP_SIZE, col)); col = ThemeWindowLinkColor(); AutoDeletePen penLinkLine(CreatePen(PS_SOLID, ABOUT_LINE_SEP_SIZE, col)); @@ -685,11 +657,7 @@ static void DrawAbout(HWND hwnd, HDC hdc, Rect rect, Vec& staticLin Rect titleRect(rect.TL(), CalcSumatraVersionSize(hdc)); ScopedSelectObject brush(hdc, CreateSolidBrush(col), true); - ScopedSelectObject pen(hdc, penBorder); -#ifndef ABOUT_USE_LESS_COLORS - Rectangle(hdc, rect.x, rect.y + ABOUT_LINE_OUTER_SIZE, rect.x + rect.dx, - rect.y + titleRect.dy + ABOUT_LINE_OUTER_SIZE); -#else +#ifdef ABOUT_USE_LESS_COLORS Rect titleBgBand(0, rect.y, rc.dx, titleRect.dy); RECT rcLogoBg = titleBgBand.ToRECT(); FillRect(hdc, &rcLogoBg, brushAboutBg); @@ -705,10 +673,6 @@ static void DrawAbout(HWND hwnd, HDC hdc, Rect rect, Vec& staticLin SetTextColor(hdc, col); SetBkMode(hdc, TRANSPARENT); -#ifndef ABOUT_USE_LESS_COLORS - Rectangle(hdc, rect.x, rect.y + titleRect.dy, rect.x + rect.dx, rect.y + rect.dy); -#endif - /* render text on the left*/ SelectObject(hdc, fontLeftTxt); uint fmt = DT_LEFT | DT_NOCLIP; @@ -1002,7 +966,7 @@ void ShowAboutWindow(MainWindow* win) { ReportIf(!gAtomAbout); } - TempWStr title = ToWStrTemp(_TRA("About SumatraPDF")); + TempWStr title = ToWStrTemp(_TRA("About PrettySumatraPDF")); DWORD style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU; int x = CW_USEDEFAULT; int y = CW_USEDEFAULT; diff --git a/src/Menu.cpp b/src/Menu.cpp index 92b23cc5c8e1..4dad3872feb9 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -1278,7 +1278,7 @@ BuildMenuCtx* NewBuildMenuCtx(WindowTab* tab, Point pt) { if (engine && engine->IsImageCollection()) { ctx->isImageCollection = true; } - ctx->supportsAnnotations = EngineSupportsAnnotations(engine) && !tab->win->isFullScreen; + ctx->supportsAnnotations = EngineSupportsAnnotations(engine); ctx->hasUnsavedAnnotations = EngineHasUnsavedAnnotations(engine); ctx->canSendEmail = CanSendAsEmailAttachment(tab); ctx->isPdf = CouldBePDFDoc(tab); diff --git a/src/SumatraPDF.cpp b/src/SumatraPDF.cpp index 02b3175426b1..1487c69e6975 100644 --- a/src/SumatraPDF.cpp +++ b/src/SumatraPDF.cpp @@ -8657,6 +8657,17 @@ LRESULT CALLBACK WndProcSumatraFrame(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) if (win->hwndToolbar) { ReCreateToolbar(win); } + win->lastLayoutState = {}; + RelayoutFrame(win); + } + return 0; + + case WM_DISPLAYCHANGE: + if (win) { + if (win->hwndToolbar) { + ReCreateToolbar(win); + } + win->lastLayoutState = {}; RelayoutFrame(win); } return 0; diff --git a/src/Version.h b/src/Version.h index cca8d780b459..00906ec09b61 100644 --- a/src/Version.h +++ b/src/Version.h @@ -3,10 +3,10 @@ // CURR_VERSION can be over-written externally #ifndef CURR_VERSION -#define CURR_VERSION 3.7 +#define CURR_VERSION 1.0.1 #endif #ifndef CURR_VERSION_COMMA -#define CURR_VERSION_COMMA 3,7,0 +#define CURR_VERSION_COMMA 1,0,1 #endif // this is sth. like "3.5" @@ -54,4 +54,4 @@ #define kCopyrightStr "Copyright 2006-2026 all authors (GPLv3)" #define kPublisherStr "Krzysztof Kowalczyk" -#define kAppName "SumatraPDF" +#define kAppName "PrettySumatraPDF" diff --git a/src/prettysumatra/BridgeDispatcher.cpp b/src/prettysumatra/BridgeDispatcher.cpp index aff0f58ec4df..5cb826bb0de5 100644 --- a/src/prettysumatra/BridgeDispatcher.cpp +++ b/src/prettysumatra/BridgeDispatcher.cpp @@ -124,7 +124,7 @@ static bool HybridToolbarCanAnnotate(MainWindow* win) { if (tab && tab->IsDocLoaded()) { EngineBase* eng = tab->GetEngine(); if (eng) { - canAnnotate = EngineSupportsAnnotations(eng) && !(win->isFullScreen || win->presentation); + canAnnotate = EngineSupportsAnnotations(eng) && !win->presentation; } } return canAnnotate;