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

AdaptiveGridView fix when HorizontalAlignment is not stretch #1787

Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private void RecalculateLayout(double containerWidth)
if (containerWidth > 0)
{
var newWidth = CalculateItemWidth(containerWidth);
ItemWidth = Math.Floor(newWidth - 1);
ItemWidth = Math.Floor(newWidth);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this trying to prevent overlap or something? Do we need to adjust the left value of the next item?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmetulev Any reason you had the -1 in there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't do any layout with this control. We just set the height and width of the GridViewItem controls through binding to ItemHeight and ItemWidth

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another issue with scrollbars. Before:
image

After, the collapsible scrollbar is less noticeable as its margin isn't clear:
image

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's standard for lists in which the items span the entire width. Here's a standard GridView with similar settings
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, I hadn't been paying as much attention to the overlap until this set of changes. :)

}
}
}
Expand Down