mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 09:25:36 -04:00
Apply SelectionFilter in Partition{Labels,Bars}View.
This commit is contained in:
parent
f7f19eb617
commit
ddf4878ec7
4 changed files with 31 additions and 2 deletions
|
@ -53,6 +53,7 @@ buildUnknownDisklabelTexts( Device* dev )
|
|||
|
||||
PartitionLabelsView::PartitionLabelsView( QWidget* parent )
|
||||
: QAbstractItemView( parent )
|
||||
, canBeSelected( []( const QModelIndex& ) { return true; } )
|
||||
{
|
||||
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||
setFrameStyle( QFrame::NoFrame );
|
||||
|
@ -523,7 +524,9 @@ PartitionLabelsView::isIndexHidden( const QModelIndex& index ) const
|
|||
void
|
||||
PartitionLabelsView::setSelection( const QRect& rect, QItemSelectionModel::SelectionFlags flags )
|
||||
{
|
||||
selectionModel()->select( indexAt( rect.topLeft() ), flags );
|
||||
QModelIndex eventIndex = indexAt( rect.topLeft() );
|
||||
if ( canBeSelected( eventIndex ) )
|
||||
selectionModel()->select( eventIndex, flags );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue