mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-26 23:34:44 +02:00
Use only toolbarButtonsConf.xml for toolbar buttons/icons customization
Merge toolbarIcons.xml into toolbarButtonsConf.xml for toolbar buttons/icons customization and remove toolbarIcons.xml. Fix #16402, close #16407
This commit is contained in:
parent
a23955742c
commit
4f649d24dd
@ -1240,21 +1240,6 @@ bool NppParameters::load()
|
||||
isAllLaoded = false;
|
||||
}
|
||||
|
||||
//---------------------------------//
|
||||
// toolbarIcons.xml : for per user //
|
||||
//---------------------------------//
|
||||
generic_string toolbarIconsPath(_userPath);
|
||||
PathAppend(toolbarIconsPath, TEXT("toolbarIcons.xml"));
|
||||
|
||||
_pXmlToolIconsDoc = new TiXmlDocument(toolbarIconsPath);
|
||||
loadOkay = _pXmlToolIconsDoc->LoadFile();
|
||||
if (!loadOkay)
|
||||
{
|
||||
delete _pXmlToolIconsDoc;
|
||||
_pXmlToolIconsDoc = nullptr;
|
||||
isAllLaoded = false;
|
||||
}
|
||||
|
||||
//------------------------------//
|
||||
// shortcuts.xml : for per user //
|
||||
//------------------------------//
|
||||
|
@ -26,7 +26,7 @@ BIN_DIRECTORY := ../bin
|
||||
INSTALLER_DIRECTORY := ../installer
|
||||
|
||||
TARGET_BINARY := notepad++.exe
|
||||
SRC_DATA := contextMenu.xml langs.model.xml shortcuts.xml stylers.model.xml tabContextMenu_example.xml toolbarButtonsConf_example.xml toolbarIcons.xml
|
||||
SRC_DATA := contextMenu.xml langs.model.xml shortcuts.xml stylers.model.xml tabContextMenu_example.xml toolbarButtonsConf_example.xml
|
||||
BIN_DATA := change.log doLocalConf.xml nppLogNulContentCorruptionIssue.xml readme.txt userDefineLangs/
|
||||
INSTALLER_DATA := autoCompletion/ functionList/ localization/ themes/
|
||||
|
||||
|
@ -82,7 +82,6 @@ Function copyCommonFiles
|
||||
File "..\bin\contextMenu.xml"
|
||||
File "..\src\tabContextMenu_example.xml"
|
||||
File "..\src\toolbarButtonsConf_example.xml"
|
||||
File "..\src\toolbarIcons.xml"
|
||||
|
||||
SetOverwrite on
|
||||
SetOutPath "$INSTDIR\"
|
||||
|
@ -123,8 +123,6 @@ copy /Y ..\bin\"notepad++.exe" .\minimalist\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ".\themes\DarkModeDefault.xml" .\minimalist\themes\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\src\toolbarIcons.xml .\minimalist\
|
||||
If ErrorLevel 1 goto End
|
||||
|
||||
|
||||
rmdir /S /Q .\minimalist64
|
||||
@ -160,8 +158,6 @@ copy /Y ..\bin64\"notepad++.exe" .\minimalist64\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ".\themes\DarkModeDefault.xml" .\minimalist64\themes\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\src\toolbarIcons.xml .\minimalist64\
|
||||
If ErrorLevel 1 goto End
|
||||
|
||||
|
||||
rmdir /S /Q .\minimalistArm64
|
||||
@ -197,8 +193,6 @@ copy /Y ..\binarm64\"notepad++.exe" .\minimalistArm64\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ".\themes\DarkModeDefault.xml" .\minimalistArm64\themes\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\src\toolbarIcons.xml .\minimalistArm64\
|
||||
If ErrorLevel 1 goto End
|
||||
|
||||
|
||||
rem Remove old built Notepad++ 32-bit package
|
||||
@ -283,8 +277,6 @@ copy /Y ..\bin\nppLogNulContentCorruptionIssue.xml .\zipped.package.release\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\bin\"notepad++.exe" .\zipped.package.release\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\src\toolbarIcons.xml .\zipped.package.release\
|
||||
If ErrorLevel 1 goto End
|
||||
|
||||
|
||||
|
||||
@ -313,8 +305,6 @@ copy /Y ..\bin\nppLogNulContentCorruptionIssue.xml .\zipped.package.release64\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\bin64\"notepad++.exe" .\zipped.package.release64\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\src\toolbarIcons.xml .\zipped.package.release64\
|
||||
If ErrorLevel 1 goto End
|
||||
|
||||
|
||||
rem Basic Copy needed files into Notepad++ ARM64 package folders
|
||||
@ -342,8 +332,6 @@ copy /Y ..\bin\nppLogNulContentCorruptionIssue.xml .\zipped.package.releaseArm64
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\binarm64\"notepad++.exe" .\zipped.package.releaseArm64\
|
||||
If ErrorLevel 1 goto End
|
||||
copy /Y ..\src\toolbarIcons.xml .\zipped.package.releaseArm64\
|
||||
If ErrorLevel 1 goto End
|
||||
|
||||
|
||||
rem Plugins: Copy needed files into Notepad++ 32-bit package folders
|
||||
|
@ -149,16 +149,11 @@ Notepad_plus::Notepad_plus()
|
||||
|
||||
nppParam.setNativeLangSpeaker(&_nativeLangSpeaker);
|
||||
|
||||
TiXmlDocument *toolIconsDocRoot = nppParam.getCustomizedToolIcons();
|
||||
TiXmlDocument *toolButtonsDocRoot = nppParam.getCustomizedToolButtons();
|
||||
|
||||
if (toolIconsDocRoot)
|
||||
{
|
||||
_toolBar.initTheme(toolIconsDocRoot);
|
||||
}
|
||||
|
||||
if (toolButtonsDocRoot)
|
||||
{
|
||||
_toolBar.initTheme(toolButtonsDocRoot);
|
||||
_toolBar.initHideButtonsConf(toolButtonsDocRoot, toolBarIcons, sizeof(toolBarIcons) / sizeof(ToolBarButtonUnit));
|
||||
}
|
||||
|
||||
|
@ -520,7 +520,7 @@ namespace NppDarkMode
|
||||
return (lstrcmp(theme.c_str(), L"stylers.xml") == 0) ? L"" : theme;
|
||||
}
|
||||
|
||||
static bool g_isCustomToolIconUsed = NppParameters::getInstance().getCustomizedToolIcons() != nullptr;
|
||||
static bool g_isCustomToolIconUsed = NppParameters::getInstance().getCustomizedToolButtons() != nullptr;
|
||||
|
||||
void setToolBarIconSet(int state2Set, bool useDark)
|
||||
{
|
||||
|
@ -1483,21 +1483,6 @@ bool NppParameters::load()
|
||||
isAllLoaded = false;
|
||||
}
|
||||
|
||||
//---------------------------------//
|
||||
// toolbarIcons.xml : for per user //
|
||||
//---------------------------------//
|
||||
std::wstring toolbarIconsPath(_userPath);
|
||||
pathAppend(toolbarIconsPath, L"toolbarIcons.xml");
|
||||
|
||||
_pXmlToolIconsDoc = new TiXmlDocument(toolbarIconsPath);
|
||||
loadOkay = _pXmlToolIconsDoc->LoadFile();
|
||||
if (!loadOkay)
|
||||
{
|
||||
delete _pXmlToolIconsDoc;
|
||||
_pXmlToolIconsDoc = nullptr;
|
||||
isAllLoaded = false;
|
||||
}
|
||||
|
||||
//---------------------------------------//
|
||||
// toolbarButtonsConf.xml : for per user //
|
||||
//---------------------------------------//
|
||||
@ -1724,7 +1709,6 @@ void NppParameters::destroyInstance()
|
||||
}
|
||||
|
||||
delete _pXmlNativeLangDocA;
|
||||
delete _pXmlToolIconsDoc;
|
||||
delete _pXmlToolButtonsConfDoc;
|
||||
delete _pXmlShortcutDocA;
|
||||
delete _pXmlContextMenuDocA;
|
||||
|
@ -1632,7 +1632,6 @@ public:
|
||||
|
||||
TiXmlDocumentA * getNativeLangA() const {return _pXmlNativeLangDocA;};
|
||||
|
||||
TiXmlDocument* getCustomizedToolIcons() const {return _pXmlToolIconsDoc;};
|
||||
TiXmlDocument* getCustomizedToolButtons() const {return _pXmlToolButtonsConfDoc;};
|
||||
|
||||
bool isTransparentAvailable() const {
|
||||
@ -1877,7 +1876,6 @@ private:
|
||||
TiXmlDocument *_pXmlUserStylerDoc = nullptr; // stylers.xml
|
||||
TiXmlDocument *_pXmlUserLangDoc = nullptr; // userDefineLang.xml
|
||||
std::vector<UdlXmlFileState> _pXmlUserLangsDoc; // userDefineLang customized XMLs
|
||||
TiXmlDocument *_pXmlToolIconsDoc = nullptr; // toolbarIcons.xml
|
||||
TiXmlDocument * _pXmlToolButtonsConfDoc = nullptr; // toolbarButtonsConf.xml
|
||||
|
||||
TiXmlDocumentA *_pXmlShortcutDocA = nullptr; // shortcuts.xml
|
||||
|
@ -1,19 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<NotepadPlus>
|
||||
|
||||
<!--
|
||||
This file allows you to:
|
||||
1. Hide any toolbar buttons you don't need.
|
||||
2. Change the appearance of (replace) any or all toolbar icons.
|
||||
|
||||
To archieve one or both of above gaols, you need to move and rename the "toolbarButtonsConf_example.xml" to "%APPDATA%\Notepad++\toolbarButtonsConf.xml" (or place it beside "notepad++.exe" if you're using the portable package).
|
||||
Edit the relevant sections, save your change, and relaunch Notepad++ for the modifications to take effect.
|
||||
-->
|
||||
|
||||
<ToolbarButtons>
|
||||
<!--
|
||||
This file makes your toolbar buttons hideable.
|
||||
The "Standard" section allows your toolbar's standard buttons (come with Notepad++) to be hidden.
|
||||
|
||||
Usage:
|
||||
Move and rename the "toolbarButtonsConf_example.xml" to "%APPDATA%\Notepad++\toolbarButtonsConf.xml"
|
||||
(or beside "notepad++.exe" if you're using the portable package).
|
||||
Modify the attributes "hideAll" or "hide" of the items with "yes" or "no" values.
|
||||
Save the file and relaunch Notepad++ to hide/show the buttons you selected.
|
||||
Usage: Modify the "hideAll" or "hide" attributes of the items by settings their values to "yes" or "no".
|
||||
|
||||
Notice:
|
||||
1. The values of the attributes "index" and "id" shouldn't be modified because they are used for synchronizing with internal data to maintain the coherence of this file.
|
||||
2. The attribute "name" is informative only, so the values of "name" can be modified for the user's convenience.
|
||||
3. The "yes" value of the "hideAll" attribute will override all values of the "hide" attribute.
|
||||
1. The "index" and "id" attributes values must not be modified, as they are used to synchronize with internal data for maintaining the file's coherence.
|
||||
2. The "name" attribute is for informational purposes only, so its values can be modified for the user's convenience.
|
||||
3. Setting the "hideAll" attribute's value to "yes" will override all "hide" attribute values.
|
||||
-->
|
||||
<Standard hideAll="no">
|
||||
<Button hide="no" index="0" id="41001" name="New" />
|
||||
@ -61,7 +67,7 @@ Notice:
|
||||
<!--
|
||||
In this section we can hide toolbar buttons for installed plugins based on their order in the toolbar (including separators).
|
||||
"Name" attribute has no effect, use it as a reminder.
|
||||
When installing / uninstalling plugins, add/remove button entries as necessary so your button settings correspond to the changed toolbar button order.
|
||||
When installing/uninstalling plugins, add/remove button entries as necessary so your button settings correspond to the changed toolbar button order.
|
||||
-->
|
||||
<Plugin hideAll="no">
|
||||
<Button hide="no" name="SEPARATOR" /> <!-- The 1st button -->
|
||||
@ -73,4 +79,71 @@ When installing / uninstalling plugins, add/remove button entries as necessary s
|
||||
<!-- Add more "Button" tags here... -->
|
||||
</Plugin>
|
||||
</ToolbarButtons>
|
||||
|
||||
<!--
|
||||
The "ToolBarIcons" section (tag) is for customizing your toolbar icons, by using an alternative set of icons.
|
||||
|
||||
To override the current toolbar icons, you need 2 things: this file and your icons set.
|
||||
You can get a sample icons set here:
|
||||
https://notepad-plus-plus.org/assets/data/nppLegacyIconSet.zip
|
||||
|
||||
Instructions to customize your toolbar icons:
|
||||
|
||||
1. Create a new folder named "toolbarIcons" in the directory where "toolbarButtonsConf.xml" file is located.
|
||||
2. Edit the "icoFolderName" attribute value of "ToolBarIcons" tag in "toolbarButtonsConf.xml" file. Specify the name of the icon set you want in the "icoFolderName" attribute. For example: <ToolBarIcons icoFolderName="myAwesomeIcons" />.
|
||||
3. Navigate to the "toolbarIcons" folder and create a new folder named exactly as the icon set name you specified in the "icoFolderName" attribute.
|
||||
4. Place all your customized icons in the foder "[toolbarButtonsConf.xml's folder]\toolbarIcons\myAwesomeIcons\".
|
||||
5. Finally, relaunch Notepad++ to see your icon set replace the default icons.
|
||||
|
||||
Note: if the "icoFolderName" value is an empty string, the icons will be located in "[toolbarButtonsConf.xml's folder]\toolbarIcons\default\".
|
||||
|
||||
Replacing icons: Each icon (45 in total) has a fixed and specific name. Please ignore the empty room - they are the separators.
|
||||
Naming convention:
|
||||
|
||||
0 new.ico
|
||||
1 open.ico
|
||||
2 save.ico save_disabled.ico
|
||||
3 save-all.ico save-all_disabled.ico
|
||||
4 close.ico
|
||||
5 close-all.ico
|
||||
6 print.ico
|
||||
7
|
||||
8 cut.ico cut_disabled.ico
|
||||
9 copy.ico copy_disabled.ico
|
||||
10 paste.ico paste_disabled.ico
|
||||
11
|
||||
12 undo.ico undo_disabled.ico
|
||||
13 redo.ico redo_disabled.ico
|
||||
14
|
||||
15 find.ico
|
||||
16 replace.ico
|
||||
17
|
||||
18 zoom-in.ico
|
||||
19 zoom-out.ico
|
||||
20
|
||||
21 sync-vertical.ico
|
||||
22 sync-horizontal.ico
|
||||
23
|
||||
24 word-wrap.ico
|
||||
25 all-chars.ico
|
||||
26 indent-guide.ico
|
||||
27
|
||||
28 udl-dlg.ico
|
||||
29 doc-map.ico
|
||||
30 doc-list.ico
|
||||
31 function-list.ico
|
||||
32 folder-as-workspace.ico
|
||||
33
|
||||
34 monitoring.ico monitoring_disabled.ico
|
||||
35
|
||||
36 record.ico record_disabled.ico
|
||||
37 stop-record.ico stop-record_disabled.ico
|
||||
38 playback.ico playback_disabled.ico
|
||||
39 playback-multiple.ico playback-multiple_disabled.ico
|
||||
40 save-macro.ico save-macro_disabled.ico
|
||||
|
||||
It's not necessary to have a complete set of icons (45 icons). Any missing icons will simply remain unsubstituted.
|
||||
-->
|
||||
|
||||
<ToolBarIcons icoFolderName="" />
|
||||
</NotepadPlus>
|
@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
This file is for customizing your toolbar icons.
|
||||
|
||||
To override the current toolbar icons, you need 2 things: this file and your icons set.
|
||||
Here are the instructions to customize your toolbar icons:
|
||||
|
||||
1. Put this file ("toolbarIcons.xml") in the same folder as "config.xml" file (Note 1).
|
||||
2. Create a new folder "toolbarIcons" in the folder where you put "toolbarIcons.xml" file.
|
||||
3. Edit this file ("toolbarIcons.xml"): put the icon set name you want in "icoFolderName" attribute (Note 2).
|
||||
For example: <ToolBarIcons icoFolderName="myAwesomeIcons" />
|
||||
4. Go into "toolbarIcons" folder and create a new folder with the exact name of the icon set name you provided in "icoFolderName".
|
||||
5. Put all your customized icons into "[toolbarIcons.xml's folder]\toolbarIcons\myAwesomeIcons\".
|
||||
6. Now it's the magic moment: Relaunch Notepad++ and you'll see your icon set instead of the default icons.
|
||||
|
||||
Note:
|
||||
1. If you find the file "doLocalConf.xml" in the Notepad++ installed directory, you will find the "config.xml" in Notepad++ installed directory. Otherwise it should be in "%APPDATA%\Notepad++\" directory.
|
||||
2. if "icoFolderName" value is an empty string, the path of icons will be in "[toolbarIcons.xml's folder]\toolbarIcons\default\" folder.
|
||||
|
||||
Each replacing icon (45 icons) has the fixed and specific name:
|
||||
|
||||
1 new.ico
|
||||
2 open.ico
|
||||
3 save.ico save_disabled.ico
|
||||
4 save-all.ico save-all_disabled.ico
|
||||
5 close.ico
|
||||
6 close-all.ico
|
||||
7 print.ico
|
||||
8 cut.ico cut_disabled.ico
|
||||
9 copy.ico copy_disabled.ico
|
||||
10 paste.ico paste_disabled.ico
|
||||
11 undo.ico undo_disabled.ico
|
||||
12 redo.ico redo_disabled.ico
|
||||
13 find.ico
|
||||
14 replace.ico
|
||||
15 zoom-in.ico
|
||||
16 zoom-out.ico
|
||||
17 sync-vertical.ico
|
||||
18 sync-horizontal.ico
|
||||
19 word-wrap.ico
|
||||
20 all-chars.ico
|
||||
21 indent-guide.ico
|
||||
22 udl-dlg.ico
|
||||
23 doc-map.ico
|
||||
24 doc-list.ico
|
||||
25 function-list.ico
|
||||
26 folder-as-workspace.ico
|
||||
27 monitoring.ico monitoring_disabled.ico
|
||||
28 record.ico record_disabled.ico
|
||||
29 stop-record.ico stop-record_disabled.ico
|
||||
30 playback.ico playback_disabled.ico
|
||||
31 playback-multiple.ico playback-multiple_disabled.ico
|
||||
32 save-macro.ico save-macro_disabled.ico
|
||||
|
||||
It's not necessary to have all complete set (45 icons). The absent icons just won't be substituted.
|
||||
-->
|
||||
<NotepadPlus>
|
||||
<ToolBarIcons icoFolderName="" />
|
||||
</NotepadPlus>
|
Loading…
x
Reference in New Issue
Block a user