fix ws and some small logic simplification

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1136453
This commit is contained in:
Volker Lanz 2010-06-09 22:00:28 +00:00
parent 9d8796e83d
commit 083adc23fa
1 changed files with 6 additions and 5 deletions

View File

@ -109,20 +109,21 @@ void PartWidget::paintEvent(QPaintEvent*)
return;
}
const QColor base = activeColor(Config::fileSystemColorCode(partition()->fileSystem().type()));
if (!partition()->roles().has(PartitionRole::Unallocated))
{
QColor base( activeColor(Config::fileSystemColorCode(partition()->fileSystem().type())) );
QColor dark = base.darker( 110 );
QColor light = base.lighter( 110 );
const QColor dark = base.darker(110);
const QColor light = base.lighter(110);
// draw free space background
drawGradient(&painter, light, QRect(0, 0, width(), height()));
// draw used space in front of that
drawGradient(&painter, dark, QRect(0, 0, w, height()));
} else {
drawGradient(&painter, activeColor(Config::fileSystemColorCode(partition()->fileSystem().type())), QRect(0, 0, width(), height()));
}
else
drawGradient(&painter, base, QRect(0, 0, width(), height()));
// draw name and size
QString text = partition()->deviceNode().remove("/dev/") + '\n' + Capacity(*partition()).toString();