Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Window IsMovable #206

Merged
merged 3 commits into from
May 8, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Myra/Graphics2D/UI/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Window : SingleItemContainer<VerticalStackPanel>, IContent
private readonly Label _titleLabel;
private Widget _content;
private Widget _previousMouseWheelFocus;
private bool _isMovable = false;

[Category("Appearance")]
public string Title
Expand Down Expand Up @@ -121,6 +122,10 @@ public bool Result
get; set;
}

[Category("Appearance")]
bernatvadell marked this conversation as resolved.
Show resolved Hide resolved
[DefaultValue(true)]
public bool IsMovable { get => _isMovable; set => _isMovable = value; }

[DefaultValue(HorizontalAlignment.Left)]
public override HorizontalAlignment HorizontalAlignment
{
Expand Down Expand Up @@ -259,7 +264,7 @@ public void CenterOnDesktop()

private void DesktopOnTouchMoved(object sender, EventArgs args)
{
if (_startPos == null)
if (_startPos == null || !IsMovable)
{
return;
}
Expand Down