use box style for scroll view in options

This commit is contained in:
in0finite 2019-07-28 21:34:11 +02:00
parent c17559b80b
commit f28aeeb82a
2 changed files with 11 additions and 1 deletions

View file

@ -234,6 +234,12 @@ namespace SanAndreasUnity.UI {
}
protected override void OnWindowStart()
{
base.OnWindowStart();
m_scrollViewStyle = GUI.skin.box;
}
protected override void OnWindowGUIBeforeContent ()
{
s_categories = s_registeredInputs.Select (i => i.category).Distinct ().ToArray ();

View file

@ -44,6 +44,7 @@ namespace SanAndreasUnity.UI {
public bool useScrollView = false;
protected Vector2 scrollPos = Vector2.zero;
protected GUIStyle m_scrollViewStyle = null;
protected bool isDraggable = true;
public bool IsDraggable { get { return this.isDraggable; } }
@ -130,6 +131,9 @@ namespace SanAndreasUnity.UI {
void OnGUI() {
if (null == m_scrollViewStyle)
m_scrollViewStyle = GUI.skin.scrollView;
if (!m_hasStarted) {
m_hasStarted = true;
this.WindowStart ();
@ -196,7 +200,7 @@ namespace SanAndreasUnity.UI {
this.OnWindowGUIBeforeContent ();
if (this.useScrollView)
this.scrollPos = GUILayout.BeginScrollView (this.scrollPos);
this.scrollPos = GUILayout.BeginScrollView (this.scrollPos, m_scrollViewStyle);
this.OnWindowGUI ();