ListView: alternating row colors removed. Adding sample variations bits
for animations makes the code too messy for the value of this feature.
This commit is contained in:
parent
946bac677d
commit
95a8809979
@ -1054,18 +1054,11 @@ void Editor::setupListView()
|
||||
setPadding( Q::Cell, QskMargins( 4, 8 ) );
|
||||
|
||||
setColor( Q::Text, m_pal.themeForeground );
|
||||
|
||||
// alternating row colors
|
||||
setColor( Q::Cell | A::Lower, Qt::white );
|
||||
setColor( Q::Cell | A::Upper, m_pal.contrasted );
|
||||
setColor( Q::Cell, Qt::white );
|
||||
|
||||
for ( auto state : { A::NoState, Q::Hovered, Q::Pressed } )
|
||||
{
|
||||
const auto aspect = Q::Cell | state | Q::Selected;
|
||||
|
||||
setColor( aspect | A::Lower, m_pal.highlighted );
|
||||
setColor( aspect | A::Upper, m_pal.highlighted );
|
||||
|
||||
setColor( Q::Cell | state | Q::Selected, m_pal.highlighted );
|
||||
setColor( Q::Text | state | Q::Selected, m_pal.highlightedText );
|
||||
}
|
||||
}
|
||||
|
@ -196,7 +196,6 @@ void QskListViewSkinlet::updateBackgroundNodes(
|
||||
const QskListView* listView, QSGNode* backgroundNode ) const
|
||||
{
|
||||
using Q = QskListView;
|
||||
using A = QskAspect;
|
||||
|
||||
auto listViewNode = static_cast< const ListViewNode* >( backgroundNode->parent() );
|
||||
|
||||
@ -209,10 +208,7 @@ void QskListViewSkinlet::updateBackgroundNodes(
|
||||
|
||||
const auto rect = sampleRect( listView, listView->contentsRect(), Q::Cell, row );
|
||||
|
||||
const QskAspect aspect = Q::Cell | ( ( row % 2 ) ? A::Upper : A::Lower );
|
||||
const auto boxHints = listView->boxHints( aspect );
|
||||
|
||||
auto newNode = updateBoxNode( listView, rowNode, rect, boxHints );
|
||||
auto newNode = updateBoxNode( listView, rowNode, rect, Q::Cell );
|
||||
if ( newNode )
|
||||
{
|
||||
if ( newNode->parent() != backgroundNode )
|
||||
|
Loading…
x
Reference in New Issue
Block a user