Apply global editor bindings in most windows

This commit is contained in:
2023-09-23 15:21:57 +03:00
parent 52cf4df641
commit 385c3541c9
6 changed files with 10 additions and 9 deletions

View File

@@ -129,6 +129,8 @@ namespace FlaxEditor.Windows
Title = "Content";
Icon = editor.Icons.Folder32;
FlaxEditor.Utilities.Utils.SetupCommonInputActions(this);
// Content database events
editor.ContentDatabase.WorkspaceModified += () => _isWorkspaceDirty = true;
editor.ContentDatabase.ItemRemoved += OnContentDatabaseItemRemoved;

View File

@@ -317,6 +317,7 @@ namespace FlaxEditor.Windows
Title = "Debug Log";
Icon = IconInfo;
OnEditorOptionsChanged(Editor.Options.Options);
FlaxEditor.Utilities.Utils.SetupCommonInputActions(this);
// Toolstrip
var toolstrip = new ToolStrip(22.0f)

View File

@@ -271,6 +271,8 @@ namespace FlaxEditor.Windows
Title = "Game";
AutoFocus = true;
FlaxEditor.Utilities.Utils.SetupCommonInputActions(this);
var task = MainRenderTask.Instance;
// Setup viewport
@@ -302,13 +304,6 @@ namespace FlaxEditor.Windows
// Link editor options
Editor.Options.OptionsChanged += OnOptionsChanged;
OnOptionsChanged(Editor.Options.Options);
InputActions.Add(options => options.Play, Editor.Simulation.DelegatePlayOrStopPlayInEditor);
InputActions.Add(options => options.Pause, Editor.Simulation.RequestResumeOrPause);
InputActions.Add(options => options.StepFrame, Editor.Simulation.RequestPlayOneFrame);
InputActions.Add(options => options.ProfilerWindow, () => Editor.Windows.ProfilerWin.FocusOrShow());
InputActions.Add(options => options.ProfilerStartStop, () => { Editor.Windows.ProfilerWin.LiveRecording = !Editor.Windows.ProfilerWin.LiveRecording; Editor.UI.AddStatusMessage($"Profiling {(Editor.Windows.ProfilerWin.LiveRecording ? "started" : "stopped")}."); });
InputActions.Add(options => options.ProfilerClear, () => { Editor.Windows.ProfilerWin.Clear(); Editor.UI.AddStatusMessage($"Profiling results cleared."); });
}
private void ChangeViewportRatio(ViewportScaleOptions v)

View File

@@ -150,6 +150,7 @@ namespace FlaxEditor.Windows
{
Title = "Output Log";
ClipChildren = false;
FlaxEditor.Utilities.Utils.SetupCommonInputActions(this);
// Setup UI
_viewDropdown = new Button(2, 2, 40.0f, TextBoxBase.DefaultHeight)

View File

@@ -117,9 +117,9 @@ namespace FlaxEditor.Windows.Profiler
};
_tabs.SelectedTabChanged += OnSelectedTabChanged;
FlaxEditor.Utilities.Utils.SetupCommonInputActions(this);
InputActions.Bindings.RemoveAll(x => x.Callback == this.FocusOrShow);
InputActions.Add(options => options.ProfilerWindow, Hide);
InputActions.Add(options => options.ProfilerStartStop, () => LiveRecording = !LiveRecording);
InputActions.Add(options => options.ProfilerClear, Clear);
}
/// <summary>

View File

@@ -353,6 +353,8 @@ namespace FlaxEditor.Windows
: base(editor, true, ScrollBars.None)
{
Title = "Toolbox";
FlaxEditor.Utilities.Utils.SetupCommonInputActions(this);
}
/// <inheritdoc />