-
Notifications
You must be signed in to change notification settings - Fork 635
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
Make side panel handles size to content #11057
Conversation
The handles for size panels were using a fixed size, which was not enough to fit some translated texts. The handles are now allowed to size to content by doing some extra gimnastics to rotate them in the right way.
@@ -1625,17 +1618,29 @@ | |||
Margin="5,5,5,5" | |||
RenderTransformOrigin="0.5, 0.5"> | |||
<Image.RenderTransform> | |||
<RotateTransform Angle="90" /> | |||
<RotateTransform Angle="-90" /> |
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.
Curious what this is for?
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.
That's for rotating a UI element. This is related to the gymnastics I mentioned. Since the rotation of the panel changed directions, this one needs to change as well.
Does the library handle look better as well with German characters? |
@aparajit-pratap Do you mean German characters not in English? I did not try, as the German translation did not have any for this case. Is there any particular text you would like to try? I can just write it literally in the control to try it |
Yes, I meant any language as long as it is a long string, just so we can manually check that the library handle resizes as expected. |
@mmisol Thanks taking a look now |
@mmisol Can you check the left side panel for me? Do we have similar issue there? |
@@ -1516,7 +1516,7 @@ | |||
VerticalAlignment="Top" | |||
Margin="0,310,0,0"> | |||
<Grid Background="#353535" | |||
Width="100" | |||
Width="Auto" |
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.
Seems this is the only changed needed to fix the left side?
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.
Yes. No further gymnastics required on that side.
Here is a longer example for the library side @QilongTang |
FontWeight="Normal" | ||
Margin="5,0,0,5" | ||
Text="{x:Static p:Resources.ExtensionsViewTitle}"> | ||
</TextBlock> |
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.
Curious why did we only move this textblock for the right side but keep the change for left?
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.
Without getting into much detail, the main difference is that the centre of the rotation is different for each side, which in turn requires to do things differently in order to show the handles as we expect them.
} | ||
} | ||
|
||
private void ExtensionHandle_MouseEnter(object sender, MouseEventArgs e) | ||
{ | ||
Grid g = (Grid)sender; |
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.
Should we check the type of sender
here is Grid
before doing all of the following?
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.
This part did not really change. I would say it is fine like this given it is an event handler, and as such should not be reused.
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.
LGTM with just a minor comment
Purpose
The handles for size panels were using a fixed size, which was not
enough to fit some translated texts. The handles are now allowed to
size to content by doing some extra gimnastics to rotate them in the
right way.
Here is a screenshot of how it looks with the German translation:
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@QilongTang @zeusongit
FYIs
@DynamoDS/dynamo