diff --git a/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs b/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs
index 02f5ca7ec..7dfea232c 100644
--- a/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs
@@ -26,11 +26,6 @@ namespace FlaxEditor.CustomEditors.Editors
///
public static Color AxisColorZ = new Color(0.0f, 0.0235294f, 1.0f, 1.0f);
- ///
- /// The axes colors grey out scale when input field is not focused.
- ///
- public static float AxisGreyOutFactor = 0.6f;
-
///
/// Custom editor for actor position property.
///
@@ -43,18 +38,20 @@ namespace FlaxEditor.CustomEditors.Editors
base.Initialize(layout);
if (XElement.ValueBox.Parent is UniformGridPanel ug)
+ {
+ ug.SlotPadding = new Margin(3.0f, 0.0f, 0.0f, 0.0f);
CheckLayout(ug);
+ }
// Override colors
- var back = FlaxEngine.GUI.Style.Current.TextBoxBackground;
- XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, AxisGreyOutFactor);
XElement.ValueBox.BorderSelectedColor = AxisColorX;
- XElement.ValueBox.Category = Utils.ValueCategory.Distance;
- YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, AxisGreyOutFactor);
YElement.ValueBox.BorderSelectedColor = AxisColorY;
- YElement.ValueBox.Category = Utils.ValueCategory.Distance;
- ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, AxisGreyOutFactor);
ZElement.ValueBox.BorderSelectedColor = AxisColorZ;
+ XElement.ValueBox.HighlightColor = AxisColorX;
+ XElement.ValueBox.Category = Utils.ValueCategory.Distance;
+ YElement.ValueBox.HighlightColor = AxisColorY;
+ YElement.ValueBox.Category = Utils.ValueCategory.Distance;
+ ZElement.ValueBox.HighlightColor = AxisColorZ;
ZElement.ValueBox.Category = Utils.ValueCategory.Distance;
}
}
@@ -71,18 +68,20 @@ namespace FlaxEditor.CustomEditors.Editors
base.Initialize(layout);
if (XElement.ValueBox.Parent is UniformGridPanel ug)
+ {
+ ug.SlotPadding = new Margin(3.0f, 0.0f, 0.0f, 0.0f);
CheckLayout(ug);
+ }
// Override colors
- var back = FlaxEngine.GUI.Style.Current.TextBoxBackground;
- XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, AxisGreyOutFactor);
XElement.ValueBox.BorderSelectedColor = AxisColorX;
- XElement.ValueBox.Category = Utils.ValueCategory.Angle;
- YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, AxisGreyOutFactor);
YElement.ValueBox.BorderSelectedColor = AxisColorY;
- YElement.ValueBox.Category = Utils.ValueCategory.Angle;
- ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, AxisGreyOutFactor);
ZElement.ValueBox.BorderSelectedColor = AxisColorZ;
+ XElement.ValueBox.HighlightColor = AxisColorX;
+ XElement.ValueBox.Category = Utils.ValueCategory.Angle;
+ YElement.ValueBox.HighlightColor = AxisColorY;
+ YElement.ValueBox.Category = Utils.ValueCategory.Angle;
+ ZElement.ValueBox.HighlightColor = AxisColorZ;
ZElement.ValueBox.Category = Utils.ValueCategory.Angle;
}
}
@@ -129,17 +128,19 @@ namespace FlaxEditor.CustomEditors.Editors
}
if (XElement.ValueBox.Parent is UniformGridPanel ug)
+ {
+ ug.SlotPadding = new Margin(3.0f, 0.0f, 0.0f, 0.0f);
CheckLayout(ug);
+ }
// Override colors
var back = FlaxEngine.GUI.Style.Current.TextBoxBackground;
- var grayOutFactor = 0.6f;
- XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, grayOutFactor);
XElement.ValueBox.BorderSelectedColor = AxisColorX;
- YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, grayOutFactor);
YElement.ValueBox.BorderSelectedColor = AxisColorY;
- ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, grayOutFactor);
ZElement.ValueBox.BorderSelectedColor = AxisColorZ;
+ XElement.ValueBox.HighlightColor = AxisColorX;
+ YElement.ValueBox.HighlightColor = AxisColorY;
+ ZElement.ValueBox.HighlightColor = AxisColorZ;
}
///
diff --git a/Source/Editor/GUI/Input/ValueBox.cs b/Source/Editor/GUI/Input/ValueBox.cs
index 674ee0697..e619ac2e3 100644
--- a/Source/Editor/GUI/Input/ValueBox.cs
+++ b/Source/Editor/GUI/Input/ValueBox.cs
@@ -89,6 +89,11 @@ namespace FlaxEditor.GUI.Input
///
public bool IsSliding => _isSliding;
+ ///
+ /// The color of the highlight to the left of the value box.
+ ///
+ public Color HighlightColor;
+
///
/// Occurs when sliding starts.
///
@@ -206,6 +211,12 @@ namespace FlaxEditor.GUI.Input
Render2D.DrawRectangle(bounds, style.SelectionBorder);
}
}
+
+ if (HighlightColor != Color.Transparent)
+ {
+ var highlightRect = new Rectangle(-3.0f, 0.0f, 3.0f, Height);
+ Render2D.FillRectangle(highlightRect, HighlightColor);
+ }
}
///