Skip to content

UI Modernization - Win 11 - Mica Backdrop - Dark Mode #205

@softworkz

Description

@softworkz

UI Modernization - Win 11 - Mica Backdrop - Dark Mode

Getting these things working right in a Win32 application is quite challenging, as MS have shifted focus for Windows UI towards UWP/WinUI2 and now WinAppSDK/WinUI3, unfortunately. Especially when it's about using Mica (or Acrylic) backdrops, because that requires composition which is something, GDI just wasn't designed for, so one could probably also say that MS were kind-of forced to move away from GDI and apps using plain Win32 controls. Still, there are ways (as so often), even though less obvious and not necessarily always straightforward.

What I can offer

  • Code, genuinely written for 7zip
    • Not using any libraries
    • Not copied from other projects
      (albeit I have some thanks to say)
  • Follows existing patterns
  • Win11 UI support is optional; when disabled or unavailable, everything keeps working as is
  • Preserves down-level compilation support
    (imports are loaded dynamically)
  • Avoids OS compatibility issues
    There's a single decision point in code. No fallbacks, no dealing with behaviors on specific Win 11 versions.
    Only when all requirements are met, the new UI features are available.

Features

  • EXCLUSIVE: True Mica Backdrop Support
    • Including ListView transparency
    • This is most likely exclusive; I haven't seen any other project being able to do this
      (there are some forks claiming support for this, but they don't show screenshots and when you install, you realize that it's not the real thing)
  • Dark Mode
    Everywhere, for all controls and windows
  • Modern icons
    • Close to the original shapes and colors
    • Dynamic icon color adjustment for
      • all button states (normal, hot, disabled, pressed)
      • different adjustments for Win11 light, Win11 dark and classic display modes
    • Three sizes (16, 24, 32)
  • ToolBar
    • Tooltips only shown when buttons have no captions
    • Adjusted spacing and button sizing
  • Semi-transparent logo spanning title bar and menu bar area with menus inset from the left
  • Modernized status bar
    • Adjusted, size and spacing, font and color
    • Transparent for Mica see-through
  • Menus
    • Transparent MenuBar rendering
    • Dark theme item drawing
  • ListView
    • Show column sort indicators
    • Win11-Style item selection rendering in detail view
    • Keep showing selection when window is unfocused
  • Main Window
    • Add space around address/path input
  • New Options
    • Enable Win11 Appearance
    • Enable ListView transparency

Code Updates

  • CWindow2
    Implement notify message reflection, adding OnNotifyReflect and OnDrawItemReflect
  • Introduce CControl
    as base class for controls and derive some controls from it
    • Inherits from CWindow2 for its built-in subclassing
    • Member methods to simplify custom-drawing with theme APIs
      (like DrawThemeText, DrawThemeBackground)
  • Add CUiApiLoader
    Dynamic loading of windows libs and function entry-point pointers
  • Introduce CThemeManager
    Available as global static g_ThemeManager
    Centralizes all implementations for Win 11 UI features
  • Add WinCompat.h
    Win Api definitions for down-level SDK compatibility
  • ImageList.h
    Add function for loading 32bpp images with full alpha channel
  • CListView
    Implement custom drawing with double-buffering and alpha text
  • Add ReBar.cpp
    Implement custom drawing with alpha background
  • StatusBar.cpp
    Implements custom drawing using Windows themes APIs for modern appearance
  • Add ToolBar.cpp
    Image list management, dynamic icon colorization

Question

Are you even interested in a PR?

Best,
softworkz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions