Skip to content

Upcoming Dark Mode: How can plugins adapt their toolbar icons? #9809

@dinkumoil

Description

@dinkumoil

Description of the Issue

@donho @sasumner @adzm

When one looks into the commit history of the past weeks, he may have noticed that there is an upcoming dark mode for the UI presumably included with the next release of Notepad++.

When testing this new feature with recent Appveyor builds it becomes obvious that the currently used icons are not suitable for a dark mode UI. Whilst included standard icons can be (and seemingly are) adapted by the implementors of the dark mode, there arises a problem with plugins that place own icons into the toolbar - some of them are not recognizable anymore in dark mode.

Since the whole dark mode topic is spreaded over many issues and pull requests, I don't know if there are plans or even first approaches for providing an infrastructure to query if dark mode is active (at application startup) or to notify plugins that the user has (de-)activated it (at runtime). Thus I would like to suggest a new command message, a changed command message and a changed notification message.

  1. I think we need one new command message maybe called NPPM_GETDARKMODEACTIVE that returns a boolean to query current dark mode setting.
  2. Additionally the notification message NPPN_TBMODIFICATION should be changed in a way that it is sent not only at application startup but also at Notepad++ runtime whenever dark mode is (de-)activated by the user. It should provide in scnNotification->nmhdr.idFrom a boolean that tells the plugin the current state of dark mode activation.
  3. Moreover, command message NPPM_ADDTOOLBARICON should be changed in a way that it is able not only to set a toolbar icon but also replace an already set toolbar icon.

With these new/changed interface functions plugins can switch their icons between light and dark versions.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions