Use correct palette in new partition dialog.
This commit is contained in:
parent
9065882da4
commit
ae1fa0e48b
@ -105,21 +105,27 @@ colorForPartition( Partition* partition )
|
|||||||
return PARTITION_COLORS[ colorIdx % NUM_PARTITION_COLORS ];
|
return PARTITION_COLORS[ colorIdx % NUM_PARTITION_COLORS ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QColor
|
QColor
|
||||||
colorForPartitionInFreeSpace( Partition* partition )
|
colorForPartitionInFreeSpace( Partition* partition )
|
||||||
{
|
{
|
||||||
//FIXME
|
PartitionNode* parent = _findRootForPartition( partition );
|
||||||
PartitionNode* parent = partition->parent();
|
PartitionTable* table = dynamic_cast< PartitionTable* >( parent );
|
||||||
Q_ASSERT( parent );
|
Q_ASSERT( table );
|
||||||
int colorIdx = 0;
|
int newColorIdx = 0;
|
||||||
for ( auto child : parent->children() )
|
for ( PartitionIterator it = PartitionIterator::begin( table );
|
||||||
|
it != PartitionIterator::end( table );
|
||||||
|
++it )
|
||||||
{
|
{
|
||||||
|
Partition* child = *it;
|
||||||
if ( child == partition )
|
if ( child == partition )
|
||||||
break;
|
break;
|
||||||
if ( !PMUtils::isPartitionFreeSpace( child ) )
|
if ( !PMUtils::isPartitionFreeSpace( child ) &&
|
||||||
++colorIdx;
|
!child->hasChildren() &&
|
||||||
|
PMUtils::isPartitionNew( child ) )
|
||||||
|
++newColorIdx;
|
||||||
}
|
}
|
||||||
return PARTITION_COLORS[ colorIdx % NUM_PARTITION_COLORS ];
|
return NEW_PARTITION_COLORS[ newColorIdx % NUM_NEW_PARTITION_COLORS ];
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user