impr: Make Hex Editor view always be focused by default

This commit is contained in:
WerWolv
2025-08-31 11:22:26 +02:00
parent 0e14ff5a3d
commit 06ac7eb85f
3 changed files with 49 additions and 28 deletions

View File

@@ -16,6 +16,33 @@ namespace hex::plugin::builtin {
return ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse;
}
bool shouldDefaultFocus() const override { return true; }
bool isSelectionValid() const {
return m_hexEditor.isSelectionValid();
}
Region getSelection() const {
return m_hexEditor.getSelection();
}
void setSelection(const Region &region) {
m_hexEditor.setSelection(region);
}
void setSelection(u64 start, u64 end) {
m_hexEditor.setSelection(start, end);
}
void jumpToSelection() {
m_hexEditor.jumpToSelection();
}
void jumpIfOffScreen() {
m_hexEditor.jumpIfOffScreen();
}
public:
class Popup {
public:
virtual ~Popup() = default;
@@ -52,30 +79,6 @@ namespace hex::plugin::builtin {
m_currPopup.reset();
}
bool isSelectionValid() const {
return m_hexEditor.isSelectionValid();
}
Region getSelection() const {
return m_hexEditor.getSelection();
}
void setSelection(const Region &region) {
m_hexEditor.setSelection(region);
}
void setSelection(u64 start, u64 end) {
m_hexEditor.setSelection(start, end);
}
void jumpToSelection() {
m_hexEditor.jumpToSelection();
}
void jumpIfOffScreen() {
m_hexEditor.jumpIfOffScreen();
}
private:
void drawPopup();