Skip to content

Add an optional auto-hiding toolbar - #2005

Open
zaum wants to merge 3 commits into
QL-Win:masterfrom
zaum:master
Open

zaum wants to merge 3 commits into
QL-Win:masterfrom
zaum:master

Conversation

@zaum

@zaum zaum commented Sep 18, 2026

Copy link
Copy Markdown

PR Checklist

  • [ x] Functionality has been tested, no obvious bugs
  • [ x] Code style follows project conventions
  • [ x] Documentation/comments updated (if applicable)

Brief Description of Changes

I added a new item to the tray icon menu: "Hide toolbar." When enabled, it hides the toolbar, and it appears when you hover over it.

Related Issue (if any)

Please provide related issue numbers:

Additional Notes

Add any extra notes here:

Summary by Sourcery

Add optional auto-hiding behavior for the viewer toolbar with localized UI support.

New Features:

  • Add an optional tray-menu setting to hide the viewer toolbar and reveal it when the pointer approaches the top of the window.

Enhancements:

  • Improve image metadata presentation by prioritizing dimensions and moving viewer tooltips and metadata content to updated localized UI elements.

Build:

  • Make version generation fall back to a valid default version when repository tags do not match the expected format.

@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a persisted “Hide toolbar” tray setting, wires it into viewer initialization, and implements animated toolbar auto-hiding based on cursor position using timer-driven screen-coordinate checks, while also hardening version generation for invalid Git tags.

Sequence diagram for the optional auto-hiding toolbar

sequenceDiagram
    participant User
    participant TrayIconManager
    participant SettingHelper
    participant ViewerWindow
    participant DispatcherTimer
    participant ToolbarStoryboard

    User->>TrayIconManager: Execute _itemHideToolbar Command
    TrayIconManager->>SettingHelper: Get HideToolbar
    TrayIconManager->>SettingHelper: Set HideToolbar
    User->>ViewerWindow: BeginShow
    ViewerWindow->>SettingHelper: Get HideToolbar
    ViewerWindow->>ViewerWindow: Set HideToolbar
    DispatcherTimer->>ViewerWindow: UpdateToolbarVisibility
    alt Pointer in toolbar reveal zone
        ViewerWindow->>ToolbarStoryboard: Begin ShowCaptionContainerStoryboard
    else Pointer outside keep-visible zone
        ViewerWindow->>ToolbarStoryboard: Begin HideCaptionContainerStoryboard
    end
Loading

File-Level Changes

Change Details Files
Adds a persisted tray-menu option for enabling or disabling toolbar auto-hiding.
  • Adds the “Hide toolbar” menu item and synchronizes its checked state with the setting.
  • Loads the setting when a viewer begins showing content.
  • Adds localized-resource/project entries for the new menu label.
QuickLook/TrayIconManager.cs
QuickLook/ViewerWindow.Actions.cs
QuickLook/Translations.config
QuickLook/QuickLook.csproj
QuickLook.Common/Styles/MainWindowStyles.xaml
QuickLook.Common/Styles/MainWindowStyles.Dark.xaml
Implements cursor-driven toolbar reveal, retention, and animated hiding.
  • Adds bindable HideToolbar state and updates the XAML presentation/animation behavior.
  • Uses a dispatcher timer and screen cursor coordinates to detect reveal and keep-visible zones.
  • Coordinates show/hide storyboard execution and existing titlebar auto-hide behavior.
QuickLook/ViewerWindow.Properties.cs
QuickLook/ViewerWindow.xaml
QuickLook/ViewerWindow.xaml.cs
Makes version generation resilient when Git tags do not match the expected numeric format.
  • Falls back to version 0.0.0.0 for non-semver-like tags.
Scripts/update-version.ps1

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Sep 18, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@sourcery-ai
sourcery-ai Bot dismissed their stale review September 19, 2026 06:22

Sourcery withdrew this approval because the latest commits introduced blocking findings.

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