mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Dock newly opened windows by default
This commit is contained in:
@@ -44,6 +44,9 @@ namespace hex {
|
||||
[[nodiscard]] const std::string &getUnlocalizedName() const;
|
||||
[[nodiscard]] std::string getName() const;
|
||||
|
||||
[[nodiscard]] bool didWindowJustOpen();
|
||||
void setWindowJustOpened(bool state);
|
||||
|
||||
static void confirmButtons(const std::string &textLeft, const std::string &textRight, const std::function<void()> &leftButtonFn, const std::function<void()> &rightButtonFn);
|
||||
static void discardNavigationRequests();
|
||||
|
||||
@@ -61,6 +64,7 @@ namespace hex {
|
||||
std::string m_unlocalizedViewName;
|
||||
bool m_windowOpen = false;
|
||||
std::map<Shortcut, std::function<void()>> m_shortcuts;
|
||||
bool m_windowJustOpened = false;
|
||||
|
||||
friend class ShortcutManager;
|
||||
};
|
||||
|
||||
@@ -50,6 +50,18 @@ namespace hex {
|
||||
return View::toWindowName(this->m_unlocalizedViewName);
|
||||
}
|
||||
|
||||
bool View::didWindowJustOpen() {
|
||||
bool result = this->m_windowJustOpened;
|
||||
|
||||
this->m_windowJustOpened = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void View::setWindowJustOpened(bool state) {
|
||||
this->m_windowJustOpened = state;
|
||||
}
|
||||
|
||||
void View::discardNavigationRequests() {
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows))
|
||||
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NavEnableKeyboard;
|
||||
|
||||
Reference in New Issue
Block a user