Skip to content

Gtk: Show page numbers in the image list - #989

Merged
cyanfish merged 2 commits into
cyanfish:masterfrom
darkstarfire:feat/gtk-show-page-numbers
Nov 24, 2026
Merged

cyanfish merged 2 commits into
cyanfish:masterfrom
darkstarfire:feat/gtk-show-page-numbers

Conversation

@darkstarfire

Copy link
Copy Markdown
Contributor

Brings the existing "Show page numbers" option to the GTK/Linux frontend.

We opened a discussion to confirm the approach before this PR, as CONTRIBUTING suggests for UI changes: #982. There has been no response there so far, so we're opening this PR to continue the review.

Changes

  • LinuxSystemCompat: SupportsShowPageNumbers is now true, so the existing checkbox is shown on Linux. It reuses UiStrings.ShowPageNumbers, so no new strings are added.
  • GtkListView: when ShowPageNumbers is set, each thumbnail gets a centered label with the 1-based position and total (e.g. 2 / 5), matching the Windows rendering. Labels are refreshed after set, append, replace, trim and regenerate operations.
  • GtkDesktopForm: overrides UpdateListView() to call RegenerateImages(). GTK list items are widgets rather than custom-drawn, so toggling the setting applies without a restart.

Testing

  • Platforms: tested on Linux (GTK) only. Not tested on Windows or macOS. The Windows code path is unchanged, and macOS keeps SupportsShowPageNumbers as false.
  • Manual (Linux, GTK): the checkbox appears and persists; labels appear under each thumbnail; labels update after removing and reordering pages; labels disappear when the option is turned off. Screenshots are in the discussion above.
  • Automated:
    • NAPS2.App.Gtk builds with 0 warnings and 0 errors.
    • NAPS2.Lib.Tests: 510 total, 0 failed, 8 ignored.
    • NAPS2.Sdk.Tests: 5 failures in PageSizeTests on my machine. They depend on the system culture (pt-BR) and pass with en-US.

AI assistance

This change was drafted with the help of an AI coding assistant (Claude). The code was reviewed, built and tested manually on Linux as described above.

Draw the 1-based "n / total" label below each thumbnail when
ShowPageNumbers is enabled, keeping labels in sync with list
position after set, append, replace, trim and regenerate operations.
Rebuild the GTK list when settings are saved so changes apply
without a restart.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@cyanfish
cyanfish merged commit 67dda7d into cyanfish:master Nov 24, 2026
3 checks passed
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.

3 participants