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 21acf4b
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 6 deletions.
Binary file added Plugins/Editor/Resources/GUI/WinBtnClose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 115 additions & 0 deletions Plugins/Editor/Resources/GUI/WinBtnClose.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
17 changes: 17 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,21 @@ 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 21acf4b

Please sign in to comment.