From d3f4ced8c09ac12049194860f04b09ac26260a4b Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Fri, 24 Apr 2015 18:09:11 +0200 Subject: [PATCH] Use a separate palette for newly created partitions. --- src/modules/partition/core/ColorUtils.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/modules/partition/core/ColorUtils.cpp b/src/modules/partition/core/ColorUtils.cpp index 61559f4f4..4c099f363 100644 --- a/src/modules/partition/core/ColorUtils.cpp +++ b/src/modules/partition/core/ColorUtils.cpp @@ -29,6 +29,7 @@ #include static const int NUM_PARTITION_COLORS = 5; +static const int NUM_NEW_PARTITION_COLORS = 4; //Let's try to use the Breeze palette static QColor PARTITION_COLORS[ NUM_PARTITION_COLORS ] = { @@ -38,6 +39,13 @@ static QColor PARTITION_COLORS[ NUM_PARTITION_COLORS ] = "#3daee9", //Plasma Blue "#9b59b6", //Purple }; +static QColor NEW_PARTITION_COLORS[ NUM_NEW_PARTITION_COLORS ] = +{ + "#c0392b", //Dark Icon Red + "#f39c1f", //Dark Icon Yellow + "#f1b7bc", //Light Salmon + "#fed999", //Light Orange +}; static QColor FREE_SPACE_COLOR = "#777777"; static QColor EXTENDED_COLOR = "#aaaaaa"; @@ -74,6 +82,7 @@ colorForPartition( Partition* partition ) PartitionTable* table = dynamic_cast< PartitionTable* >( parent ); Q_ASSERT( table ); int colorIdx = 0; + int newColorIdx = 0; for ( PartitionIterator it = PartitionIterator::begin( table ); it != PartitionIterator::end( table ); ++it ) @@ -84,13 +93,19 @@ colorForPartition( Partition* partition ) if ( !PMUtils::isPartitionFreeSpace( child ) && !child->hasChildren() ) ++colorIdx; + if ( PMUtils::isPartitionNew( child ) ) + ++newColorIdx; } + + if ( PMUtils::isPartitionNew( partition ) ) + return NEW_PARTITION_COLORS[ newColorIdx % NUM_NEW_PARTITION_COLORS ]; return PARTITION_COLORS[ colorIdx % NUM_PARTITION_COLORS ]; } QColor colorForPartitionInFreeSpace( Partition* partition ) { + //FIXME PartitionNode* parent = partition->parent(); Q_ASSERT( parent ); int colorIdx = 0;