Merge branch 'IconScaling' of git://github.com/DaveTheGameDev/FlaxEngine into DaveTheGameDev-IconScaling
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user