-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add a button to allow clear messages
- Loading branch information
Showing
6 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using UnityEditor.UIElements; | ||
using UnityEngine; | ||
using UnityEngine.UIElements; | ||
|
||
namespace GBG.EditorMessages.Editor | ||
{ | ||
internal class ToolbarImageButton : ToolbarButton | ||
{ | ||
public Texture Image | ||
{ | ||
get => _image.image; | ||
set => _image.image = value; | ||
} | ||
|
||
private readonly Image _image; | ||
|
||
|
||
public ToolbarImageButton(Action clickEvent) : base(clickEvent) | ||
{ | ||
float iconSize = EditorMessageUtility.GlobalIconSize; | ||
|
||
_image = EditorMessageUtility.NewImage(); | ||
Insert(0, _image); | ||
} | ||
|
||
public ToolbarImageButton(Texture image, Action clickEvent) : this(clickEvent) | ||
{ | ||
Image = image; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters