mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 14:54:39 +02:00
Fix -notabbar & asNotepad.xml stop hiding tabbar regression (from v8.7.9)
The regression is due to the refactoring of tabbar:
ff734af115
Fix #16794, close #16825
This commit is contained in:
parent
f897972070
commit
0d98bd24f1
@ -159,7 +159,8 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const wchar_t *cmdL
|
|||||||
if (cmdLineParams->_isNoTab)
|
if (cmdLineParams->_isNoTab)
|
||||||
{
|
{
|
||||||
// Restore old settings when tab bar has been hidden from tab bar.
|
// Restore old settings when tab bar has been hidden from tab bar.
|
||||||
nppGUI._tabStatus = tabStatusOld;
|
if (!(tabStatusOld & TAB_HIDE))
|
||||||
|
nppGUI._forceTabbarVisible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7364,7 +7364,14 @@ void NppParameters::createXmlTreeFromGUIParams()
|
|||||||
pStr = (_nppGUI._tabStatus & TAB_MULTILINE) ? L"yes" : L"no";
|
pStr = (_nppGUI._tabStatus & TAB_MULTILINE) ? L"yes" : L"no";
|
||||||
GUIConfigElement->SetAttribute(L"multiLine", pStr);
|
GUIConfigElement->SetAttribute(L"multiLine", pStr);
|
||||||
|
|
||||||
pStr = (_nppGUI._tabStatus & TAB_HIDE) ? L"yes" : L"no";
|
if (_nppGUI._forceTabbarVisible)
|
||||||
|
{
|
||||||
|
pStr = L"no";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pStr = (_nppGUI._tabStatus & TAB_HIDE) ? L"yes" : L"no";
|
||||||
|
}
|
||||||
GUIConfigElement->SetAttribute(L"hide", pStr);
|
GUIConfigElement->SetAttribute(L"hide", pStr);
|
||||||
|
|
||||||
pStr = (_nppGUI._tabStatus & TAB_QUITONEMPTY) ? L"yes" : L"no";
|
pStr = (_nppGUI._tabStatus & TAB_QUITONEMPTY) ? L"yes" : L"no";
|
||||||
|
@ -848,6 +848,7 @@ struct NppGUI final
|
|||||||
bool _menuBarShow = true;
|
bool _menuBarShow = true;
|
||||||
|
|
||||||
int _tabStatus = (TAB_DRAWTOPBAR | TAB_DRAWINACTIVETAB | TAB_DRAGNDROP | TAB_REDUCE | TAB_CLOSEBUTTON | TAB_PINBUTTON);
|
int _tabStatus = (TAB_DRAWTOPBAR | TAB_DRAWINACTIVETAB | TAB_DRAGNDROP | TAB_REDUCE | TAB_CLOSEBUTTON | TAB_PINBUTTON);
|
||||||
|
bool _forceTabbarVisible = false;
|
||||||
|
|
||||||
bool _splitterPos = POS_VERTICAL;
|
bool _splitterPos = POS_VERTICAL;
|
||||||
int _userDefineDlgStatus = UDD_DOCKED;
|
int _userDefineDlgStatus = UDD_DOCKED;
|
||||||
|
@ -1260,6 +1260,12 @@ intptr_t CALLBACK TabbarSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
|||||||
|
|
||||||
::SendMessage(::GetParent(_hParent), WM_SIZE, 0, 0);
|
::SendMessage(::GetParent(_hParent), WM_SIZE, 0, 0);
|
||||||
|
|
||||||
|
// At startup, if "-notabbar" or "asNotepad.xml" is used, and tab bar was not hidden in the previous session,
|
||||||
|
// we force tab bar visible in the next session by setting _forceTabbarVisible to true.
|
||||||
|
// However, if "Hide tab bar" option is changed manually by user, then we don't force tab bar visible for the next session,
|
||||||
|
// and apply user's choice instead.
|
||||||
|
nppGUI._forceTabbarVisible = false;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user