From e670d064c7ee59bdd1584c31721a5a96de86d71c Mon Sep 17 00:00:00 2001 From: Tweety-lab <108560864+Tweety-lab@users.noreply.github.com> Date: Thu, 10 Jul 2025 00:05:30 +1000 Subject: [PATCH] Update editor tab close button styling. --- Prowl.Editor/Editor/EditorWindow.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Prowl.Editor/Editor/EditorWindow.cs b/Prowl.Editor/Editor/EditorWindow.cs index 7af84041..a3af3f32 100644 --- a/Prowl.Editor/Editor/EditorWindow.cs +++ b/Prowl.Editor/Editor/EditorWindow.cs @@ -234,17 +234,23 @@ private void TabNode(int i, EditorWindow window, Vector2 textSize) else gui.Draw2D.DrawRectFilled(tabRect, EditorStylePrefs.Instance.Borders, (float)EditorStylePrefs.Instance.TabRoundness, CornerRounding.Top); } + } + + // Add close button to the tab if hovered or if this is the currently selected tab + if (isHovered || window == this) + { + gui.CurrentNode.Width(textSize.x + 35); using (gui.Node("_CloseButton").Width(20).Height(20).Left(Offset.Percentage(1f, -23)).Top(3).Enter()) { - gui.Draw2D.DrawRectFilled(gui.CurrentNode.LayoutData.InnerRect, new Color(1, 1, 1, 150), 5); if (gui.IsPointerHovering() && gui.IsPointerClick()) { if (window.IsDocked) EditorGuiManager.Container.DetachWindow(window); EditorGuiManager.Remove(window); } - gui.Draw2D.DrawText(FontAwesome6.Xmark, gui.CurrentNode.LayoutData.InnerRect, gui.IsPointerHovering() ? EditorStylePrefs.Instance.Hovering : Color.white); + + gui.Draw2D.DrawText(FontAwesome6.Xmark, 18, gui.CurrentNode.LayoutData.InnerRect, gui.IsPointerHovering() ? Color.white : new Color(0.6f, 0.6f, 0.6f)); } }