diff options
author | Ken Moore <ken@pcbsd.org> | 2015-05-11 09:37:42 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-05-11 09:37:42 -0400 |
commit | fd095cfe2523563d652aedc01d0b8620a1fd17f3 (patch) | |
tree | 30a52752deee1921f5f0b62efebaaa7d39adb1de /lumina-fm/MainUI.cpp | |
parent | When moving back/up a directory in lumina-fm, have it automatically select th... (diff) | |
download | lumina-fd095cfe2523563d652aedc01d0b8620a1fd17f3.tar.gz lumina-fd095cfe2523563d652aedc01d0b8620a1fd17f3.tar.bz2 lumina-fd095cfe2523563d652aedc01d0b8620a1fd17f3.zip |
oops, also ensure that the widget scrolls to ensure the old directory is visible instead of just selected.
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r-- | lumina-fm/MainUI.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index ab6a06e0..da970fed 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -434,11 +434,17 @@ void MainUI::setCurrentDir(QString dir){ if(radio_view_details->isChecked()){ ui->tree_dir_view->setRootIndex(fsmod->index(dir)); ui->tree_dir_view->selectionModel()->clearSelection(); - if(olddir.startsWith(rawdir)){ ui->tree_dir_view->selectionModel()->setCurrentIndex( fsmod->index(olddir),QItemSelectionModel::SelectCurrent ); } + if(olddir.startsWith(rawdir)){ + ui->tree_dir_view->setCurrentIndex( fsmod->index(olddir)); + ui->tree_dir_view->scrollTo( fsmod->index(olddir)); + } }else{ ui->list_dir_view->setRootIndex(fsmod->index(dir)); ui->list_dir_view->selectionModel()->clearSelection(); - if(olddir.startsWith(rawdir)){ ui->list_dir_view->selectionModel()->setCurrentIndex( fsmod->index(olddir),QItemSelectionModel::SelectCurrent ); } + if(olddir.startsWith(rawdir)){ + ui->list_dir_view->setCurrentIndex( fsmod->index(olddir)); + ui->list_dir_view->scrollTo( fsmod->index(olddir)); + } } //Adjust the tab data tabBar->setTabWhatsThis( tabBar->currentIndex(), rawdir ); |