Remove wxTextCtrl::OnEnabled() hack from wxGTK.
Don't change the background colour when the control is being enabled or disabled, it doesn't seem necessary and it's unclear why was this added by r10179 in the first place. It does result in problems however as it could somehow make the selection of wxTextCtrl invisible when it lost focus and so fixes a serious usability problem which happened to all wxTextCtrls for which a wxEVT_UPDATE_UI handler using wxUpdateUIEvent::Enable() was defined. Closes #14898. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1341,26 +1341,6 @@ bool wxTextCtrl::Enable( bool enable )
|
||||
return true;
|
||||
}
|
||||
|
||||
// wxGTK-specific: called recursively by Enable,
|
||||
// to give widgets an opportunity to correct their colours after they
|
||||
// have been changed by Enable
|
||||
void wxTextCtrl::OnEnabled(bool WXUNUSED(enable))
|
||||
{
|
||||
// If we have a custom background colour, we use this colour in both
|
||||
// disabled and enabled mode, or we end up with a different colour under the
|
||||
// text.
|
||||
wxColour oldColour = GetBackgroundColour();
|
||||
if (oldColour.IsOk())
|
||||
{
|
||||
// Need to set twice or it'll optimize the useful stuff out
|
||||
if (oldColour == * wxWHITE)
|
||||
SetBackgroundColour(*wxBLACK);
|
||||
else
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
SetBackgroundColour(oldColour);
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextCtrl::MarkDirty()
|
||||
{
|
||||
m_modified = true;
|
||||
|
Reference in New Issue
Block a user