Move window titlebar logic and ui to new CustomWindowTitleBar

Merged
DA
2mo ago
+666-879

Summary

  • Replaces the duplicated titlebar xaml ui and button logic with a simple configurable drop in user control.
  • This means related changes such as the alt-tab bug fix can be applied cleanly to all windows.
  • Replicates all existing behavior by allowing button handling overrides or extensions (using e.handled to override), and exposing the LastNonMinimizedWindowState specifically for the SettingWindow to persist its state.
  • Uses dependency properties to allow easy toggling of which title bar elements are visible, right in the xaml.
  • Uses sensible defaults such as reusing the window title and icon, so that things like that can be defined in one place and not risk discrepancies.
  • Improved accessibility by giving automation names to the title bar buttons

Bringing up the Windows

WindowHow to trigger
SettingWindowRight-click tray icon → Settings
PluginSettingsWindowOpen any plugin's context menu and select the settings option
ReleaseNotesWindowSettings → About → "Release Notes" button
SelectBrowserWindowSettings → General → "Select Default Browser" button
SelectFileManagerWindowSettings → General → "Select Default File Manager" button
WelcomeWindowSettings → About → Dev Tools → rightmost button → "Wizard" button
ReportWindowCause a plugin to crash (or add this line somewhere new ReportWindow(new Exception("test")).Show();)
MessageBoxExSettings → Plugin Store → Click install on plugin (see #4503 for existing issues)
ProgressBoxExConfirm to install a plugin from the Plugin Store or use plugin manager
PluginUpdateWindowSettings → Plugin Store → Check Plugin Updates Button (with an outdated plugin - I download an old release for this)
CustomShortcutSettingSettings → Hotkeys → Custom Query Shortcuts → add or edit a shortcut
CustomQueryHotkeySettingSettings → Hotkeys → Custom Query Hotkeys → add or edit a custom query hotkey
ActionKeywordsSettings → Plugins → click a plugin → click its action keyword to edit it

You can use the changes in PR #4504 to have clean test windows for Report, Progress & Plugin Update (the branches should merge cleanly)


Summary by cubic

Centralized the window title bar UI and logic into a shared CustomWindowTitleBar across thirteen windows to remove duplication and keep behavior consistent. Fixed icon paths and now default to the host window’s title and icon when not set.

Summary of changes

  • Changed: 13 windows now use CustomWindowTitleBar; SettingWindow persists last non-minimized state; dialog windows mark close clicks as handled; shared TitleBarButtonPathStyle; fixed icon URIs (removed leading “/”) and rely on window title/icon by default.
  • Added: CustomWindowTitleBar with settable Title, IconSource (ImageSource), toggles for ShowIcon, ShowTitle, ShowMinimizeButton, ShowMaximizeRestoreButton, ShowCloseButton; built-in minimize/maximize/restore/close with handleable click events; LastNonMinimizedWindowState and change event; Alt+Tab minimized edge-case restore; hidden buttons collapse; accessibility names on buttons.
  • Removed: Per-window title bar XAML, button handlers, maximize/restore visibility logic, and window state/activation wiring in updated windows.
  • Memory usage: Neutral to slightly lower due to de-duplication and shared styles.
  • Security risks: None; UI-only refactor.
  • Unit tests: None added.

Release Note
All app windows now share a consistent title bar with standard controls and improved accessibility.