From 489672d3466392a356445196541fd320e19df4cb Mon Sep 17 00:00:00 2001 From: mafiesto4 Date: Tue, 16 Feb 2021 18:46:37 +0100 Subject: [PATCH] Fix warning when building editor for linux --- Source/Editor/GUI/MainMenu.cs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Source/Editor/GUI/MainMenu.cs b/Source/Editor/GUI/MainMenu.cs index 9a2e7ac21..0e5bb54b2 100644 --- a/Source/Editor/GUI/MainMenu.cs +++ b/Source/Editor/GUI/MainMenu.cs @@ -12,14 +12,16 @@ namespace FlaxEditor.GUI /// public sealed class MainMenu : ContainerControl { +#if PLATFORM_WINDOWS private bool _useCustomWindowSystem; private Image _icon; private Label _title; - private MainMenuButton _selected; private Button _closeButton; private Button _minimizeButton; private Button _maximizeButton; private Window _window; +#endif + private MainMenuButton _selected; /// /// Gets or sets the selected button (with opened context menu). @@ -61,12 +63,11 @@ 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; +#if PLATFORM_WINDOWS + _useCustomWindowSystem = !Editor.Instance.Options.Options.Interface.UseNativeWindowSystem; if (_useCustomWindowSystem) { BackgroundColor = Style.Current.LightBackground; @@ -160,11 +161,13 @@ namespace FlaxEditor.GUI }; } else +#endif { BackgroundColor = Style.Current.LightBackground; } } +#if PLATFORM_WINDOWS /// public override void Update(float deltaTime) { @@ -234,6 +237,7 @@ namespace FlaxEditor.GUI return WindowHitCodes.Client; } +#endif /// /// Return the rightmost button. @@ -287,6 +291,7 @@ namespace FlaxEditor.GUI if (base.OnMouseDoubleClick(location, button)) return true; +#if PLATFORM_WINDOWS if (_useCustomWindowSystem) { if (_window.IsMaximized) @@ -294,6 +299,7 @@ namespace FlaxEditor.GUI else _window.Maximize(); } +#endif return true; } @@ -303,6 +309,7 @@ namespace FlaxEditor.GUI { float x = 0; +#if PLATFORM_WINDOWS if (_useCustomWindowSystem) { // Icon @@ -310,6 +317,7 @@ namespace FlaxEditor.GUI _icon.Size = new Vector2(Height); x += _icon.Width; } +#endif // Arrange controls MainMenuButton rightMostButton = null; @@ -329,6 +337,7 @@ namespace FlaxEditor.GUI } } +#if PLATFORM_WINDOWS if (_useCustomWindowSystem) { // Buttons @@ -343,8 +352,10 @@ namespace FlaxEditor.GUI _title.Bounds = new Rectangle(x + 2, 0, _minimizeButton.Left - x - 4, Height); //_title.Text = _title.Width < 300.0f ? Editor.Instance.ProjectInfo.Name : _window.Title; } +#endif } +#if PLATFORM_WINDOWS /// public override void OnDestroy() { @@ -356,5 +367,6 @@ namespace FlaxEditor.GUI OnWindowClosed(); } } +#endif } }