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

Always specify Image width/height for glyphs sourced from IGlyphService #76935

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
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
22 changes: 20 additions & 2 deletions src/VisualStudio/Core/Def/CommonControls/MemberSelection.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:utilities="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.Utilities" xmlns:commoncontrols="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.CommonControls"
xmlns:utilities="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.Utilities"
xmlns:commoncontrols="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.CommonControls"
xmlns:platformimaging="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging"
xmlns:vsutil="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Utilities"
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
mc:Ignorable="d"
xmlns:vsui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
platformimaging:ImageThemingUtilities.ImageBackgroundColor="{DynamicResource VsColor.ToolWindowBackground}"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
Expand All @@ -18,6 +23,7 @@
<Thickness x:Key="ButtonControlsPadding">2, 4, 4, 2</Thickness>
<utilities:BooleanReverseConverter x:Key="BooleanReverseConverter"/>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<platformimaging:ThemedImageSourceConverter x:Uid="ThemedImageSourceConverter" x:Key="ThemedImageSourceConverter" />
</ResourceDictionary>
</UserControl.Resources>
<Grid>
Expand Down Expand Up @@ -96,7 +102,19 @@
<Image
x:Name="GlyphOfMember"
Margin="8, 0, 5, 0"
Source="{Binding Glyph}"/>
Width="16"
Height="16">
<Image.Source>
<MultiBinding x:Uid="MultiBinding_1" Converter="{StaticResource ThemedImageSourceConverter}">
<Binding x:Uid="Binding_1" Path="Glyph" />
<Binding
x:Uid="Binding_2"
Path="(platformimaging:ImageThemingUtilities.ImageBackgroundColor)"
RelativeSource="{RelativeSource Self}" />
<Binding x:Uid="Binding_3" Source="{x:Static vsutil:Boxes.BooleanTrue}" />
</MultiBinding>
</Image.Source>
</Image>
<TextBlock
x:Name="MemberName"
Text="{Binding SymbolName}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
<Image
x:Name="GlyphOfMember"
Margin="8, 0, 5, 0"
Source="{Binding Glyph}"/>
Source="{Binding Glyph}"
Width="16"
Height="16"/>
<TextBlock
x:Name="MemberName"
Text="{Binding SymbolName}"
Expand Down
21 changes: 18 additions & 3 deletions src/VisualStudio/Core/Def/PickMembers/PickMembersDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
xmlns:imagecatalog="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.ImageCatalog"
xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:platformimaging="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging"
xmlns:vsutil="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Utilities"
mc:Ignorable="d"
d:DesignHeight="380" d:DesignWidth="460"
Height="380" Width="460"
Expand Down Expand Up @@ -41,6 +42,7 @@
<vs:NegateBooleanConverter x:Key="NegateBooleanConverter"/>
<RoutedUICommand x:Key="MoveUp" />
<RoutedUICommand x:Key="MoveDown" />
<platformimaging:ThemedImageSourceConverter x:Uid="ThemedImageSourceConverter" x:Key="ThemedImageSourceConverter" />
</Window.Resources>
<Window.CommandBindings>
<CommandBinding Command="{StaticResource MoveUp}" Executed="MoveUp_Click" />
Expand Down Expand Up @@ -95,9 +97,22 @@
Focusable="False"
AutomationProperties.AutomationId="{Binding SymbolName}">
</CheckBox>
<Image x:Uid="SelectableMemberGlyph"
Margin="8,0,0,0"
Source="{Binding Glyph}"/>
<Image
x:Uid="SelectableMemberGlyph"
Margin="8,0,0,0"
Width="16"
Height="16">
<Image.Source>
<MultiBinding x:Uid="MultiBinding_1" Converter="{StaticResource ThemedImageSourceConverter}">
<Binding x:Uid="Binding_1" Path="Glyph" />
<Binding
x:Uid="Binding_2"
Path="(platformimaging:ImageThemingUtilities.ImageBackgroundColor)"
RelativeSource="{RelativeSource Self}" />
<Binding x:Uid="Binding_3" Source="{x:Static vsutil:Boxes.BooleanTrue}" />
</MultiBinding>
</Image.Source>
</Image>
<TextBlock x:Uid="SelectableMemberName"
Text="{Binding SymbolName}"/>
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
x:Name="dialog"
x:Class="Microsoft.VisualStudio.LanguageServices.Implementation.PullMemberUp.MainDialog.PullMemberUpDialog"
x:ClassModifier="internal"
xmlns:platformimaging="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging"
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:vsutil="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Utilities"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand All @@ -21,7 +23,8 @@
ShowInTaskbar="False"
ResizeMode="CanResizeWithGrip"
Title="{Binding ElementName=dialog, Path=PullMembersUpTitle}"
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}">
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
platformimaging:ImageThemingUtilities.ImageBackgroundColor="{StaticResource {x:Static vsshell:VsColors.ToolWindowBackgroundKey}}">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand All @@ -48,6 +51,7 @@
</Trigger>
</Style.Triggers>
</Style>
<platformimaging:ThemedImageSourceConverter x:Uid="ThemedImageSourceConverter" x:Key="ThemedImageSourceConverter" />
</ResourceDictionary>
</Window.Resources>
<Grid Margin="12">
Expand Down Expand Up @@ -90,7 +94,21 @@
HorizontalAlignment="Stretch"
Focusable="False"
VerticalAlignment="Stretch">
<Image Source="{Binding Glyph}" Margin="0, 0, 5, 0" />
<Image
Margin="0, 0, 5, 0"
Width="16"
Height="16">
<Image.Source>
<MultiBinding x:Uid="MultiBinding_1" Converter="{StaticResource ThemedImageSourceConverter}">
<Binding x:Uid="Binding_1" Path="Glyph" />
<Binding
x:Uid="Binding_2"
Path="(platformimaging:ImageThemingUtilities.ImageBackgroundColor)"
RelativeSource="{RelativeSource Self}" />
<Binding x:Uid="Binding_3" Source="{x:Static vsutil:Boxes.BooleanTrue}" />
</MultiBinding>
</Image.Source>
</Image>
<TextBlock
x:Uid="DestinationTextBlock"
Text="{Binding SymbolName}"
Expand Down
20 changes: 19 additions & 1 deletion src/VisualStudio/Core/Def/ValueTracking/ValueTrackingTree.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Microsoft.VisualStudio.LanguageServices.ValueTracking"
xmlns:utils="clr-namespace:Microsoft.VisualStudio.LanguageServices.Utilities"
xmlns:platformimaging="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging"
xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:vsutil="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Utilities"
mc:Ignorable="d"
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
platformimaging:ImageThemingUtilities.ImageBackgroundColor="{StaticResource {x:Static vsshell:VsColors.ToolWindowBackgroundKey}}"
d:DesignHeight="450" d:DesignWidth="800"
x:Name="control">

<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<platformimaging:ThemedImageSourceConverter x:Uid="ThemedImageSourceConverter" x:Key="ThemedImageSourceConverter" />
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -59,7 +64,20 @@
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:TreeItemViewModel}" ItemsSource="{Binding ChildItems}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding GlyphImage}" />
<Image
Width="16"
Height="16">
<Image.Source>
<MultiBinding x:Uid="MultiBinding_1" Converter="{StaticResource ThemedImageSourceConverter}">
<Binding x:Uid="Binding_1" Path="GlyphImage" />
<Binding
x:Uid="Binding_2"
Path="(platformimaging:ImageThemingUtilities.ImageBackgroundColor)"
RelativeSource="{RelativeSource Self}" />
<Binding x:Uid="Binding_3" Source="{x:Static vsutil:Boxes.BooleanTrue}" />
</MultiBinding>
</Image.Source>
</Image>
<utils:BindableTextBlock InlineCollection="{Binding Inlines}" Margin="0 0 5 0" />
</StackPanel>
</HierarchicalDataTemplate>
Expand Down
Loading