Merge branch 'IconScaling' of git://github.com/DaveTheGameDev/FlaxEngine into DaveTheGameDev-IconScaling

This commit is contained in:
Wojtek Figat
2021-01-03 21:06:25 +01:00
3 changed files with 14 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Options;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -20,7 +21,7 @@ namespace FlaxEditor.GUI
/// <summary>
/// The default margin horizontally.
/// </summary>
public const int DefaultMarginH = 2;
public const int DefaultMarginH = 4;
/// <summary>
/// Event fired when button gets clicked.
@@ -63,13 +64,15 @@ namespace FlaxEditor.GUI
/// <summary>
/// Gets the height for the items.
/// </summary>
public float ItemsHeight => Height - 2 * DefaultMarginV;
public float ItemsHeight => Height + itemScale * DefaultMarginV;
private float itemScale;
/// <summary>
/// Initializes a new instance of the <see cref="ToolStrip"/> class.
/// </summary>
public ToolStrip()
{
itemScale = Style.Current.IconSizeExtra;
AutoFocus = false;
AnchorPreset = AnchorPresets.HorizontalStretchTop;
BackgroundColor = Style.Current.LightBackground;

View File

@@ -308,11 +308,12 @@ namespace FlaxEditor.Windows
/// <inheritdoc />
public override void OnInit()
{
float tabSize = 48 + Style.Current.IconSizeExtra;
TabsControl = new Tabs
{
AnchorPreset = AnchorPresets.StretchAll,
Offsets = Margin.Zero,
TabsSize = new Vector2(48, 48),
TabsSize = new Vector2(tabSize, tabSize),
Parent = this
};

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>