diff --git a/TODO.md b/TODO.md index 02b3990ec..918950345 100644 --- a/TODO.md +++ b/TODO.md @@ -14,7 +14,6 @@ - volume commands should work on Game Boy - add another FM editor layout - try to find out why does VSlider not accept keyboard input -- finish lock layout - if macros have release, note off should release them - add ability to select a column by double clicking - add ability to move selection by dragging diff --git a/extern/imgui_patched/imgui.cpp b/extern/imgui_patched/imgui.cpp index 332591642..2b3902749 100644 --- a/extern/imgui_patched/imgui.cpp +++ b/extern/imgui_patched/imgui.cpp @@ -3909,6 +3909,8 @@ void ImGui::StartMouseMovingWindowOrNode(ImGuiWindow* window, ImGuiDockNode* nod if (root_node->OnlyNodeWithWindows != node || root_node->CentralNode != NULL) // -V1051 PVS-Studio thinks node should be root_node and is wrong about that. if (undock_floating_node || root_node->IsDockSpace()) can_undock_node = true; + if (node->MergedFlags & ImGuiDockNodeFlags_NoMove) + can_undock_node = false; } const bool clicked = IsMouseClicked(0); @@ -6122,7 +6124,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar // Docking: Unhide tab bar (small triangle in the corner), drag from small triangle to quickly undock ImGuiDockNode* node = window->DockNode; - if (window->DockIsActive && node->IsHiddenTabBar() && !node->IsNoTabBar()) + if (window->DockIsActive && node->IsHiddenTabBar() && !node->IsNoTabBar() && !(node->MergedFlags & ImGuiDockNodeFlags_NoMove)) { float unhide_sz_draw = ImFloor(g.FontSize * 0.70f); float unhide_sz_hit = ImFloor(g.FontSize * 0.55f); diff --git a/extern/imgui_patched/imgui.h b/extern/imgui_patched/imgui.h index c0ab8f22c..bdd8a093a 100644 --- a/extern/imgui_patched/imgui.h +++ b/extern/imgui_patched/imgui.h @@ -1342,7 +1342,8 @@ enum ImGuiDockNodeFlags_ ImGuiDockNodeFlags_PassthruCentralNode = 1 << 3, // Shared // Enable passthru dockspace: 1) DockSpace() will render a ImGuiCol_WindowBg background covering everything excepted the Central Node when empty. Meaning the host window should probably use SetNextWindowBgAlpha(0.0f) prior to Begin() when using this. 2) When Central Node is empty: let inputs pass-through + won't display a DockingEmptyBg background. See demo for details. ImGuiDockNodeFlags_NoSplit = 1 << 4, // Shared/Local // Disable splitting the node into smaller nodes. Useful e.g. when embedding dockspaces into a main root one (the root one may have splitting disabled to reduce confusion). Note: when turned off, existing splits will be preserved. ImGuiDockNodeFlags_NoResize = 1 << 5, // Shared/Local // Disable resizing node using the splitter/separators. Useful with programmatically setup dockspaces. - ImGuiDockNodeFlags_AutoHideTabBar = 1 << 6 // Shared/Local // Tab bar will automatically hide when there is a single window in the dock node. + ImGuiDockNodeFlags_AutoHideTabBar = 1 << 6, // Shared/Local // Tab bar will automatically hide when there is a single window in the dock node. + ImGuiDockNodeFlags_NoMove = 1 << 7 // Shared/Local // Disable moving node }; // Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload() diff --git a/extern/imgui_patched/imgui_widgets.cpp b/extern/imgui_patched/imgui_widgets.cpp index 3830f9628..c6fec68bc 100644 --- a/extern/imgui_patched/imgui_widgets.cpp +++ b/extern/imgui_patched/imgui_widgets.cpp @@ -8160,12 +8160,16 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, // Drag and drop a single floating window node moves it ImGuiDockNode* node = docked_window ? docked_window->DockNode : NULL; const bool single_floating_window_node = node && node->IsFloatingNode() && (node->Windows.Size == 1); + bool can_undock = true; + if (node) { + if (node->MergedFlags & ImGuiDockNodeFlags_NoMove) can_undock = false; + } if (held && single_floating_window_node && IsMouseDragging(0, 0.0f)) { // Move StartMouseMovingWindow(docked_window); } - else if (held && !tab_appearing && IsMouseDragging(0)) + else if (held && !tab_appearing && IsMouseDragging(0) && can_undock) { // Drag and drop: re-order tabs int drag_dir = 0; @@ -8247,7 +8251,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, flags |= ImGuiTabItemFlags_NoCloseWithMiddleMouseButton; // Render tab label, process close button - const ImGuiID close_button_id = p_open ? GetIDWithSeed("#CLOSE", NULL, docked_window ? docked_window->ID : id) : 0; + const ImGuiID close_button_id = (p_open && can_undock) ? GetIDWithSeed("#CLOSE", NULL, docked_window ? docked_window->ID : id) : 0; bool just_closed; bool text_clipped; TabItemLabelAndCloseButton(display_draw_list, bb, flags, tab_bar->FramePadding, label, id, close_button_id, tab_contents_visible, &just_closed, &text_clipped); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 82778a44e..a8fa0e562 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3022,8 +3022,8 @@ bool FurnaceGUI::loop() { drawPattern(); drawPiano(); } else { - globalWinFlags=lockLayout?ImGuiWindowFlags_NoMove:0; - ImGui::DockSpaceOverViewport(NULL,lockLayout?(ImGuiDockNodeFlags_NoResize|ImGuiDockNodeFlags_NoCloseButton|ImGuiDockNodeFlags_NoDocking|ImGuiDockNodeFlags_NoDockingSplitMe|ImGuiDockNodeFlags_NoDockingSplitOther):0); + globalWinFlags=0; + ImGui::DockSpaceOverViewport(NULL,lockLayout?(ImGuiDockNodeFlags_NoWindowMenuButton|ImGuiDockNodeFlags_NoMove|ImGuiDockNodeFlags_NoResize|ImGuiDockNodeFlags_NoCloseButton|ImGuiDockNodeFlags_NoDocking|ImGuiDockNodeFlags_NoDockingSplitMe|ImGuiDockNodeFlags_NoDockingSplitOther):0); drawSubSongs(); drawPattern();