-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Inheritance Margin UI #52145
Inheritance Margin UI #52145
Conversation
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/InheritanceMargin.xaml
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/MultipleMembersMarginViewModel.cs
Outdated
Show resolved
Hide resolved
Why do those pictures look so weird? :-/ |
src/EditorFeatures/Core.Wpf/InheritanceMargin/InheritanceGlyphFactoryProvider.cs
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InheritanceMargin/InheritanceMarginTag.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/InheritanceMargin.xaml
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/InheritanceMargin.xaml.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/InheritanceMargin.xaml.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/InheritanceMargin.xaml.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/MemberDisplayViewModel.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/TargetDisplayViewModel.cs
Outdated
Show resolved
Hide resolved
That's why it is still WIP : ) |
<imaging:CrispImage x:Key="NonSharedIcon" x:Shared="False" Moniker="{Binding ImageMoniker}"/> | ||
|
||
<!-- Template copied from editor --> | ||
<ControlTemplate x:Key="ContextMenuTemplate" TargetType="{x:Type ContextMenu}"> |
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.
For whoever review the xaml, I copied some styles and control template from the editor light bulb style (which I believe orginally it is copied from shell), modified a little bit in order to fit our needs.
I choose this way because when I try to set the theme for each component in the context menu, I realized it would require breaking into the inner grid in the ControlTemplate, setting everything from scratch, and later on, I feel this is what the light bulb has done, and they also have proper margin and other property set aleady.
I really don't like this approach, so I am open to any other idea to implement this, if you know any vsct file magic or there is any good shell library that I don't know, please tell me and I am super happy to change this part.
The needs are:
- The MaxHeight could be set for the context menu or scrollViewer. So that if there are a lot of item in it, the.
- The context menu and menu item needs to be correctly themed according to VS.
- The context menu needs to be dynamically popped up.
- Submenu is needed.
- It needs to be shown when clicking the margin.
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.
Unfortunately I think the only thing to simplify would be to have styles inherit from known resource keys: https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.vsresourcekeys?view=visualstudiosdk-2019
I don't think it covers all of our needs though, and some customization would still be necessary
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.
Look into the doc and I feel the only usable resource key is scroll viewer. I have add that.
@CyrusNajmabadi @ryzngard |
@Cosifne have you done an accessibility pass for this? Need to run https://accessibilityinsights.io/ on various UI elements to make sure no major errors |
That gif is looking nice :) |
…sifne/roslyn into dev/shech/inheritanceMarginUI
|
9983629
to
2d4edce
Compare
src/EditorFeatures/Core.Wpf/InheritanceMargin/MarginGlyph/InheritanceMargin.xaml.cs
Outdated
Show resolved
Hide resolved
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.
Once the telemetry is fixed everything looks good to me
Add the UI for inheritance margin.
A general look:
If there is one member on the line:
If there are multiple members on the line:
Also works for VB
Works with the theme in VS (Using the dark theme)
If there are a lot of items in the pop up, it would use a scrollview to view them