Use wxClientDC::CanBeUsedForDrawing() in wxSplitterWindow
No real changes, just simplify the code by using the just added wxClientDC function instead of reproducing its logic here.
This commit is contained in:
parent
24fd54ed31
commit
298fef23ad
1 changed files with 4 additions and 17 deletions
|
|
@ -74,25 +74,12 @@ static bool IsLive(wxSplitterWindow* wnd)
|
|||
// with wxSP_LIVE_UPDATE style the splitter windows are always resized
|
||||
// following the mouse movement while it drags the sash, without it we only
|
||||
// draw the sash at the new position but only resize the windows when the
|
||||
// dragging is finished
|
||||
#if defined( __WXMAC__ ) && defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX == 1
|
||||
return true; // Mac can't paint outside paint event - always need live mode
|
||||
#else
|
||||
// wxClientDC doesn't work with Wayland either, so check if we're using it.
|
||||
#if defined(__WXGTK3__) && defined(__UNIX__)
|
||||
switch ( wxGetDisplayInfo().type )
|
||||
{
|
||||
case wxDisplayNone:
|
||||
case wxDisplayX11:
|
||||
break;
|
||||
|
||||
case wxDisplayWayland:
|
||||
return true;
|
||||
}
|
||||
#endif // wxGTK3
|
||||
// dragging is finished -- but drawing the sash is done using wxClientDC,
|
||||
// so check if we can use it and always use live resizing if we can't
|
||||
if ( !wxClientDC::CanBeUsedForDrawing(wnd) )
|
||||
return true;
|
||||
|
||||
return wnd->HasFlag(wxSP_LIVE_UPDATE);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxSplitterWindow::Create(wxWindow *parent, wxWindowID id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue