mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 01:45:36 -04:00
Showing a tooltip on hover in Partition Labels
Tooltip has partition path, file system type, size of partition
This commit is contained in:
parent
6cd8e089d8
commit
66d378d338
1 changed files with 20 additions and 0 deletions
|
@ -159,6 +159,26 @@ PartitionModel::data( const QModelIndex& index, int role ) const
|
|||
return ColorUtils::colorForPartition( partition );
|
||||
else
|
||||
return QVariant();
|
||||
case Qt::ToolTipRole:
|
||||
{
|
||||
int col = index.column();
|
||||
QString name;
|
||||
if ( col == NameColumn )
|
||||
{
|
||||
if ( KPMHelpers::isPartitionFreeSpace( partition ) )
|
||||
name = tr( "Free Space" );
|
||||
else
|
||||
{
|
||||
name = KPMHelpers::isPartitionNew( partition )
|
||||
? tr( "New partition" )
|
||||
: partition->partitionPath();
|
||||
}
|
||||
}
|
||||
QString prettyFileSystem = KPMHelpers::prettyNameForFileSystemType( partition->fileSystem().type() );
|
||||
qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize();
|
||||
QString prettySize = KFormat().formatByteSize( size );
|
||||
return QVariant(name + " " + prettyFileSystem + " " + prettySize);
|
||||
}
|
||||
case SizeRole:
|
||||
return ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize();
|
||||
case IsFreeSpaceRole:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue