module-navigation-tool/Editor/History/Window/Views/EditorHistoryViewTools.cs
Anders Ejlersen 5a2dcf3619 1.8.4: History received a fix for startup issue, increased entry size, and context menu options
- Set selection active in history is now a toggleable feature in the context menu
- Increased number of entries in history from 32 to 64
- Clear entries moved to context menu in history
- Fixed issue, where history didn't work on first startup
2023-03-27 22:02:44 +02:00

42 lines
1.3 KiB
C#

using System;
using UnityEditor;
using UnityEngine;
namespace Module.NavigationTool.Editor.History
{
[Serializable]
internal sealed class EditorHistoryViewTools : AbstractEditorHistoryView
{
public string searchStr = string.Empty;
public override void Initialize()
{
}
public override void Draw(EditorHistoryWindow window, Rect rect, Styles styles)
{
const float PADDING = 4.0f;
const float ICON_SIZE = 20.0f;
const float BUTTON_SIZE = 50.0f;
GUI.BeginGroup(rect, styles.toolbox);
{
var r0 = new Rect(PADDING, 0.0f, ICON_SIZE, rect.height);
var r1 = new Rect(r0.xMax, 0.0f, rect.width - BUTTON_SIZE - ICON_SIZE - PADDING * 2.0f, rect.height);
var r2 = new Rect(r1.xMax, 0.0f, BUTTON_SIZE, rect.height);
GUI.Label(r0, styles.iconSearch);
searchStr = EditorGUI.TextField(r1, searchStr);
if (GUI.Button(r2, "Clear"))
searchStr = string.Empty;
}
GUI.EndGroup();
}
public bool IsSearching()
{
return !string.IsNullOrEmpty(searchStr);
}
}
}