mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
Draw nested partition enable/disable support in Splitter widget.
This commit is contained in:
parent
aaeb28e45e
commit
65f5da5a8d
2 changed files with 18 additions and 7 deletions
|
@ -54,8 +54,9 @@ PartitionSplitterWidget::PartitionSplitterWidget( QWidget* parent )
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionSplitterWidget::init( Device* dev )
|
PartitionSplitterWidget::init( Device* dev, bool drawNestedPartitions )
|
||||||
{
|
{
|
||||||
|
m_drawNestedPartitions = drawNestedPartitions;
|
||||||
QList< PartitionSplitterItem > allPartitionItems;
|
QList< PartitionSplitterItem > allPartitionItems;
|
||||||
PartitionSplitterItem* extendedPartitionItem = nullptr;
|
PartitionSplitterItem* extendedPartitionItem = nullptr;
|
||||||
for ( auto it = PartitionIterator::begin( dev );
|
for ( auto it = PartitionIterator::begin( dev );
|
||||||
|
@ -69,6 +70,8 @@ PartitionSplitterWidget::init( Device* dev )
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ( drawNestedPartitions )
|
||||||
|
{
|
||||||
if ( ( *it )->roles().has( PartitionRole::Logical ) && extendedPartitionItem )
|
if ( ( *it )->roles().has( PartitionRole::Logical ) && extendedPartitionItem )
|
||||||
extendedPartitionItem->children.append( newItem );
|
extendedPartitionItem->children.append( newItem );
|
||||||
else
|
else
|
||||||
|
@ -78,6 +81,12 @@ PartitionSplitterWidget::init( Device* dev )
|
||||||
extendedPartitionItem = &allPartitionItems.last();
|
extendedPartitionItem = &allPartitionItems.last();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !( *it )->roles().has( PartitionRole::Extended ) )
|
||||||
|
allPartitionItems.append( newItem );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setupItems( allPartitionItems );
|
setupItems( allPartitionItems );
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ class PartitionSplitterWidget : public QWidget
|
||||||
public:
|
public:
|
||||||
explicit PartitionSplitterWidget( QWidget* parent = nullptr );
|
explicit PartitionSplitterWidget( QWidget* parent = nullptr );
|
||||||
|
|
||||||
void init( Device* dev );
|
void init( Device* dev, bool drawNestedPartitions );
|
||||||
|
|
||||||
void setSplitPartition( const QString& path,
|
void setSplitPartition( const QString& path,
|
||||||
qint64 minSize,
|
qint64 minSize,
|
||||||
|
@ -90,6 +90,8 @@ private:
|
||||||
int m_resizeHandleX;
|
int m_resizeHandleX;
|
||||||
|
|
||||||
const int HANDLE_SNAP;
|
const int HANDLE_SNAP;
|
||||||
|
|
||||||
|
bool m_drawNestedPartitions;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PARTITIONSPLITTERWIDGET_H
|
#endif // PARTITIONSPLITTERWIDGET_H
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue