sunjw / jstoolnpp

A JavaScript (JSON) tool for Notepad++ (formerly JSMinNpp) and Visual Studio Code.
GNU General Public License v2.0
283 stars 24 forks source link

Please add icon to the dockable tab [enhancement] #119

Closed vinsworldcom closed 2 years ago

vinsworldcom commented 2 years ago

Please add an icon to the dockable tab; otherwise the text alignment does not look good:

Current implementation without icon: image

With icon: image

It is implemented simply with this patch. I can submit a pull request if you prefer, but this should be pretty easy to incorporate yourself:

diff --git a/trunk/src/jsMinNpp.cpp b/trunk/src/jsMinNpp.cpp
index ec3ffc2..02db6fd 100644
--- a/trunk/src/jsMinNpp.cpp
+++ b/trunk/src/jsMinNpp.cpp
@@ -652,8 +652,10 @@ void jsonTree()
                s_jsonDialog.create(&data);

                // define the default docking behaviour
-               data.uMask = DWS_DF_CONT_LEFT;
+               data.uMask = DWS_DF_CONT_LEFT | DWS_ICONTAB;
+               data.hIconTab = ( HICON )::LoadImage( s_jsonDialog.getHinst(), MAKEINTRESOURCE( IDI_JS_ICON ), IMAGE_ICON, 16, 16, LR_LOADTRANSPARENT );
                data.pszModuleName = s_jsonDialog.getPluginFileName();
                data.pszName = TEXT("JSToolNpp JSON Viewer");

Cheers.

sunjw commented 2 years ago

Thanks very much, I'll merge this.

sunjw commented 2 years ago

Merged in 5920981ca9fcb5cf09d03788cdcc9fbb6a4c563f