diff --git a/src/modules/partition/gui/PartitionBarsView.cpp b/src/modules/partition/gui/PartitionBarsView.cpp index 92bfe53be..a0e27cd88 100644 --- a/src/modules/partition/gui/PartitionBarsView.cpp +++ b/src/modules/partition/gui/PartitionBarsView.cpp @@ -474,6 +474,19 @@ PartitionBarsView::computeItemsVector( const QModelIndex& parent ) const items[ row ] = { size, index }; } - return qMakePair( items, total ); + // The sizes we have are perfect, but now we have to hardcode a minimum size for small + // partitions and compensate for it in the total. + qreal adjustedTotal = total; + for ( int row = 0; row < count; ++row ) + { + if ( items[ row ].size < 0.01 * total ) // if this item is smaller than 5% of everything + { + adjustedTotal -= items[ row ].size; + items[ row ].size = qRound( 0.01 * total ); + adjustedTotal += items[ row ].size; + } + } + + return qMakePair( items, adjustedTotal ); }