-
Notifications
You must be signed in to change notification settings - Fork 705
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
TabViewItem: Make background of the selected tab all one path #6282
Conversation
auto const leftCorner = popupRadius.TopLeft; | ||
auto const rightCorner = popupRadius.TopRight; | ||
|
||
// Assumes 4px curving-out corners, which are hardcoded in the markup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these really hardcoded? Couldn't the 4px be customized in XAML markup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the width/height of the LeftRadiusRenderArc and RightRadiusRenderArc, which I guess I could measure... the string is getting very unreadable/undebuggable, though. Is there a better way to construct this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave it as is for now, and if a request for customizability comes up, we can investigate at that point.
StringCchPrintf(strOut, ARRAYSIZE(strOut), data, | ||
height - 1, | ||
leftCorner, leftCorner, leftCorner, leftCorner, leftCorner, | ||
ActualWidth() - (leftCorner + rightCorner), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if ActualWidth is real small, like smaller than 8? Any issues there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't look right, that's for sure. The MinWidth of a TabViewItem is set to 100, though; it could be changed but I wouldn't expect tabs that small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - MinWidth is not likely to be 8 or smaller.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
auto const leftCorner = popupRadius.TopLeft; | ||
auto const rightCorner = popupRadius.TopRight; | ||
|
||
// Assumes 4px curving-out corners, which are hardcoded in the markup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave it as is for now, and if a request for customizability comes up, we can investigate at that point.
StringCchPrintf(strOut, ARRAYSIZE(strOut), data, | ||
height - 1, | ||
leftCorner, leftCorner, leftCorner, leftCorner, leftCorner, | ||
ActualWidth() - (leftCorner + rightCorner), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - MinWidth is not likely to be 8 or smaller.
Instead of having the selected tab be composed of 3 parts (LeftRadiusRenderTriangle, TabContainer, RightRadiusRenderTriangle) which often do not abut properly in high DPI, I'm setting the tab background to be a single path (SelectedBackgroundPath), which is set from code and updated whenever the size of the TabViewItem updates. Fixes #5954.