mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
MdTab: fix bug which will open two tabs for the same file
This commit is contained in:
parent
357604a38d
commit
e0ba7210f3
@ -94,11 +94,13 @@ VMdTab::VMdTab(VFile *p_file, VEditArea *p_editArea,
|
||||
}
|
||||
});
|
||||
|
||||
if (p_mode == OpenFileMode::Edit) {
|
||||
showFileEditMode();
|
||||
} else {
|
||||
showFileReadMode();
|
||||
}
|
||||
QTimer::singleShot(50, this, [this, p_mode]() {
|
||||
if (p_mode == OpenFileMode::Edit) {
|
||||
showFileEditMode();
|
||||
} else {
|
||||
showFileReadMode();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void VMdTab::setupUI()
|
||||
@ -940,7 +942,7 @@ void VMdTab::focusChild()
|
||||
break;
|
||||
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
this->setFocus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user