Skip to content

Draft: comdlg32: IFileDialog navigation bar

Vladislav Timonin requested to merge vt/wine:fd-navbar into master

Implements navigation bar featuring:

  • back/forward buttons
  • go up button
  • address crumbs
    • hides crumbs when there's not enough space to display all of them
    • always shows at least 2 crumbs
      • truncating them if needed
      • first crumb is at least 56px
      • aligns label to the left if truncated
    • right clicking on the crumb, or free space, opens a menu with Copy address as text and Edit address options
    • reuses existing crumbs to avoid some flickering
  • overflow menu
    • first crumb is always moved here
    • removes the split, if there are no items in the menu
    • hidden crumbs are moved here
    • left or right click on the button starts address editing
  • address edit
    • accepts an existing path
    • expands environment variables, e.g. %APPDATA%\Microsoft -> C:\users\%USERNAME%\AppData\Roaming\Microsoft
    • errors with a MessageBox on nonexistent paths
  • refresh button
    • changes into go to button when editing address
  • DPI scaling

Screenshots:

navbar-crumbs-classic

navbar-crumbs-light

navbar-edit-classic

navbar-edit-light

navbar-120dpi-classic

navbar-120dpi-light

Remaining issues:

  • crumbs not lighting up when hovered sometimes
    • can be observed in current file dialog, hovering over dropdown arrow of a file type fixes it for a moment
  • crumbs flickering on address change sometimes
    • mostly when there's not enough space to display all of them
    • DeferWindowPos doesn't seem to be atomic in Wine, presumably is in native Windows?
  • unexpected address conversion for some PIDLs
    • e.g. Desktop -> C:\users\%USERNAME%\Desktop, which is an entirely different location
    • or My Computer into an empty string
  • known folders are not handled by address edit, e.g. Desktop, My Computer
  • icons are not DPI scaled
  • while writing this:
    0024:fixme:bitmap:NtGdiCreateBitmap planes = 0
    0024:err:system:user_check_not_lock BUG: holding USER lock
    wine/dlls/win32u/sysparams.c:396: user_check_not_lock: Assertion `0' failed.
    wine: Assertion failed at address F7FF8549 (thread 0024), starting debugger...
    • can't reproduce, happened when clicking on an item in overflow menu
    • race condition? cosmic ray?

Addresses following bugs:

Edited by Vladislav Timonin

Merge request reports

Loading