Move icon settings to styles

This commit is contained in:
David Conway
2020-12-24 19:52:06 +11:00
parent 16fab80f86
commit c0cc89201e
4 changed files with 11 additions and 19 deletions

View File

@@ -64,15 +64,15 @@ namespace FlaxEditor.GUI
/// <summary>
/// Gets the height for the items.
/// </summary>
public float ItemsHeight => Height - itemScale * DefaultMarginV;
public float ItemsHeight => Height + itemScale * DefaultMarginV;
private float itemScale = 2;
/// <summary>
private float itemScale;
/// <summarys
/// Initializes a new instance of the <see cref="ToolStrip"/> class.
/// </summary>
public ToolStrip()
{
itemScale = Editor.Instance.Options.Options.Interface.ToolStripScale;
itemScale = Style.Current.IconSizeExtra;
AutoFocus = false;
AnchorPreset = AnchorPresets.HorizontalStretchTop;
BackgroundColor = Style.Current.LightBackground;

View File

@@ -44,20 +44,6 @@ namespace FlaxEditor.Options
[EditorDisplay("Interface"), EditorOrder(10), Tooltip("Editor User Interface scale. Applied to all UI elements, windows and text. Can be used to scale the interface up on a bigger display. Editor restart required.")]
public float InterfaceScale { get; set; } = 1.0f;
/// <summary>
/// Gets or sets the ToolStrip item scale. Applied to ToolStrip UI elements, windows and text. Can be used to scale the toolstrip size to fit display needs. Editor restart required..
/// </summary>
[DefaultValue(2.0f), Limit(1f, 10.0f)]
[EditorDisplay("Interface"), EditorOrder(20), Tooltip("Editor ToolStrip scale. Applied to ToolStrip UI elements, windows and text. Can be used to scale the toolstrip size to fit display needs. Editor restart required.")]
public float ToolStripScale { get; set; } = 2.0f;
/// <summary>
/// Gets or sets the ToolBox Icon scale. Editor ToolBox Icon scale. Applied to ToolBox Icon UI elements. Can be used to scale the toolbox icon size to fit display needs. Editor restart required.
/// </summary>
[DefaultValue(32.0f), Limit(1f, 64.0f)]
[EditorDisplay("Interface"), EditorOrder(30), Tooltip("Editor ToolBox Icon scale. Applied to ToolBox Icon UI elements. Can be used to scale the toolbox icon size to fit display needs. Editor restart required.")]
public float ToolBoxIconScale { get; set; } = 32.0f;
/// <summary>
/// Gets or sets a value indicating whether use native window title bar. Editor restart required.
/// </summary>

View File

@@ -308,7 +308,7 @@ namespace FlaxEditor.Windows
/// <inheritdoc />
public override void OnInit()
{
float tabSize = Editor.Options.Options.Interface.ToolBoxIconScale;
float tabSize = 48 + Style.Current.IconSizeExtra;
TabsControl = new Tabs
{
AnchorPreset = AnchorPresets.StretchAll,

View File

@@ -68,6 +68,12 @@ namespace FlaxEngine.GUI
set => _fontSmall = new FontReference(value);
}
/// <summary>
/// Size of toolbar icons
/// </summary>
[EditorOrder(50)]
public int IconSizeExtra;
/// <summary>
/// The background color.
/// </summary>