Skip to content

Commit

Permalink
SLVS-1467 Fix icons not visible on dark theme (#5706)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriela-trutan-sonarsource committed Sep 27, 2024
1 parent 05b8956 commit 2918f18
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 22 deletions.
6 changes: 6 additions & 0 deletions src/ConnectedMode/ConnectedMode.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
<None Remove="UI\ManageBinding\ManageBindingDialog.xaml" />
<None Remove="UI\Credentials\CredentialsDialog.xaml" />
<None Remove="UI\ProgressAndErrorReporterComponent.xaml" />
<None Remove="UI\Resources\CheckImage.xaml" />
<None Remove="UI\Resources\LogoImages.xaml" />
<None Remove="UI\Resources\sonarlint_32px.ico" />
<None Remove="UI\Resources\Styles.xaml" />
<None Remove="UI\Resources\TrashCanImage.xaml" />
<None Remove="UI\ServerSelection\ServerSelectionDialog.xaml" />
<Resource Include="UI\Resources\sonarlint_32px.ico">
<CopyToOutputDirectory></CopyToOutputDirectory>
Expand All @@ -64,10 +66,14 @@
</Page>
<Page Include="UI\ManageBinding\ManageBindingDialog.xaml" />
<Page Include="UI\DeleteConnection\DeleteConnectionDialog.xaml" />
<Page Include="UI\Resources\CheckImage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI\Resources\Styles.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI\Resources\LogoImages.xaml" />
<Page Include="UI\Resources\TrashCanImage.xaml" />
<Page Include="UI\WarningMessage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down
41 changes: 20 additions & 21 deletions src/ConnectedMode/UI/ManageBinding/ManageBindingDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/SonarLint.VisualStudio.ConnectedMode;component/UI/Resources/Styles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/SonarLint.VisualStudio.ConnectedMode;component/UI/Resources/CheckImage.xaml"/>
</ResourceDictionary.MergedDictionaries>
<wpf:BoolToVisibilityConverter x:Key="TrueToVisibleConverter" FalseValue="Collapsed" TrueValue="Visible"/>
<wpf:BoolToVisibilityConverter x:Key="TrueToCollapsedConverter" FalseValue="Visible" TrueValue="Collapsed"/>
Expand All @@ -35,7 +36,7 @@

<GroupBox Grid.Row="0" Header="{x:Static res:UiResources.BindingStatusLabel}">
<Grid>
<Grid VerticalAlignment="Center" Visibility="{Binding Path=IsCurrentProjectBound, Converter={StaticResource TrueToCollapsedConverter}}">
<Grid VerticalAlignment="Center" Margin="10,0" Visibility="{Binding Path=IsCurrentProjectBound, Converter={StaticResource TrueToCollapsedConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
Expand All @@ -47,31 +48,29 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<imaging:CrispImage Grid.Column="0" Width="20" Height="20" VerticalAlignment="Center" Margin="10, 0"
Moniker="{x:Static vsimagecatalog:KnownMonikers.Close}"/>
<TextBlock Grid.Column="1" FontSize="{DynamicResource {x:Static vsShell:VsFonts.Environment155PercentFontSizeKey}}">
<Run Text="{Binding Path=SolutionInfo.SolutionType, StringFormat='{}{0} '}"/>
<Run Text="{Binding Path=SolutionInfo.Name, StringFormat='{}&quot;{0}&quot; '}" FontWeight="DemiBold"/>
<Run Text="{x:Static res:UiResources.IsNotBoundText}"/>
</TextBlock>
</Grid>

<Button Grid.Column="1" HorizontalAlignment="Right" Content="{x:Static res:UiResources.UseSharedBindingButton}" Padding="5,0"
IsEnabled="{Binding Path=IsUseSharedBindingButtonEnabled}"
Visibility="{Binding Path=IsUseSharedBindingButtonVisible, Converter={StaticResource TrueToVisibleConverter}}"
ToolTipService.ShowOnDisabled="True"
Click="UseSharedBinding_OnClick">
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsSharedBindingConfigurationDetected}" Value="False">
<Setter Property="ToolTip" Value="{x:Static res:UiResources.SharedBindingConfigurationTooltip}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>
<Button Grid.Column="1" HorizontalAlignment="Right" Content="{x:Static res:UiResources.UseSharedBindingButton}" Padding="5,0"
IsEnabled="{Binding Path=IsUseSharedBindingButtonEnabled}"
Visibility="{Binding Path=IsUseSharedBindingButtonVisible, Converter={StaticResource TrueToVisibleConverter}}"
ToolTipService.ShowOnDisabled="True"
Click="UseSharedBinding_OnClick">
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsSharedBindingConfigurationDetected}" Value="False">
<Setter Property="ToolTip" Value="{x:Static res:UiResources.SharedBindingConfigurationTooltip}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>

<Grid VerticalAlignment="Center" Visibility="{Binding Path=IsCurrentProjectBound, Converter={StaticResource TrueToVisibleConverter}}">
<Grid.ColumnDefinitions>
Expand All @@ -85,8 +84,8 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<imaging:CrispImage Grid.Column="0" Width="20" Height="20" VerticalAlignment="Center" Margin="10, 0,10,-5"
Moniker="{x:Static vsimagecatalog:KnownMonikers.Checkmark}"/>
<Image Grid.Column="0" Width="20" Height="20" VerticalAlignment="Center" Margin="10, 0,10,0"
Source="{StaticResource CheckDrawingImage}"/>
<TextBlock Grid.Column="1" Margin="5,0" FontSize="{DynamicResource {x:Static vsShell:VsFonts.Environment155PercentFontSizeKey}}">
<Run Text="{Binding Path=SolutionInfo.SolutionType, StringFormat='{}{0} '}"/>
<Run Text="{Binding Path=SolutionInfo.Name, StringFormat='{}&quot;{0}&quot; '}" FontWeight="DemiBold"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/SonarLint.VisualStudio.ConnectedMode;component/UI/Resources/Styles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/SonarLint.VisualStudio.ConnectedMode;component/UI/Resources/LogoImages.xaml" />
<ResourceDictionary Source="pack://application:,,,/SonarLint.VisualStudio.ConnectedMode;component/UI/Resources/TrashCanImage.xaml" />
</ResourceDictionary.MergedDictionaries>
<wpf:BoolToVisibilityConverter x:Key="TrueToVisibleConverter" FalseValue="Collapsed" TrueValue="Visible"/>
</ResourceDictionary>
Expand Down Expand Up @@ -96,7 +97,7 @@
Margin="10,0" />
</Button>
<Button Grid.Column="1" Style="{StaticResource IconButtonStyle}" ToolTip="{x:Static res:UiResources.RemoveConnectionToolTip}" Click="RemoveConnectionButton_OnClick">
<imaging:CrispImage Width="20" Height="20" VerticalAlignment="Center" Cursor="Hand" Moniker="{x:Static vsimagecatalog:KnownMonikers.Close}"/>
<Image VerticalAlignment="Center" Cursor="Hand" Source="{StaticResource TrashCanDrawingImage}"/>
</Button>
</Grid>
</Grid>
Expand Down
12 changes: 12 additions & 0 deletions src/ConnectedMode/UI/Resources/CheckImage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<DrawingImage x:Key="CheckDrawingImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<DrawingGroup Opacity="1">
<GeometryDrawing Brush="#FF1F801F" Geometry="F1 M16,16z M0,0z M6.568,14.5L5.826,14.5 2.326,10.487 3.079,9.829 6.216,13.413 14.271,5.133 15,5.816z" />
</DrawingGroup>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</ResourceDictionary>
18 changes: 18 additions & 0 deletions src/ConnectedMode/UI/Resources/TrashCanImage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<DrawingImage x:Key="TrashCanDrawingImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<DrawingGroup Opacity="1">
<GeometryDrawing Geometry="F1 M16,16z M0,0z M12.5,2.5L12.5,15.5 2.5,15.5 2.5,2.5z">
<GeometryDrawing.Brush>
<SolidColorBrush Color="Transparent" Opacity="0.1" />
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing Brush="#cc0000" Geometry="F1 M16,16z M0,0z M14,2L10,2 10,1A1,1,0,0,0,9,0L6,0A1,1,0,0,0,5,1L5,2 1,2 1,3 2,3 2,15.5 2.5,16 12.5,16 13,15.5 13,3 14,3z M6,1L9,1 9,2 6,2z M12,15L3,15 3,3 12,3z M5,13L5,5 6,5 6,13z M10,13L9,13 9,5 10,5z M8,13L7,13 7,5 8,5z" />
</DrawingGroup>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>

</ResourceDictionary>

0 comments on commit 2918f18

Please sign in to comment.