diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 2c148ea9d..5a15aea21 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -1312,6 +1312,7 @@ Translation note: + @@ -1817,4 +1818,3 @@ If you select advanced mode but do not edit files in the aforementioned language - diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml index e16520e27..89c42d0ae 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -1311,6 +1311,7 @@ Translation note: + @@ -1816,4 +1817,3 @@ If you select advanced mode but do not edit files in the aforementioned language - diff --git a/PowerEditor/installer/nativeLang/polish.xml b/PowerEditor/installer/nativeLang/polish.xml index 20e660bb0..f10020bab 100644 --- a/PowerEditor/installer/nativeLang/polish.xml +++ b/PowerEditor/installer/nativeLang/polish.xml @@ -1314,6 +1314,7 @@ Translation note: + @@ -1807,4 +1808,3 @@ Kliknij na przycisk „?” po prawej aby otworzyć stronę z dokumentacją."/> - diff --git a/PowerEditor/installer/nativeLang/russian.xml b/PowerEditor/installer/nativeLang/russian.xml index 08a8a5239..a50e2e135 100644 --- a/PowerEditor/installer/nativeLang/russian.xml +++ b/PowerEditor/installer/nativeLang/russian.xml @@ -1268,8 +1268,6 @@ Updated to v8.7.0: - - diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index e86db0546..6eeb7f7a6 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1,4 +1,4 @@ -// This file is part of Notepad++ project +// This file is part of Notepad++ project // Copyright (C)2021 Don HO // This program is free software: you can redistribute it and/or modify @@ -448,7 +448,7 @@ LRESULT Notepad_plus::init(HWND hwnd) _dockingManager.init(_pPublicInterface->getHinst(), hwnd, &_pMainWindow); - if (nppGUI._isMinimizedToTray && _pTrayIco == nullptr) + if ((nppGUI._isMinimizedToTray || nppGUI._isClosedToTray) && _pTrayIco == nullptr) { HICON icon = nullptr; Notepad_plus_Window::loadTrayIcon(_pPublicInterface->getHinst(), &icon); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 4af757433..3df7cf16e 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1,4 +1,4 @@ -// This file is part of Notepad++ project +// This file is part of Notepad++ project // Copyright (C)2021 Don HO // This program is free software: you can redistribute it and/or modify @@ -2852,7 +2852,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case WM_SYSCOMMAND: { const NppGUI & nppgui = (nppParam.getNppGUI()); - if ((nppgui._isMinimizedToTray || _pPublicInterface->isPrelaunch()) && (wParam == SC_MINIMIZE)) + if (((nppgui._isMinimizedToTray || _pPublicInterface->isPrelaunch()) && (wParam == SC_MINIMIZE)) || + (nppgui._isClosedToTray && wParam == SC_CLOSE) + ) { if (nullptr == _pTrayIco) { diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index bd9be36a4..eb925aae5 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -5018,6 +5018,18 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) } } } + else if (!lstrcmp(nm, L"CloseToTray")) + { + TiXmlNode *n = childNode->FirstChild(); + if (n) + { + const wchar_t* val = n->Value(); + if (val) + { + _nppGUI._isClosedToTray = (lstrcmp(val, L"yes") == 0); + } + } + } else if (!lstrcmp(nm, L"RememberLastSession")) { TiXmlNode *n = childNode->FirstChild(); @@ -7382,6 +7394,11 @@ void NppParameters::createXmlTreeFromGUIParams() insertGUIConfigBoolNode(newGUIRoot, L"TrayIcon", _nppGUI._isMinimizedToTray); } + // no + { + insertGUIConfigBoolNode(newGUIRoot, L"CloseToTray", _nppGUI._isClosedToTray); + } + // yes { //insertGUIConfigBoolNode(newGUIRoot, L"MaintainIndent", _nppGUI._maintainIndent); diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 16f44da93..6c16b75fc 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -822,6 +822,7 @@ struct NppGUI final bool _isMaximized = false; bool _isMinimizedToTray = false; + bool _isClosedToTray = false; bool _rememberLastSession = true; // remember next session boolean will be written in the settings bool _keepSessionAbsentFileEntries = false; bool _isCmdlineNosessionActivated = false; // used for if -nosession is indicated on the launch time diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 9ee9fcdc9..05b83c95f 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -598,12 +598,13 @@ BEGIN // "Enable Notepad++ auto-updater" should be always the 1st item, because it'll be hidden if GUP.exe is absent CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,94,210,10 - CONTROL "Mute all sounds",IDC_CHECK_MUTE_SOUNDS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,37,109,190,10 - CONTROL "Autodetect character encoding",IDC_CHECK_DETECTENCODING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,124,217,10 - CONTROL "Minimize to system tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,139,217,10 - CONTROL "Show only filename in title bar",IDC_CHECK_SHORTTITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,154,217,10 - CONTROL "Use DirectWrite (May improve rendering special characters, need to restart Notepad++)",IDC_CHECK_DIRECTWRITE_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,169,377,10 - CONTROL "Enable Save All confirm dialog",IDC_CHECK_SAVEALLCONFIRM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,184,217,10 + CONTROL "Mute all sounds",IDC_CHECK_MUTE_SOUNDS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,37,108,190,10 + CONTROL "Autodetect character encoding",IDC_CHECK_DETECTENCODING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,122,217,10 + CONTROL "Minimize to system tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,136,217,10 + CONTROL "Close to system tray",IDC_CHECK_CLOSE2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,150,217,10 + CONTROL "Show only filename in title bar",IDC_CHECK_SHORTTITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,164,217,10 + CONTROL "Use DirectWrite (May improve rendering special characters, need to restart Notepad++)",IDC_CHECK_DIRECTWRITE_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,178,377,10 + CONTROL "Enable Save All confirm dialog",IDC_CHECK_SAVEALLCONFIRM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,192,217,10 RTEXT "Session file ext.:",IDC_SESSIONFILEEXT_STATIC,270,130,108,8 EDITTEXT IDC_EDIT_SESSIONFILEEXT,380,127,34,12,ES_AUTOHSCROLL diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 49c38febf..af598d3d5 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -2417,6 +2417,7 @@ intptr_t CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) ::SendDlgItemMessage(_hSelf, IDC_CHECK_UPDATEGOTOEOF, BM_SETCHECK, bCheck ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_MIN2SYSTRAY, BM_SETCHECK, nppGUI._isMinimizedToTray, 0); + ::SendDlgItemMessage(_hSelf, IDC_CHECK_CLOSE2SYSTRAY, BM_SETCHECK, nppGUI._isClosedToTray, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_DETECTENCODING, BM_SETCHECK, nppGUI._detectEncoding, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_SAVEALLCONFIRM, BM_SETCHECK, nppGUI._saveAllConfirm, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_AUTOUPDATE, BM_SETCHECK, nppGUI._autoUpdateOpt._doAutoUpdate, 0); @@ -2522,6 +2523,10 @@ intptr_t CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) nppGUI._isMinimizedToTray = isCheckedOrNot(static_cast(wParam)); return TRUE; + case IDC_CHECK_CLOSE2SYSTRAY: + nppGUI._isClosedToTray = isCheckedOrNot(static_cast(wParam)); + return TRUE; + case IDC_CHECK_DETECTENCODING: nppGUI._detectEncoding = isCheckedOrNot(static_cast(wParam)); return TRUE; diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index 920e278bd..372ae6eb0 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -265,6 +265,7 @@ #define IDC_SMARTHILITEMATCHING_STATIC (IDD_PREFERENCE_SUB_MISC + 54) #define IDC_CHECK_MUTE_SOUNDS (IDD_PREFERENCE_SUB_MISC + 60) #define IDC_CHECK_SAVEALLCONFIRM (IDD_PREFERENCE_SUB_MISC + 61) + #define IDC_CHECK_CLOSE2SYSTRAY (IDD_PREFERENCE_SUB_MISC + 62) #define IDD_PREFERENCE_SUB_NEWDOCUMENT 6400 //(IDD_PREFERENCE_BOX + 400) #define IDC_FORMAT_GB_STATIC (IDD_PREFERENCE_SUB_NEWDOCUMENT + 1)