class browser use editor's background color

This commit is contained in:
royqh1979 2021-11-04 00:57:43 +08:00
parent c5105cfa43
commit fcb8151493
2 changed files with 3 additions and 1 deletions

View File

@ -534,10 +534,12 @@ void MainWindow::updateEditorColorSchemes()
pal.setColor(QPalette::Text,item->foreground());
mCompletionPopup->setPalette(pal);
mHeaderCompletionPopup->setPalette(pal);
ui->classBrowser->setPalette(pal);
} else {
QPalette pal = palette();
mCompletionPopup->setPalette(pal);
mHeaderCompletionPopup->setPalette(pal);
ui->classBrowser->setPalette(pal);
}
}

View File

@ -141,7 +141,7 @@ QVariant ClassBrowserModel::data(const QModelIndex &index, int role) const
kind = StatementKind::skPreprocessor;
}
PColorSchemeItem item = mColors->value(kind,PColorSchemeItem());
if (item && haveGoodContrast(item->foreground(), pMainWindow->palette().color(QPalette::Base))) {
if (item) {
return item->foreground();
} else {
return pMainWindow->palette().color(QPalette::Text);