Fix UseNativeWindowSystem option to be Windows-only

This commit is contained in:
mafiesto4
2021-01-17 22:30:21 +01:00
committed by Wojtek Figat
parent f33a2d8fe5
commit 4bd76b70f2
5 changed files with 12 additions and 0 deletions

View File

@@ -61,7 +61,9 @@ namespace FlaxEditor.GUI
public MainMenu(RootControl mainWindow)
: base(0, 0, 0, 20)
{
#if PLATFORM_WINDOWS
_useCustomWindowSystem = !Editor.Instance.Options.Options.Interface.UseNativeWindowSystem;
#endif
AutoFocus = false;
AnchorPreset = AnchorPresets.HorizontalStretchTop;

View File

@@ -42,12 +42,14 @@ namespace FlaxEditor.GUI
Text = text;
var style = Style.Current;
#if PLATFORM_WINDOWS
if (Editor.Instance.Options.Options.Interface.UseNativeWindowSystem)
{
BackgroundColorMouseOver = style.BackgroundHighlighted;
BackgroundColorMouseOverOpened = style.Background;
}
else
#endif
{
BackgroundColorMouseOver = BackgroundColorMouseOverOpened = style.LightBackground * 1.3f;
}

View File

@@ -296,7 +296,9 @@ namespace FlaxEditor.Modules
InitDockPanel(mainWindow);
// Add dummy control for drawing the main window borders if using a custom style
#if PLATFORM_WINDOWS
if (!Editor.Options.Options.Interface.UseNativeWindowSystem)
#endif
{
mainWindow.AddChild(new CustomWindowBorderControl
{

View File

@@ -712,7 +712,9 @@ namespace FlaxEditor.Modules
settings.Size = new Vector2(1300 * dpiScale, 900 * dpiScale);
settings.StartPosition = WindowStartPosition.CenterScreen;
#if PLATFORM_WINDOWS
if (!Editor.Instance.Options.Options.Interface.UseNativeWindowSystem)
#endif
{
settings.HasBorder = false;
settings.HasSizingFrame = false;

View File

@@ -44,6 +44,8 @@ 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;
#if PLATFORM_WINDOWS
/// <summary>
/// Gets or sets a value indicating whether use native window title bar. Editor restart required.
/// </summary>
@@ -51,6 +53,8 @@ namespace FlaxEditor.Options
[EditorDisplay("Interface"), EditorOrder(70), Tooltip("Determines whether use native window title bar. Editor restart required.")]
public bool UseNativeWindowSystem { get; set; } = false;
#endif
/// <summary>
/// Gets or sets a value indicating whether show selected camera preview in the editor window.
/// </summary>