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

ArrangementMode.Resizable should honor Dim.Auto (min/maxContentSize) #3782

Open
tig opened this issue Oct 8, 2024 · 0 comments
Open

ArrangementMode.Resizable should honor Dim.Auto (min/maxContentSize) #3782

tig opened this issue Oct 8, 2024 · 0 comments
Labels
Milestone

Comments

@tig
Copy link
Collaborator

tig commented Oct 8, 2024

If a View is set like this:

var view = new Window () // movable & resizable
{
  Width = Dim.Auto (Content, minimumContentSize: 10, maximumContentSize: 20);
}

I should not be able to resize the View to be any smaller than 10 + adornments or larger than 20 + adornments.

The current code is blind to DimAuto and just overwrites:

                   case ViewArrangement.LeftResizable:
                       // Get how much the mouse has moved since the start of the drag
                       // and adjust the height of the parent by that amount
                       int deltaX = parentLoc.X - Parent.Frame.X;
                       int newWidth = Math.Max (minWidth, Parent.Frame.Width - deltaX);

                       if (newWidth != Parent.Frame.Width)
                       {
                           Parent.Width = newWidth;
                           Parent.X = parentLoc.X - _startGrabPoint.X;
                       }

                       break;

I think there's a way to do this...

@tig tig added the bug label Oct 8, 2024
@tig tig added this to the V2 Release milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant