impr: Dock newly opened windows by default

This commit is contained in:
WerWolv
2023-10-30 21:53:44 +01:00
parent e827ad4b8d
commit c37c53369b
5 changed files with 33 additions and 6 deletions

View File

@@ -434,8 +434,12 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.view" }, 1000, [] {
for (auto &[name, view] : ContentRegistry::Views::impl::getEntries()) {
if (view->hasViewMenuItemEntry())
ImGui::MenuItem(LangEntry(view->getUnlocalizedName()), "", &view->getWindowOpenState());
if (view->hasViewMenuItemEntry()) {
auto &state = view->getWindowOpenState();
if (ImGui::MenuItem(LangEntry(view->getUnlocalizedName()), "", &state))
view->setWindowJustOpened(state);
}
}
ImGui::Separator();

View File

@@ -14,7 +14,7 @@ namespace hex::plugin::builtin {
}
void ViewThemeManager::drawContent() {
if (ImGui::Begin(View::toWindowName("hex.builtin.view.theme_manager.name").c_str(), &this->m_viewOpen, ImGuiWindowFlags_NoCollapse)) {
if (ImGui::Begin(View::toWindowName("hex.builtin.view.theme_manager.name").c_str(), &this->m_viewOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoDocking)) {
ImGui::Header("hex.builtin.view.theme_manager.colors"_lang, true);
// Draw theme handlers