impr: Handle read-only files more gracefully

This commit is contained in:
WerWolv
2024-02-23 17:59:37 +01:00
parent 9bfdfa149e
commit 4d91e7f347
6 changed files with 18 additions and 6 deletions

View File

@@ -37,7 +37,7 @@ namespace hex::plugin::builtin {
(*m_patternDrawer)->jumpToPattern(pattern);
});
m_patternDrawer.setOnCreateCallback([this](prv::Provider *, auto &drawer) {
m_patternDrawer.setOnCreateCallback([this](prv::Provider *provider, auto &drawer) {
drawer = std::make_unique<ui::PatternDrawer>();
drawer->setSelectionCallback([](const pl::ptrn::Pattern *pattern) {
@@ -47,6 +47,7 @@ namespace hex::plugin::builtin {
drawer->setTreeStyle(m_treeStyle);
drawer->enableRowColoring(m_rowColoring);
drawer->enablePatternEditing(provider->isWritable());
});
}