Browse Source

VariableList now makes attempts to allow scroll bars being required

master
desktop-maesty/steve 8 years ago
parent
commit
da5a08c2a9
  1. 6
      Assets/Fungus/Scripts/Editor/FlowchartEditor.cs
  2. 4
      Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs

6
Assets/Fungus/Scripts/Editor/FlowchartEditor.cs

@ -91,7 +91,7 @@ namespace Fungus.EditorUtils
//Show the variables in the flowchart inspector
GUILayout.Space(20);
DrawVariablesGUI(false, Screen.width - 70);
DrawVariablesGUI(false, Mathf.FloorToInt(EditorGUIUtility.currentViewWidth) - VariableListAdaptor.ReorderListSkirts);
}
@ -165,8 +165,10 @@ namespace Fungus.EditorUtils
Rect lastRect = buttonRect;
lastRect.x += 5;
lastRect.y += 5;
//this is not required, seems to be legacy that is hidden in the normal reorderable
//EditorGUI.Foldout(lastRect, true, "");
if(showVariableToggleButton)
EditorGUI.Foldout(lastRect, true, "");
Rect plusRect = listRect;
plusRect.x += plusRect.width - plusWidth;

4
Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs

@ -15,6 +15,8 @@ namespace Fungus.EditorUtils
public class VariableListAdaptor : IReorderableListAdaptor {
public static readonly int DefaultWidth = 80 + 100 + 140 + 60;
public static readonly int ScrollSpacer = 8;
public static readonly int ReorderListSkirts = 70;
protected SerializedProperty _arrayProperty;
@ -38,7 +40,7 @@ namespace Fungus.EditorUtils
this._arrayProperty = arrayProperty;
this.fixedItemHeight = fixedItemHeight;
this.widthOfList = widthOfList;
this.widthOfList = widthOfList - ScrollSpacer;
}
public VariableListAdaptor(SerializedProperty arrayProperty) : this(arrayProperty, 0f, DefaultWidth) {

Loading…
Cancel
Save