Allow hiding extended partition in Labels view.
This commit is contained in:
parent
93bebfd3e4
commit
b374404c6f
@ -164,7 +164,9 @@ PartitionLabelsView::getIndexesToDraw( const QModelIndex& parent ) const
|
|||||||
index.data( PartitionModel::SizeRole ).toLongLong() < maxHiddenB )
|
index.data( PartitionModel::SizeRole ).toLongLong() < maxHiddenB )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if ( !modl->hasChildren( index ) || !m_extendedPartitionHidden )
|
||||||
list.append( index );
|
list.append( index );
|
||||||
|
|
||||||
if ( modl->hasChildren( index ) )
|
if ( modl->hasChildren( index ) )
|
||||||
list.append( getIndexesToDraw( index ) );
|
list.append( getIndexesToDraw( index ) );
|
||||||
}
|
}
|
||||||
@ -514,6 +516,13 @@ PartitionLabelsView::setSelectionFilter( SelectionFilter canBeSelected )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PartitionLabelsView::setExtendedPartitionHidden( bool hidden )
|
||||||
|
{
|
||||||
|
m_extendedPartitionHidden = hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QModelIndex
|
QModelIndex
|
||||||
PartitionLabelsView::moveCursor( CursorAction cursorAction, Qt::KeyboardModifiers modifiers )
|
PartitionLabelsView::moveCursor( CursorAction cursorAction, Qt::KeyboardModifiers modifiers )
|
||||||
{
|
{
|
||||||
|
@ -55,6 +55,8 @@ public:
|
|||||||
|
|
||||||
void setSelectionFilter( SelectionFilter canBeSelected );
|
void setSelectionFilter( SelectionFilter canBeSelected );
|
||||||
|
|
||||||
|
void setExtendedPartitionHidden( bool hidden );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// QAbstractItemView API
|
// QAbstractItemView API
|
||||||
QRegion visualRegionForSelection( const QItemSelection& selection ) const override;
|
QRegion visualRegionForSelection( const QItemSelection& selection ) const override;
|
||||||
@ -82,6 +84,7 @@ private:
|
|||||||
QStringList buildTexts( const QModelIndex& index ) const;
|
QStringList buildTexts( const QModelIndex& index ) const;
|
||||||
|
|
||||||
SelectionFilter canBeSelected;
|
SelectionFilter canBeSelected;
|
||||||
|
bool m_extendedPartitionHidden;
|
||||||
|
|
||||||
QString m_customNewRootLabel;
|
QString m_customNewRootLabel;
|
||||||
QPersistentModelIndex m_hoveredIndex;
|
QPersistentModelIndex m_hoveredIndex;
|
||||||
|
Loading…
Reference in New Issue
Block a user