- fix: wrong code completion font size, when screen dpi changed

- enhancement: replace Files View Panel's path lineedit control with combo box
This commit is contained in:
Roy Qu 2022-02-11 20:29:02 +08:00
parent bf25853da1
commit 66cd470d8f
1 changed files with 4 additions and 0 deletions

View File

@ -293,6 +293,8 @@ MainWindow::MainWindow(QWidget *parent)
} }
connect(ui->cbFilesPath->lineEdit(),&QLineEdit::returnPressed, connect(ui->cbFilesPath->lineEdit(),&QLineEdit::returnPressed,
this,&MainWindow::onFilesViewPathChanged); this,&MainWindow::onFilesViewPathChanged);
connect(ui->cbFilesPath, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &MainWindow::onFilesViewPathChanged);
//class browser //class browser
ui->classBrowser->setUniformRowHeights(true); ui->classBrowser->setUniformRowHeights(true);
@ -3661,11 +3663,13 @@ void MainWindow::onFilesViewPathChanged()
{ {
QString filesPath = ui->cbFilesPath->currentText(); QString filesPath = ui->cbFilesPath->currentText();
QFileInfo fileInfo(filesPath); QFileInfo fileInfo(filesPath);
ui->cbFilesPath->blockSignals(true);
if (fileInfo.exists() && fileInfo.isDir()) { if (fileInfo.exists() && fileInfo.isDir()) {
setFilesViewRoot(filesPath); setFilesViewRoot(filesPath);
} else { } else {
ui->cbFilesPath->setCurrentText(pSettings->environment().currentFolder()); ui->cbFilesPath->setCurrentText(pSettings->environment().currentFolder());
} }
ui->cbFilesPath->blockSignals(false);
} }
const std::shared_ptr<HeaderCompletionPopup> &MainWindow::headerCompletionPopup() const const std::shared_ptr<HeaderCompletionPopup> &MainWindow::headerCompletionPopup() const