1
0
mirror of synced 2025-01-18 00:56:49 +01:00

fix: Docking two detached tools to each other causing them to vanish

This commit is contained in:
WerWolv 2023-11-12 00:10:16 +01:00
parent 17540b0120
commit 9fb60a8ab0
2 changed files with 9 additions and 5 deletions

View File

@ -508,8 +508,8 @@ namespace hex::plugin::builtin {
ImGui::TableNextColumn();
if (ImGui::BeginTable("##mathHistory", 1, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg, ImVec2(0, 300))) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.tools.history"_lang);
ImGui::TableSetupScrollFreeze(0, 1);
ImGuiListClipper clipper;
clipper.Begin(mathHistory.size());
@ -552,9 +552,9 @@ namespace hex::plugin::builtin {
ImGui::TableNextColumn();
if (ImGui::BeginTable("##mathVariables", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg, ImVec2(0, 300))) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.tools.name"_lang);
ImGui::TableSetupColumn("hex.builtin.tools.value"_lang);
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();
for (const auto &[name, variable] : mathEvaluator.getVariables()) {
@ -745,11 +745,11 @@ namespace hex::plugin::builtin {
ImGui::Separator();
if (ImGui::BeginTable("Permissions", 4, ImGuiTableFlags_Borders)) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("Special", ImGuiTableColumnFlags_NoSort);
ImGui::TableSetupColumn("User", ImGuiTableColumnFlags_NoSort);
ImGui::TableSetupColumn("Group", ImGuiTableColumnFlags_NoSort);
ImGui::TableSetupColumn("Other", ImGuiTableColumnFlags_NoSort);
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();
@ -828,10 +828,10 @@ namespace hex::plugin::builtin {
ImGui::Header("hex.builtin.tools.file_uploader.recent"_lang);
if (ImGui::BeginTable("##links", 3, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg, ImVec2(0, 200))) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.common.file"_lang);
ImGui::TableSetupColumn("hex.builtin.common.link"_lang);
ImGui::TableSetupColumn("hex.builtin.common.size"_lang);
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();
ImGuiListClipper clipper;

View File

@ -61,8 +61,12 @@ namespace hex::plugin::builtin {
if (!detached) continue;
// Create a new window for the tool
ImGui::SetNextWindowSize(scaled(ImVec2(600, 0)));
if (ImGui::Begin(View::toWindowName(name).c_str(), &detached, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize)) {
if (!ImGui::IsWindowDocked())
ImGui::SetWindowSize(scaled(ImVec2(600, 0)));
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
// Draw the tool
function();