- fix: crash when copy to non-c files

- fix: fonts in cpu window is not correctly set, when dpi changed
This commit is contained in:
Roy Qu 2022-03-01 18:11:15 +08:00
parent afec4355bd
commit 82d812b6eb
5 changed files with 24 additions and 1 deletions

View File

@ -3,6 +3,8 @@ Red Panda C++ Version 0.14.5
- enhancement: option "open files in the same red panda C++ instance", in options->environment->file associations
- enhancement: hide unsupported files in files view
- fix: can't correctly set break conditions
- fix: crash when copy to non-c files
- fix: fonts in cpu window is not correctly set, when dpi changed
Red Panda C++ Version 0.14.4

View File

@ -625,6 +625,9 @@ void MainWindow::applySettings()
for (QWidget* p:findChildren<QWidget*>()) {
p->setFont(font);
}
if (mCPUDialog!=nullptr) {
mCPUDialog->resetEditorFont();
}
if (pSettings->environment().useCustomIconSet()) {
QString customIconSetFolder = pSettings->dirs().config(Settings::Dirs::DataType::IconSet);
pIconsManager->prepareCustomIconSet(customIconSetFolder);

View File

@ -5169,10 +5169,13 @@ int SynEdit::insertTextByNormalMode(const QString &Value)
rescanRange(caretY);
// step2: insert remaining lines of Value
while (P < Value.length()) {
bool notInComment = !mHighlighter->isLastLineCommentNotFinished(
bool notInComment = true;
if (mHighlighter) {
notInComment = !mHighlighter->isLastLineCommentNotFinished(
mHighlighter->getRangeState().state)
&& !mHighlighter->isLastLineStringNotFinished(
mHighlighter->getRangeState().state);
}
if (Value[P] == '\r')
P++;
if (Value[P] == '\n')

View File

@ -54,6 +54,8 @@ CPUDialog::CPUDialog(QWidget *parent) :
ui->txtCode->setForegroundColor(palette().color(QPalette::Text));
ui->txtCode->setBackgroundColor(palette().color(QPalette::Base));
}
resetEditorFont();
ui->lstRegister->setModel(pMainWindow->debugger()->registerModel());
ui->rdIntel->setChecked(pSettings->debugger().useIntelStyle());
@ -112,6 +114,18 @@ void CPUDialog::setDisassembly(const QString& file, const QString& funcName,cons
ui->txtCode->setCaretXYEx(true,BufferCoord{1,activeLine+1});
}
void CPUDialog::resetEditorFont()
{
QFont f=QFont(pSettings->editor().fontName());
f.setPixelSize(pointToPixel(pSettings->editor().fontSize()));
f.setStyleStrategy(QFont::PreferAntialias);
ui->txtCode->setFont(f);
QFont f2=QFont(pSettings->editor().nonAsciiFontName());
f2.setPixelSize(pointToPixel(pSettings->editor().fontSize()));
f2.setStyleStrategy(QFont::PreferAntialias);
ui->txtCode->setFontForNonAscii(f2);
}
void CPUDialog::sendSyntaxCommand()
{
// Set disassembly flavor

View File

@ -34,6 +34,7 @@ public:
void updateButtonStates(bool enable);
public slots:
void setDisassembly(const QString& file, const QString& funcName,const QStringList& lines);
void resetEditorFont();
signals:
void closed();
private: