mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-18 01:19:45 +08:00
Fix wxTextCtrl border switching from dark mode
Do not check dark mode in wxTextCtrl::CanApplyThemeBorder(). Instead, improve the checking for themed border drawing in the WM_NCPAINT handler. This fixed the border appearance after switching from dark mode to the light one. Closes #26794.
This commit is contained in:
committed by
Vadim Zeitlin
parent
17e670dd60
commit
4227d13440
@@ -496,8 +496,8 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
||||
// returns true if the platform should explicitly apply a theme border
|
||||
bool wxTextCtrl::CanApplyThemeBorder() const
|
||||
{
|
||||
// Standard text control already handles theming in light mode.
|
||||
return IsRich() || wxMSWDarkMode::IsActive();
|
||||
// Standard text control already handles theming.
|
||||
return IsRich();
|
||||
}
|
||||
|
||||
bool wxTextCtrl::MSWCreateText(const wxString& value,
|
||||
|
||||
+3
-2
@@ -3836,7 +3836,8 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
|
||||
{
|
||||
// Determine whether we should draw a border.
|
||||
bool drawBorder = false;
|
||||
wxBorder border = DoTranslateBorder(GetBorder());
|
||||
wxBorder rawBorder = GetBorder();
|
||||
wxBorder border = DoTranslateBorder(rawBorder);
|
||||
switch ( border )
|
||||
{
|
||||
case wxBORDER_THEME:
|
||||
@@ -3882,7 +3883,7 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
|
||||
rcClient.right, rcClient.bottom);
|
||||
|
||||
// Draw the border.
|
||||
if ( border == wxBORDER_THEME )
|
||||
if ( rawBorder == wxBORDER_THEME )
|
||||
MSWDrawThemeBorder(hdc);
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user