From 0070c7bdd514fa67c932264957ea79a71f73bf88 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Thu, 16 May 2019 08:15:12 +0200 Subject: [PATCH] Revert "+ add: textual (T) "Always On Top" indicator in title-bar" This reverts commit 2caef47609dfaff55f7623cb5b3ed54fe7782ec3. --- src/Dialogs.c | 18 +++++++----------- src/Dialogs.h | 3 +-- src/Notepad3.c | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/Dialogs.c b/src/Dialogs.c index 0325dbbda..787f335ec 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -3455,16 +3455,14 @@ void DialogAdminExe(HWND hwnd, bool bExecInstaller) // bool bFreezeAppTitle = false; -const WCHAR* const pszSep = L" - "; -const WCHAR* const pszMod = L"* "; -const WCHAR* const pszPin = L"(T) "; - +static const WCHAR *pszSep = L" - "; +static const WCHAR *pszMod = L"* "; static WCHAR szCachedFile[MAX_PATH] = { L'\0' }; static WCHAR szCachedDisplayName[MAX_PATH] = { L'\0' }; static WCHAR szAdditionalTitleInfo[MAX_PATH] = { L'\0' }; bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool bIsElevated, UINT uIDUntitled, - LPCWSTR lpszFile, int iFormat, bool bModified, bool bAlwaysOnTop, + LPCWSTR lpszFile, int iFormat, bool bModified, UINT uIDReadOnly, bool bReadOnly, LPCWSTR lpszExcerpt) { if (bFreezeAppTitle) @@ -3484,12 +3482,10 @@ bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool bIsElevated, UINT uIDUntitl WCHAR szTitle[MIDSZ_BUFFER] = { L'\0' }; - if (bAlwaysOnTop) { - StringCchCat(szTitle, COUNTOF(szTitle), pszPin); - } - if (bModified) { - StringCchCat(szTitle, COUNTOF(szTitle), pszMod); - } + if (bModified) + StringCchCopy(szTitle, COUNTOF(szTitle), pszMod); + else + StringCchCopy(szTitle, COUNTOF(szTitle), L""); if (StrIsNotEmpty(lpszExcerpt)) { WCHAR szExcrptFmt[32] = { L'\0' }; diff --git a/src/Dialogs.h b/src/Dialogs.h index 8b337d313..1360d55d1 100644 --- a/src/Dialogs.h +++ b/src/Dialogs.h @@ -52,8 +52,7 @@ int MessageBoxLng(UINT uType, UINT uIdMsg, ...); INT_PTR InfoBoxLng(UINT uType, LPCWSTR lpstrSetting, UINT uidMessage, ...); DWORD GetLastErrorToMsgBox(LPWSTR lpszFunction, DWORD dwErrID); -bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool, UINT uIDUntitled, LPCWSTR lpszFile, int iFormat, - bool bModified, bool bAlwaysOnTop, UINT uIDReadOnly, bool bReadOnly, LPCWSTR lpszExcerpt); +bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool, UINT uIDUntitled, LPCWSTR lpszFile, int iFormat, bool, UINT uIDReadOnly, bool, LPCWSTR lpszExcerpt); void SetAdditionalTitleInfo(LPCWSTR lpszAddTitleInfo); void SetWindowTransparentMode(HWND hwnd, bool bTransparentMode, int iOpacityLevel); void CenterDlgInParent(HWND hDlg); diff --git a/src/Notepad3.c b/src/Notepad3.c index 7fca6de3e..761b5e1eb 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -8474,7 +8474,7 @@ void UpdateToolbar() static void _UpdateToolbarDelayed() { SetWindowTitle(Globals.hwndMain, s_uidsAppTitle, s_bIsElevated, IDS_MUI_UNTITLED, Globals.CurrentFile, - Settings.PathNameFormat, IsSaveNeeded(ISN_GET), Settings.AlwaysOnTop, + Settings.PathNameFormat, IsSaveNeeded(ISN_GET), IDS_MUI_READONLY, s_bFileReadOnly, s_wchTitleExcerpt); if (!Settings.ShowToolbar) { return; }