Fix Find dialog status text too left visual glitch

Text was visible but positioned too left. This visual glitch was accented in Windows 11 due to its rounding-wnd-corners effect.

Fix #16359, close #16415
This commit is contained in:
xomx 2025-04-12 11:26:35 +02:00 committed by Don Ho
parent b3b4782848
commit 17cdde3622
2 changed files with 15 additions and 6 deletions

View File

@ -4152,7 +4152,7 @@ void FindReplaceDlg::saveInMacro(size_t cmd, int cmdType)
::SendMessage(_hParent, WM_FRSAVE_INT, IDC_FRCOMMAND_EXEC, cmd); ::SendMessage(_hParent, WM_FRSAVE_INT, IDC_FRCOMMAND_EXEC, cmd);
} }
void FindReplaceDlg::setStatusbarMessage(const wstring & msg, FindStatus staus, const wstring& tooltipMsg) void FindReplaceDlg::setStatusbarMessage(const wstring & msg, FindStatus status, const wstring& tooltipMsg)
{ {
if (_statusbarTooltipWnd) if (_statusbarTooltipWnd)
{ {
@ -4162,7 +4162,7 @@ void FindReplaceDlg::setStatusbarMessage(const wstring & msg, FindStatus staus,
_statusbarTooltipMsg = tooltipMsg; _statusbarTooltipMsg = tooltipMsg;
if (staus == FSNotFound) if (status == FSNotFound)
{ {
if (!NppParameters::getInstance().getNppGUI()._muteSounds) if (!NppParameters::getInstance().getNppGUI()._muteSounds)
::MessageBeep(0xFFFFFFFF); ::MessageBeep(0xFFFFFFFF);
@ -4175,7 +4175,7 @@ void FindReplaceDlg::setStatusbarMessage(const wstring & msg, FindStatus staus,
flashInfo.dwFlags = FLASHW_ALL; flashInfo.dwFlags = FLASHW_ALL;
FlashWindowEx(&flashInfo); FlashWindowEx(&flashInfo);
} }
else if (staus == FSTopReached || staus == FSEndReached) else if (status == FSTopReached || status == FSEndReached)
{ {
if (!isVisible()) if (!isVisible())
{ {
@ -4191,8 +4191,17 @@ void FindReplaceDlg::setStatusbarMessage(const wstring & msg, FindStatus staus,
if (isVisible()) if (isVisible())
{ {
_statusbarFindStatus = staus; _statusbarFindStatus = status;
_statusBar.setOwnerDrawText(msg.c_str()); if ((msg.length() > 0) && (msg.at(0) != L' '))
{
// fix visual glitch (text is visible, but positioned too far to the left)
wstring msgSpaceIndented = L' ' + msg;
_statusBar.setOwnerDrawText(msgSpaceIndented.c_str());
}
else
{
_statusBar.setOwnerDrawText(msg.c_str());
}
} }
} }

View File

@ -405,7 +405,7 @@ public :
void execSavedCommand(int cmd, uptr_t intValue, const std::wstring& stringValue); void execSavedCommand(int cmd, uptr_t intValue, const std::wstring& stringValue);
void clearMarks(const FindOption& opt); void clearMarks(const FindOption& opt);
void setStatusbarMessage(const std::wstring & msg, FindStatus staus, const std::wstring& tooltipMsg = L""); void setStatusbarMessage(const std::wstring & msg, FindStatus status, const std::wstring& tooltipMsg = L"");
void setStatusbarMessageWithRegExprErr(ScintillaEditView* pEditView); void setStatusbarMessageWithRegExprErr(ScintillaEditView* pEditView);
std::wstring getScopeInfoForStatusBar(FindOption const *pFindOpt) const; std::wstring getScopeInfoForStatusBar(FindOption const *pFindOpt) const;
Finder * createFinder(); Finder * createFinder();