Support background colour in wxDataViewItemAttr in wxGTK

The code handling background colour was commented out for some reason, simply
enable it as it seems to be working just fine -- and update the sample to show
that it does.
This commit is contained in:
Vadim Zeitlin 2016-03-22 17:49:49 +01:00
parent a20183440b
commit 1bbc44daff
3 changed files with 3 additions and 3 deletions

View File

@ -71,6 +71,7 @@ All (GUI):
wxGTK: wxGTK:
- Implement setting link colours in wxHyperlinkCtrl for GTK+3 (Hanmac). - Implement setting link colours in wxHyperlinkCtrl for GTK+3 (Hanmac).
- Support background colour in wxDataViewCtrl attributes.
wxMSW: wxMSW:

View File

@ -470,7 +470,8 @@ bool MyListModel::GetAttrByRow( unsigned int row, unsigned int col,
case Col_IconText: case Col_IconText:
if ( !(row % 2) ) if ( !(row % 2) )
return false; return false;
attr.SetColour(*wxLIGHT_GREY); attr.SetColour(*wxYELLOW);
attr.SetBackgroundColour(*wxLIGHT_GREY);
break; break;
case Col_TextWithAttr: case Col_TextWithAttr:

View File

@ -2248,7 +2248,6 @@ void GtkApplyAttr(GtkCellRendererText *renderer, const wxDataViewItemAttr& attr)
g_value_unset( &gvalue ); g_value_unset( &gvalue );
} }
#if 0
if (attr.HasBackgroundColour()) if (attr.HasBackgroundColour())
{ {
wxColour colour = attr.GetBackgroundColour(); wxColour colour = attr.GetBackgroundColour();
@ -2268,7 +2267,6 @@ void GtkApplyAttr(GtkCellRendererText *renderer, const wxDataViewItemAttr& attr)
g_object_set_property( G_OBJECT(renderer), "cell-background-set", &gvalue ); g_object_set_property( G_OBJECT(renderer), "cell-background-set", &gvalue );
g_value_unset( &gvalue ); g_value_unset( &gvalue );
} }
#endif
} }
} // anonymous namespace } // anonymous namespace