correct painting of the items with custom colours in TVIS_DROPHILITED state (patch 1491478)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2693,9 +2693,15 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
|
|
||||||
wxTreeItemAttr * const attr = it->second;
|
wxTreeItemAttr * const attr = it->second;
|
||||||
|
|
||||||
|
wxTreeViewItem tvItem((void *)nmcd.dwItemSpec,
|
||||||
|
TVIF_STATE, TVIS_DROPHILITED);
|
||||||
|
DoGetItem(&tvItem);
|
||||||
|
const UINT tvItemState = tvItem.state;
|
||||||
|
|
||||||
// selection colours should override ours,
|
// selection colours should override ours,
|
||||||
// otherwise it is too confusing ot the user
|
// otherwise it is too confusing to the user
|
||||||
if ( !(nmcd.uItemState & CDIS_SELECTED) )
|
if ( !(nmcd.uItemState & CDIS_SELECTED) &&
|
||||||
|
!(tvItemState & TVIS_DROPHILITED) )
|
||||||
{
|
{
|
||||||
wxColour colBack;
|
wxColour colBack;
|
||||||
if ( attr->HasBackgroundColour() )
|
if ( attr->HasBackgroundColour() )
|
||||||
@@ -2709,8 +2715,9 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
// colour when we don't have focus (we can't keep
|
// colour when we don't have focus (we can't keep
|
||||||
// it when we do, it would usually be unreadable on
|
// it when we do, it would usually be unreadable on
|
||||||
// the almost inverted bg colour...)
|
// the almost inverted bg colour...)
|
||||||
if ( !(nmcd.uItemState & CDIS_SELECTED) ||
|
if ( ( !(nmcd.uItemState & CDIS_SELECTED) ||
|
||||||
FindFocus() != this )
|
FindFocus() != this ) &&
|
||||||
|
!(tvItemState & TVIS_DROPHILITED) )
|
||||||
{
|
{
|
||||||
wxColour colText;
|
wxColour colText;
|
||||||
if ( attr->HasTextColour() )
|
if ( attr->HasTextColour() )
|
||||||
|
Reference in New Issue
Block a user