Skip to content

Commit

Permalink
+ add: Themes menu to load exported styles (e.g. "dark theme"
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiKoHoff committed Mar 14, 2019
1 parent 9c8df49 commit 5b8ca9d
Show file tree
Hide file tree
Showing 30 changed files with 306 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Versions/build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1653
1658
4 changes: 4 additions & 0 deletions language/common_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@
#define IDS_MUI_LANG_RU_RU 34514
#define IDS_MUI_LANG_ZH_CN 34515

#define IDS_MUI_MENU_THEMES 37000
#define IDM_THEMES_FILE_ITEM 37001
/// !!! dont use IDs until ...37100

#define IDM_FILE_NEW 40000
#define IDM_FILE_OPEN 40001
#define IDM_FILE_REVERT 40002
Expand Down
2 changes: 2 additions & 0 deletions language/np3_af_za/strings_af_za.rc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "Taal"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_be_by/strings_be_by.rc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "����"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_de_de/strings_de_de.rc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "Sprache"
IDS_MUI_MENU_THEMES "Farben"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_en_gb/strings_en_gb.rc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "Language"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_en_us/strings_en_us.rc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "Language"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_es_es/strings_es_es.rc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "&Idioma"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_fr_fr/strings_fr_fr.rc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "Langue"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_hu_hu/strings_hu_hu.rc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "Nyelv"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_it_it/strings_it_it.rc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "Lingua"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_ja_jp/strings_ja_jp.rc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "����"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_ko_kr/strings_ko_kr.rc
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "����"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_nl_nl/strings_nl_nl.rc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "Taal"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_pt_br/strings_pt_br.rc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "L�ngua"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_ru_ru/strings_ru_ru.rc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "����"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
2 changes: 2 additions & 0 deletions language/np3_zh_cn/strings_zh_cn.rc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ END
STRINGTABLE
BEGIN
IDS_MUI_MENU_LANGUAGE "����(&L)"
IDS_MUI_MENU_THEMES "Themes"
IDM_THEMES_FILE_ITEM "Standard"
END

STRINGTABLE
Expand Down
Binary file not shown.
5 changes: 4 additions & 1 deletion np3portableapp/build_np3portableapp.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ set PORTAPP_INSTALLER_CREATOR=%PORTAPP_ROOT_DIR%\PortableApps.comInstaller\Porta
set NP3_DISTRIB_DIR=%SCRIPT_DIR%..\Build
set NP3_DOC_DIR=%SCRIPT_DIR%..\doc
set NP3_THEMES_DIR=%SCRIPT_DIR%..\themes
set NP3_STYLE_SCHEME_DIR=%SCRIPT_DIR%..\themes\style_schemata
::set NP3_WIN32_DIR=%SCRIPT_DIR%..\Bin\Release_x86_v141
::set NP3_X64_DIR=%SCRIPT_DIR%..\Bin\Release_x64_v141
set NP3_WIN32_DIR=%SCRIPT_DIR%..\Bin\Release_x86_v142
Expand Down Expand Up @@ -108,10 +109,12 @@ copy /B "%NP3_WIN32_DIR%\minipath.exe" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x86\"
::copy /B "%NP3_DISTRIB_DIR%\Update\wyUpdate\86\wyUpdate.exe" /B "%NP3_PORTAPP_DIR%\App\Notepad3\" /Y /V

del /s /f /q "%NP3_PORTAPP_DIR%\App\themes\*.*"
for /f %%f in ('dir /ad /b c:\share\') do rd /s /q c:\share\%%f
for /f "delims=" %%d in ('dir /ad /b "%NP3_PORTAPP_DIR%\App\themes\"') do rmdir /s /q "%NP3_PORTAPP_DIR%\App\themes\%%d"
xcopy "%NP3_THEMES_DIR%" "%NP3_PORTAPP_DIR%\App\themes" /C /V /I /S /Y

del /s /f /q "%NP3_PORTAPP_DIR%\App\DefaultData\settings\themes\*.*"
xcopy "%NP3_STYLE_SCHEME_DIR%" "%NP3_PORTAPP_DIR%\App\DefaultData\settings\themes" /C /V /I /S /Y

for /d %%d in (%NP3_LANGUAGE_SET%) do (
mkdir "%NP3_PORTAPP_DIR%\App\Notepad3\x64\lng\%%d"
copy /B "%NP3_X64_DIR%\lng\%%d\*" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x64\lng\%%d\" /Y /V
Expand Down
2 changes: 1 addition & 1 deletion res/Notepad3.exe.manifest.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.19.309.1653"
version="5.19.314.1658"
type="win32"
/>
<description>Notepad3 XpErImEnTaL</description>
Expand Down
10 changes: 5 additions & 5 deletions src/Dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lPar

if (StringCchLenW(Globals.CurrentFile, MAX_PATH)) {
StringCchCopy(wchDirectory,COUNTOF(wchDirectory),Globals.CurrentFile);
PathRemoveFileSpec(wchDirectory);
PathCchRemoveFileSpec(wchDirectory, COUNTOF(wchDirectory));
}

SHELLEXECUTEINFO sei;
Expand Down Expand Up @@ -1086,7 +1086,7 @@ bool OpenWithDlg(HWND hwnd,LPCWSTR lpstrFile)

if (StringCchLenW(Globals.CurrentFile, MAX_PATH)) {
StringCchCopy(wchDirectory,COUNTOF(wchDirectory),Globals.CurrentFile);
PathRemoveFileSpec(wchDirectory);
PathCchRemoveFileSpec(wchDirectory, COUNTOF(wchDirectory));
}

SHELLEXECUTEINFO sei;
Expand Down Expand Up @@ -3211,7 +3211,7 @@ void DialogFileBrowse(HWND hwnd)
}
if (PathIsRelative(tchExeFile)) {
GetModuleFileName(NULL, tchTemp, COUNTOF(tchTemp));
PathRemoveFileSpec(tchTemp);
PathCchRemoveFileSpec(tchTemp, COUNTOF(tchTemp));
PathAppend(tchTemp, tchExeFile);
if (PathFileExists(tchTemp)) {
StringCchCopy(tchExeFile, COUNTOF(tchExeFile), tchTemp);
Expand Down Expand Up @@ -3261,7 +3261,7 @@ void DialogAdminExe(HWND hwnd, bool bExecInstaller)
if (!SearchPath(NULL, tchExe, L".exe", COUNTOF(tchExePath), tchExePath, NULL)) {
// try Notepad3's dir path
GetModuleFileName(NULL, tchExePath, COUNTOF(tchExePath));
PathRemoveFileSpec(tchExePath);
PathCchRemoveFileSpec(tchExePath, COUNTOF(tchExePath));
PathCchAppend(tchExePath, COUNTOF(tchExePath), tchExe);
}

Expand Down Expand Up @@ -3356,7 +3356,7 @@ bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool bIsElevated, UINT uIDUntitl
if (iFormat == 1) {
WCHAR tchPath[MAX_PATH] = { L'\0' };
StringCchCopyN(tchPath, COUNTOF(tchPath), lpszFile, StringCchLen(lpszFile, MAX_PATH));
PathRemoveFileSpec(tchPath);
PathCchRemoveFileSpec(tchPath, COUNTOF(tchPath));
StringCchCat(szTitle, COUNTOF(szTitle), L" [");
StringCchCat(szTitle, COUNTOF(szTitle), tchPath);
StringCchCat(szTitle, COUNTOF(szTitle), L"]");
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@ void PathAbsoluteFromApp(LPWSTR lpszSrc,LPWSTR lpszDest,int cchDest,bool bExpand

if (PathIsRelative(wchPath)) {
GetModuleFileName(NULL,wchResult,COUNTOF(wchResult));
PathCanonicalizeEx(wchResult,MAX_PATH);
PathRemoveFileSpec(wchResult);
PathCanonicalizeEx(wchResult, COUNTOF(wchResult));
PathCchRemoveFileSpec(wchResult, COUNTOF(wchResult));
PathCchAppend(wchResult,COUNTOF(wchResult),wchPath);
}
else
Expand Down
Loading

0 comments on commit 5b8ca9d

Please sign in to comment.