diff --git a/src/Myra/Graphics2D/UI/Window.cs b/src/Myra/Graphics2D/UI/Window.cs index ffbe1bc1..bc91bbe6 100644 --- a/src/Myra/Graphics2D/UI/Window.cs +++ b/src/Myra/Graphics2D/UI/Window.cs @@ -33,6 +33,7 @@ public class Window : SingleItemContainer, IContent private readonly Label _titleLabel; private Widget _content; private Widget _previousMouseWheelFocus; + private bool _isMovable = false; [Category("Appearance")] public string Title @@ -121,6 +122,10 @@ public bool Result get; set; } + [Category("Behavior")] + [DefaultValue(true)] + public bool IsMovable { get => _isMovable; set => _isMovable = value; } + [DefaultValue(HorizontalAlignment.Left)] public override HorizontalAlignment HorizontalAlignment { @@ -259,7 +264,7 @@ public void CenterOnDesktop() private void DesktopOnTouchMoved(object sender, EventArgs args) { - if (_startPos == null) + if (_startPos == null || !IsMovable) { return; }