mirror of
https://github.com/transmission/transmission
synced 2025-01-31 11:23:40 +00:00
(qt) Don't lose selection when changing to and from compact mode.
This commit is contained in:
parent
d7be6c4f5a
commit
603937184b
2 changed files with 9 additions and 1 deletions
|
@ -710,6 +710,7 @@ Details :: refresh( )
|
|||
myPeerLimitSpin->blockSignals( false );
|
||||
}
|
||||
|
||||
if( !torrents.empty( ) )
|
||||
{
|
||||
const Torrent * tor;
|
||||
|
||||
|
|
|
@ -967,12 +967,19 @@ TrMainWindow :: refreshPref( int key )
|
|||
refreshTrayIcon( );
|
||||
break;
|
||||
|
||||
case Prefs::COMPACT_VIEW:
|
||||
case Prefs::COMPACT_VIEW: {
|
||||
QItemSelectionModel * selectionModel( ui.listView->selectionModel( ) );
|
||||
const QItemSelection selection( selectionModel->selection( ) );
|
||||
const QModelIndex currentIndex( selectionModel->currentIndex( ) );
|
||||
b = myPrefs.getBool( key );
|
||||
ui.action_CompactView->setChecked( b );
|
||||
ui.listView->setItemDelegate( b ? myTorrentDelegateMin : myTorrentDelegate );
|
||||
selectionModel->clear( );
|
||||
ui.listView->reset( ); // force the rows to resize
|
||||
selectionModel->select( selection, QItemSelectionModel::Select );
|
||||
selectionModel->setCurrentIndex( currentIndex, QItemSelectionModel::NoUpdate );
|
||||
break;
|
||||
}
|
||||
|
||||
case Prefs::MAIN_WINDOW_X:
|
||||
case Prefs::MAIN_WINDOW_Y:
|
||||
|
|
Loading…
Reference in a new issue