From e53e854c918b0f1c56606411fab20f3bd8d44706 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 11 Feb 2022 20:57:01 +0800 Subject: [PATCH] - enhancement: replace Files View Panel's path lineedit control with combo box --- RedPandaIDE/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 70039615..adf25d5b 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -5889,7 +5889,9 @@ void MainWindow::on_actionLocate_in_Files_View_triggered() QString fileDir = extractFileDir(editor->filename()); if (!fileDir.isEmpty()) { setFilesViewRoot(fileDir); - ui->treeFiles->setCurrentIndex(mFileSystemModel.index(editor->filename())); + QModelIndex index = mFileSystemModel.index(editor->filename()); + ui->treeFiles->setCurrentIndex(index); + ui->treeFiles->scrollTo(index, QAbstractItemView::PositionAtCenter); ui->tabInfos->setCurrentWidget(ui->tabFiles); openCloseLeftPanel(true); }