Skip to content

Commit

Permalink
[GUI] Fix for warning and missing close icon under Unity 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
Eideren committed Jul 15, 2024
1 parent 9a39f85 commit aab45f0
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void OnEditModeSelectionSceneGUI()
buttonArea.y = 2;
buttonArea.height = 13;
buttonArea.width = 13;
if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose"))
if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose))
EditModeToolWindowSceneGUI.GetWindow();
TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static void OnSceneGUI(Rect windowRect, EditModeClip tool)
buttonArea.y += 2;
buttonArea.height = 13;
buttonArea.width = 13;
if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose"))
if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose))
EditModeToolWindowSceneGUI.GetWindow();
TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void OnSceneGUI(Rect windowRect, EditModeMeshEdit tool)
buttonArea.y += 2;
buttonArea.height = 13;
buttonArea.width = 13;
if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose"))
if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose))
EditModeToolWindowSceneGUI.GetWindow();
TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static bool OnSceneGUI(Rect windowRect, EditModeGenerate tool)
buttonArea.y += 2;
buttonArea.height = 13;
buttonArea.width = 13;
if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose"))
if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose))
EditModeToolWindowSceneGUI.GetWindow();
TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void OnSceneGUI(Rect windowRect, EditModePlace tool)
buttonArea.y += 2;
buttonArea.height = 13;
buttonArea.width = 13;
if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose"))
if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose))
EditModeToolWindowSceneGUI.GetWindow();
TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ public static void OnSceneGUI(Rect windowRect, EditModeSurface tool)
buttonArea.y += 2;
buttonArea.height = 13;
buttonArea.width = 13;
if (GUI.Button(buttonArea, GUIContent.none, "WinBtnClose"))
if (GUI.Button(buttonArea, GUIContent.none, CSG_GUIStyleUtility.winBtnClose))
EditModeToolWindowSceneGUI.GetWindow();

TooltipUtility.SetToolTip(CSG_GUIStyleUtility.PopOutTooltip, buttonArea);
Expand Down
20 changes: 20 additions & 0 deletions Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ internal static class CSG_GUIStyleUtility

public static GUIStyle unpaddedWindow;

public static GUIStyle winBtnClose;

public static GUILayoutOption[] ContentEmpty = new GUILayoutOption[0];


Expand Down Expand Up @@ -364,6 +366,24 @@ public static void InitStyles()

selectionRectStyle = GetStyle("selectionRect");

winBtnClose = new GUIStyle(GUI.skin.verticalScrollbarUpButton);
winBtnClose.normal.background = Resources.Load<Texture2D>("GUI/WinBtnClose");
winBtnClose.onActive.background =
winBtnClose.onFocused.background =
winBtnClose.onNormal.background =
winBtnClose.onHover.background =
winBtnClose.hover.background =
winBtnClose.focused.background =
winBtnClose.active.background = null;
winBtnClose.fixedHeight = 16f;
winBtnClose.fixedWidth = 16f;
winBtnClose.overflow.bottom = 0;
winBtnClose.overflow.top = 0;
winBtnClose.overflow.right = 0;
winBtnClose.overflow.left = 0;




var redToolbarDropDown = GetStyle("toolbarDropDown");

Expand Down

0 comments on commit aab45f0

Please sign in to comment.