AkelPad Dark Mode Plugin

Discuss and announce AkelPad plugins
Post Reply
  • Author
  • Message
Offline
Posts: 68
Joined: Thu Feb 04, 2016 5:27 am

AkelPad Dark Mode Plugin

Post by c-sanchez »

Note: This plugin is currently in a functional Beta state. I really like this plugin and use it, but due to being occupied with several other projects, I cannot dedicate as much time to it as I would like. Rather than keeping it shelved indefinitely waiting for a 100% "finished" state, I am sharing the full source code so anyone interested can build upon it, fix edge cases, or adapt it further.

AkelDarkMode Plugin for AkelPad

Finally, a complete and seamlessly integrated Dark Mode for AkelPad!

AkelDarkMode modernizes AkelPad's classic look into a clean dark environment to reduce programmer eye fatigue. Unlike standard skinning, it dynamically theme-hooks the editor's UI—including the title bar, menu bar, tabs, status bar, and common controls—on the fly, with no need to restart AkelPad.

It already provides a solid, daily-usable experience on a clean/vanilla installation of AkelPad. However, several details remain to be polished (such as edge-case controls and compatibility testing across third-party dockable plugins), so the code is completely open for community collaboration.

Image

Image

✨ Features
  • Instant On-the-Fly Toggle: Switch dark mode on and off instantly without restarting AkelPad.
  • Native Windows 10/11 Dark Title Bar: Uses DWM/UxTheme composition hooks to enforce dark window frames and borders on modern Windows versions (1809+ / Windows 11).
  • Dark Menu Bar & System Buttons: Custom UAH menu bar rendering, including dark backgrounds, hover highlights, and custom min/restore/close caption buttons.
  • Dark Tabs & Status Bar: Fully themed tab bar with active accent lines, hover states, and an integrated dark status bar with custom resize grips.
  • Extensive Common Controls Subclassing:
    • Buttons, GroupBoxes, Checkboxes, and Radio buttons (rendered smoothly via GDI+).
    • ComboBoxes, Dropdown lists, and ListBoxes.
    • ListViews and custom dark column headers.
    • Up-Down / Spin controls and Static dividers.
  • Automatic Dialog Hooking: Intercepts and styles popup dialogs (e.g., Font selection, Color pickers, Settings) using CBT hooks.
  • Ultra-Lightweight: Zero third-party dependencies, built purely on native Win32 APIs and FreeBASIC.

🛠 Technical Details
  • Language: 100% FreeBASIC (Modular Win32 architecture).
  • Interface: Standard AkelPad Plugin API (AkelDLL.bi).
  • Theming Core: Undocumented UxTheme APIs (SetWindowCompositionAttribute, AllowDarkModeForWindow, SetPreferredAppMode) combined with systematic Window Subclassing.
  • Dialog Trap: Global thread CBT Hook (WH_CBT) catching newly created dialogs (#32770) and subclassing their children.
  • Graphics: Win32 GDI + GDI+ (for anti-aliased checkboxes, radio buttons, and borders).

📌 Current Status & Known Caveats
  • Vanilla AkelPad: Works out-of-the-box and looks consistent across main editor windows and default dialogs.
  • Plugin Compatibility: Not yet tested against complex plugin panels (e.g., Explorer, Coder, ToolBar). These may need specific hooks or exclusions.
  • Remaining Tasks: Fine-tuning certain standard dialog controls, ensuring high-DPI scaling robustness, and expanding control coverage where standard grey backgrounds might still bleed through.
⚙️ Compilation
To build the plugin yourself:
  1. Install the FreeBASIC compiler (fbc) and ensure it is in your system's PATH.
  2. Open a console inside the project folder.
  3. Run the included Compile.bat (or execute):

    Code: Select all

    fbc -dll -gen gcc "AkelDarkMode.bas"
  4. The resulting AkelDarkMode.dll will be generated ready to use.

📦 Installation
  1. Copy the compiled AkelDarkMode.dll into your plugins folder:
    • <AkelPad_Directory>\AkelFiles\Plugs\
  2. Open AkelPad.
  3. Press Alt+P (Plugins dialog), select AkelDarkMode::Main, and click Call (or assign a hotkey / enable Autoload).
🔗 Source Code & GitHub Repository
The complete source code, project files are hosted on GitHub:
👉 https://github.com/c-sanchez/AkelDarkMode

🤝 Contributions & Code Sharing
As mentioned, I am sharing this source code freely with the community. If you have FreeBASIC or Win32 experience and wish to add improvements, fix plugin interoperability, or take over maintenance, feel free to modify, fork, or redistribute the code! ;) ;)

Hopefully, this provides a solid foundation for everyone who has been wanting a proper Dark Mode in AkelPad :D

Offline
Posts: 154
Joined: Fri Aug 15, 2008 8:58 am

Re: AkelPad Dark Mode Plugin

Post by Diamen »

Nice Plugin.
Waiting for ToolBar and ContextMenu plugins support.

DV
Offline
Posts: 1268
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Re: AkelPad Dark Mode Plugin

Post by DV »

Pretty interesting!
As Diamen wrote, it would be cool to support Toolbar (class name is "ToolbarWindow32") and dialogs (class name is "#32770"). And buttons (class name is "Button"). (Note: checkboxes also have a class name of "Button").
Post Reply