mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 22:04:55 +02:00
Add "Minimize / Close to" option for System tray
Fix #15771, close #15785
This commit is contained in:
parent
b8224808bd
commit
eeb4753044
@ -1317,6 +1317,7 @@ Translation note:
|
||||
<Element name="No action to"/>
|
||||
<Element name="Minimize to"/>
|
||||
<Element name="Close to"/>
|
||||
<Element name="Minimize / Close to"/>
|
||||
</ComboBox>
|
||||
<Item id="6308" name="system tray"/>
|
||||
<Item id="6312" name="File Status Auto-Detection"/>
|
||||
|
@ -1315,6 +1315,7 @@ Translation note:
|
||||
<Element name="No action to"/>
|
||||
<Element name="Minimize to"/>
|
||||
<Element name="Close to"/>
|
||||
<Element name="Minimize / Close to"/>
|
||||
</ComboBox>
|
||||
<Item id="6308" name="system tray"/>
|
||||
<Item id="6312" name="File Status Auto-Detection"/>
|
||||
|
@ -1326,6 +1326,7 @@ Translation note:
|
||||
<Element name="Bez akcji do"/>
|
||||
<Element name="Minimalizuj do"/>
|
||||
<Element name="Zamykaj do"/>
|
||||
<Element name="Minimalizuj / Zamykaj do"/>
|
||||
</ComboBox>
|
||||
<Item id="6308" name="zasobnika systemowego"/>
|
||||
<Item id="6312" name="Autowykrywanie stanu pliku"/>
|
||||
|
@ -453,7 +453,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
|
||||
_dockingManager.init(_pPublicInterface->getHinst(), hwnd, &_pMainWindow);
|
||||
|
||||
if ((nppGUI._isMinimizedToTray == sta_minimize || nppGUI._isMinimizedToTray == sta_close) && _pTrayIco == nullptr)
|
||||
if (nppGUI._isMinimizedToTray != sta_none && _pTrayIco == nullptr)
|
||||
{
|
||||
HICON icon = nullptr;
|
||||
Notepad_plus_Window::loadTrayIcon(_pPublicInterface->getHinst(), &icon);
|
||||
|
@ -2835,9 +2835,10 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
{
|
||||
const NppGUI & nppgui = (nppParam.getNppGUI());
|
||||
if (((nppgui._isMinimizedToTray == sta_minimize || _pPublicInterface->isPrelaunch()) && (wParam == SC_MINIMIZE)) ||
|
||||
(nppgui._isMinimizedToTray == sta_close && wParam == SC_CLOSE)
|
||||
const NppGUI & nppgui = nppParam.getNppGUI();
|
||||
auto toTray = nppgui._isMinimizedToTray;
|
||||
if (((toTray == sta_minimize || toTray == sta_minimize_close || _pPublicInterface->isPrelaunch()) && (wParam == SC_MINIMIZE)) ||
|
||||
((toTray == sta_close || toTray == sta_minimize_close) && wParam == SC_CLOSE)
|
||||
)
|
||||
{
|
||||
if (nullptr == _pTrayIco)
|
||||
|
@ -5037,6 +5037,8 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
|
||||
_nppGUI._isMinimizedToTray = sta_minimize;
|
||||
else if (lstrcmp(val, L"2") == 0)
|
||||
_nppGUI._isMinimizedToTray = sta_close;
|
||||
else if (lstrcmp(val, L"3") == 0)
|
||||
_nppGUI._isMinimizedToTray = sta_minimize_close;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ enum urlMode {urlDisable = 0, urlNoUnderLineFg, urlUnderLineFg, urlNoUnderLineBg
|
||||
urlMax = urlUnderLineBg};
|
||||
|
||||
enum AutoIndentMode { autoIndent_none = 0, autoIndent_advanced = 1, autoIndent_basic = 2 };
|
||||
enum SysTrayAction { sta_none = 0, sta_minimize = 1, sta_close = 2 };
|
||||
enum SysTrayAction { sta_none = 0, sta_minimize = 1, sta_close = 2, sta_minimize_close = 3 };
|
||||
|
||||
const int LANG_INDEX_INSTR = 0;
|
||||
const int LANG_INDEX_INSTR2 = 1;
|
||||
|
@ -2425,8 +2425,9 @@ intptr_t CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_SYSTRAY_ACTION_HOICE, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"No action to"));
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_SYSTRAY_ACTION_HOICE, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Minimize to"));
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_SYSTRAY_ACTION_HOICE, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Close to"));
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_SYSTRAY_ACTION_HOICE, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Minimize / Close to"));
|
||||
|
||||
if (nppGUI._isMinimizedToTray < 0 || nppGUI._isMinimizedToTray > sta_close)
|
||||
if (nppGUI._isMinimizedToTray < 0 || nppGUI._isMinimizedToTray > sta_minimize_close)
|
||||
nppGUI._isMinimizedToTray = sta_none;
|
||||
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_SYSTRAY_ACTION_HOICE, CB_SETCURSEL, nppGUI._isMinimizedToTray, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user