diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs b/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs
index 247844659..402374a8e 100644
--- a/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs
+++ b/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs
@@ -47,6 +47,11 @@ namespace FlaxEditor.GUI.ContextMenu
private Window _window;
private Control _previouslyFocused;
+ ///
+ /// Gets a value indicating whether use automatic popup direction fix based on the screen dimensions.
+ ///
+ protected virtual bool UseAutomaticDirectionFix => true;
+
///
/// Returns true if context menu is opened
///
@@ -132,21 +137,24 @@ namespace FlaxEditor.GUI.ContextMenu
Rectangle monitorBounds = Platform.GetMonitorBounds(locationSS);
Vector2 rightBottomLocationSS = locationSS + dpiSize;
bool isUp = false, isLeft = false;
- if (monitorBounds.Bottom < rightBottomLocationSS.Y)
+ if (UseAutomaticDirectionFix)
{
- // Direction: up
- isUp = true;
- locationSS.Y -= dpiSize.Y;
+ if (monitorBounds.Bottom < rightBottomLocationSS.Y)
+ {
+ // Direction: up
+ isUp = true;
+ locationSS.Y -= dpiSize.Y;
- // Offset to fix sub-menu location
- if (parent is ContextMenu menu && menu._childCM != null)
- locationSS.Y += 30.0f * dpiScale;
- }
- if (monitorBounds.Right < rightBottomLocationSS.X)
- {
- // Direction: left
- isLeft = true;
- locationSS.X -= dpiSize.X;
+ // Offset to fix sub-menu location
+ if (parent is ContextMenu menu && menu._childCM != null)
+ locationSS.Y += 30.0f * dpiScale;
+ }
+ if (monitorBounds.Right < rightBottomLocationSS.X)
+ {
+ // Direction: left
+ isLeft = true;
+ locationSS.X -= dpiSize.X;
+ }
}
// Update direction flag
diff --git a/Source/Editor/GUI/Popups/RenamePopup.cs b/Source/Editor/GUI/Popups/RenamePopup.cs
index 834e620d9..c1da5dc3e 100644
--- a/Source/Editor/GUI/Popups/RenamePopup.cs
+++ b/Source/Editor/GUI/Popups/RenamePopup.cs
@@ -42,9 +42,6 @@ namespace FlaxEditor.GUI
///
/// Gets or sets the initial value.
///
- ///
- /// The initial value.
- ///
public string InitialValue
{
get => _startValue;
@@ -54,9 +51,6 @@ namespace FlaxEditor.GUI
///
/// Gets or sets the input field text.
///
- ///
- /// The text.
- ///
public string Text
{
get => _inputField.Text;
@@ -138,6 +132,9 @@ namespace FlaxEditor.GUI
Hide();
}
+ ///
+ protected override bool UseAutomaticDirectionFix => false;
+
///
public override bool OnKeyDown(KeyboardKeys key)
{