_drag refactor

This commit is contained in:
2025-01-21 16:08:09 +02:00
parent 61f04110a6
commit c22ae8fca7
3 changed files with 10 additions and 11 deletions

View File

@@ -111,7 +111,9 @@ namespace FlaxEditor.GUI.Docking
window.DoDragDrop("", _dragOffset, window); window.DoDragDrop("", _dragOffset, window);
} }
window.IsAlwaysOnTop = true;
//window.Show(); //window.Show();
//window.BringToFront(); //window.BringToFront();
//window.Focus(); //window.Focus();
@@ -119,8 +121,8 @@ namespace FlaxEditor.GUI.Docking
// Perform layout again // Perform layout again
//windowGUI.PerformLayout(); //windowGUI.PerformLayout();
// Start tracking mouse // Start tracking mouse
//Proxy.Window.StartTrackingMouse(false); //Proxy.Window.StartTrackingMouse(false);
} }
@@ -160,7 +162,11 @@ namespace FlaxEditor.GUI.Docking
return; return;
if (_toMove.Window != null) if (_toMove.Window != null)
{
_toMove.Window.Window.Opacity = 1.0f; _toMove.Window.Window.Opacity = 1.0f;
_toMove.Window.Window.IsAlwaysOnTop = false;
_toMove.Window.Window.BringToFront();
}
// Check if window won't be docked // Check if window won't be docked
if (_toSet == DockState.Float) if (_toSet == DockState.Float)

View File

@@ -304,12 +304,6 @@ void SDLPlatform::Tick()
buttonUpEvent.motion.x = mousePosition.X; buttonUpEvent.motion.x = mousePosition.X;
buttonUpEvent.motion.y = mousePosition.Y; buttonUpEvent.motion.y = mousePosition.Y;
draggedWindow->HandleEvent(buttonUpEvent); draggedWindow->HandleEvent(buttonUpEvent);
//SDL_PushEvent(&buttonUpEvent);
if (!draggedWindow->GetSettings().IsTopmost)
draggedWindow->SetIsAlwaysOnTop(false);
draggedWindow->BringToFront();
draggedWindow = nullptr; draggedWindow = nullptr;
} }
} }

View File

@@ -823,7 +823,7 @@ void SDLWindow::Show()
else if (_settings.Parent == nullptr) else if (_settings.Parent == nullptr)
BringToFront(); BringToFront();
// Reused top-most windows (DockHintWindow) doesn't stay on top for some reason // Reused top-most windows doesn't stay on top for some reason
if (_settings.IsTopmost && _settings.Type != WindowType::Tooltip) if (_settings.IsTopmost && _settings.Type != WindowType::Tooltip)
SetIsAlwaysOnTop(true); SetIsAlwaysOnTop(true);
@@ -1345,7 +1345,6 @@ DragDropEffect SDLWindow::DoDragDrop(const StringView& data, const Float2& offse
else else
#endif #endif
{ {
SetIsAlwaysOnTop(true);
Show(); Show();
//draggingActive = true; //draggingActive = true;