refactor: Better interface for the event system

This commit is contained in:
WerWolv
2023-12-08 10:29:44 +01:00
parent f08d1e265c
commit b4813660b5
63 changed files with 327 additions and 320 deletions

View File

@@ -73,7 +73,7 @@ namespace hex::plugin::builtin::ui {
this->m_currDataVisualizer = ContentRegistry::HexEditor::getVisualizerByName("hex.builtin.visualizer.hexadecimal.8bit");
this->m_bytesPerRow = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.bytes_per_row", this->m_bytesPerRow);
EventManager::subscribe<EventSettingsChanged>(this, [this] {
EventSettingsChanged::subscribe(this, [this] {
this->m_selectionColor = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.highlight_color", 0x60C08080);
this->m_syncScrolling = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.sync_scrolling", false);
this->m_byteCellPadding = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.byte_padding", false);
@@ -82,7 +82,7 @@ namespace hex::plugin::builtin::ui {
}
HexEditor::~HexEditor() {
EventManager::unsubscribe<EventSettingsChanged>(this);
EventSettingsChanged::unsubscribe(this);
}
constexpr static u16 getByteColumnSeparatorCount(u16 columnCount) {