From 76b1cba609bc04127a748ff24cea6434ab00fc86 Mon Sep 17 00:00:00 2001 From: Shridhar Kumar <45252729+shriprem@users.noreply.github.com> Date: Sun, 8 Jun 2025 18:02:09 -0400 Subject: [PATCH] Add new plugin notification: NPPN_TOOLBARICONSETCHANGED Fix #16646, close #16647 --- .../src/MISC/PluginsManager/Notepad_plus_msgs.h | 7 +++++++ PowerEditor/src/NppBigSwitch.cpp | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index 4eda0a8c2..6dcb8cb75 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -1248,3 +1248,10 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //scnNotification->nmhdr.code = NPPN_NATIVELANGCHANGED; //scnNotification->nmhdr.hwndFrom = hwndNpp //scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero + + #define NPPN_TOOLBARICONSETCHANGED (NPPN_FIRST + 32) // To notify plugins that toolbar icon set selection has changed + //scnNotification->nmhdr.code = NPPN_TOOLBARICONSETCHANGED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = iconSetChoice; + // where iconSetChoice could be 1 of 5 possible values: + // 0 (Fluent UI: small), 1 (Fluent UI: large), 2 (Filled Fluent UI: small), 3 (Filled Fluent UI: large) and 4 (Standard icons: small). diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 4a6290720..8bfc2e5ca 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -378,12 +378,12 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case NPPM_INTERNAL_TOOLBARICONSCHANGED: { refreshInternalPanelIcons(); - // Notify plugins that toolbar icons have changed TODO - //SCNotification scnN{}; - //scnN.nmhdr.code = ; - //scnN.nmhdr.hwndFrom = hwnd; - //scnN.nmhdr.idFrom = 0; - //_pluginsManager.notify(&scnN); + // Notify plugins that toolbar icons have changed + SCNotification scnN{}; + scnN.nmhdr.code = NPPN_TOOLBARICONSETCHANGED; + scnN.nmhdr.hwndFrom = hwnd; + scnN.nmhdr.idFrom = _toolBar.getState(); + _pluginsManager.notify(&scnN); return TRUE; }