mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-21 12:54:42 +02:00
Make theme portable
Fix 6518f3e4b8 (commitcomment-93601484)
Close #12671
This commit is contained in:
parent
58416114da
commit
f10753d2da
@ -228,11 +228,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
||||
|
||||
fileNames.clear();
|
||||
|
||||
generic_string nppThemeDir;
|
||||
if (!nppParams.isLocal())
|
||||
{
|
||||
nppThemeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
|
||||
}
|
||||
generic_string nppThemeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
|
||||
pathAppend(nppThemeDir, TEXT("themes\\"));
|
||||
|
||||
// Set theme directory to their installation directory
|
||||
|
@ -5607,7 +5607,22 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
|
||||
{
|
||||
const TCHAR *themePath = element->Attribute(TEXT("path"));
|
||||
if (themePath != NULL && themePath[0])
|
||||
_nppGUI._themeName.assign(themePath);
|
||||
{
|
||||
// for local/portable setup, only themefilename.xml is needed
|
||||
// ignore if cloud setting is used
|
||||
if (_isLocal && !_isCloud)
|
||||
{
|
||||
auto themeFileName = ::PathFindFileName(themePath);
|
||||
generic_string nppThemePath = _nppPath;
|
||||
pathAppend(nppThemePath, TEXT("themes\\"));
|
||||
pathAppend(nppThemePath, themeFileName);
|
||||
_nppGUI._themeName = nppThemePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
_nppGUI._themeName.assign(themePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (!lstrcmp(nm, TEXT("insertDateTime")))
|
||||
|
Loading…
x
Reference in New Issue
Block a user