|
8 | 8 | xmlns:controls="clr-namespace:Rubberduck.UI.Controls"
|
9 | 9 | xmlns:themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
|
10 | 10 | xmlns:converters="clr-namespace:Rubberduck.UI.Converters"
|
| 11 | + xmlns:codeExplorerConverters="clr-namespace:Rubberduck.UI.CodeExplorer.Converters" |
11 | 12 | ResxExtension.DefaultResxName="Rubberduck.UI.RubberduckUI"
|
12 | 13 | Language="{UICulture}"
|
13 | 14 | Name="CodeExplorer"
|
|
32 | 33 |
|
33 | 34 | <BooleanToVisibilityConverter x:Key="BoolToVisibility"/>
|
34 | 35 | <converters:BoolToHiddenVisibilityConverter x:Key="BoolToHiddenVisibility" />
|
| 36 | + <codeExplorerConverters:StringHasValueToVisibilityConverter x:Key="StringHasValueToVisibility" /> |
| 37 | + <codeExplorerConverters:StringHasNoValueToVisibilityConverter x:Key="StringHasNoValueToVisibility" /> |
35 | 38 |
|
36 | 39 | <LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" EndPoint="0,1" StartPoint="0,0">
|
37 | 40 | <GradientStop Color="#FFD9F4FF" Offset="0"/>
|
|
286 | 289 | </Setter>
|
287 | 290 | </Style>
|
288 | 291 |
|
| 292 | + <Style x:Key="XButtonStyle" TargetType="Button"> |
| 293 | + <Setter Property="Background" Value="Transparent"/> |
| 294 | + <Setter Property="BorderThickness" Value="0"/> |
| 295 | + <Setter Property="HorizontalContentAlignment" Value="Center"/> |
| 296 | + <Setter Property="VerticalContentAlignment" Value="Center"/> |
| 297 | + <Setter Property="Template"> |
| 298 | + <Setter.Value> |
| 299 | + <ControlTemplate TargetType="Button"> |
| 300 | + <Grid> |
| 301 | + <VisualStateManager.VisualStateGroups> |
| 302 | + <VisualStateGroup x:Name="CommonStates"> |
| 303 | + <VisualState x:Name="Normal"/> |
| 304 | + <VisualState x:Name="MouseOver"> |
| 305 | + <Storyboard> |
| 306 | + <ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="PaleGoldenrod"/> |
| 307 | + <DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity" To="1"/> |
| 308 | + </Storyboard> |
| 309 | + </VisualState> |
| 310 | + <VisualState x:Name="Pressed"> |
| 311 | + <Storyboard> |
| 312 | + <ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="PaleGoldenrod"/> |
| 313 | + <DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity" To="1"/> |
| 314 | + </Storyboard> |
| 315 | + </VisualState> |
| 316 | + </VisualStateGroup> |
| 317 | + <VisualStateGroup x:Name="FocusStates"> |
| 318 | + <VisualState x:Name="Focused"> |
| 319 | + <Storyboard> |
| 320 | + <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1"/> |
| 321 | + </Storyboard> |
| 322 | + </VisualState> |
| 323 | + <VisualState x:Name="Unfocused" /> |
| 324 | + </VisualStateGroup> |
| 325 | + </VisualStateManager.VisualStateGroups> |
| 326 | + <Border x:Name="Background" CornerRadius="3" Background="White" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"> |
| 327 | + <Grid Background="{TemplateBinding Background}" Margin="1"> |
| 328 | + <Border Opacity="0" x:Name="BackgroundAnimation" Background="PaleGoldenrod" /> |
| 329 | + </Grid> |
| 330 | + </Border> |
| 331 | + <ContentPresenter |
| 332 | + x:Name="contentPresenter" |
| 333 | + Content="{TemplateBinding Content}" |
| 334 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 335 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 336 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 337 | + Margin="{TemplateBinding Padding}"/> |
| 338 | + <Rectangle x:Name="DisabledVisualElement" RadiusX="3" RadiusY="3" Fill="#FFFFFFFF" Opacity="0" IsHitTestVisible="false" /> |
| 339 | + <Rectangle x:Name="FocusVisualElement" RadiusX="2" RadiusY="2" Margin="1" Stroke="PaleGoldenrod" StrokeThickness="1" Opacity="0" IsHitTestVisible="false" /> |
| 340 | + </Grid> |
| 341 | + </ControlTemplate> |
| 342 | + </Setter.Value> |
| 343 | + </Setter> |
| 344 | + </Style> |
289 | 345 | </ResourceDictionary>
|
290 | 346 | </UserControl.Resources>
|
291 | 347 |
|
|
435 | 491 | </ToolBarTray>
|
436 | 492 |
|
437 | 493 | <TextBox Grid.Row="1" TextChanged="SearchBox_OnTextChanged" VerticalContentAlignment="Center" Name="SearchBox"></TextBox>
|
438 |
| - <Image Grid.Row="1" Source="{StaticResource SearchImage}" HorizontalAlignment="Right" VerticalAlignment="Center" MaxHeight="16" Margin="0,0,1,0" MouseDown="SearchIcon_OnMouseDown" /> |
439 |
| - |
| 494 | + <Image Grid.Row="1" Source="{StaticResource SearchImage}" HorizontalAlignment="Right" VerticalAlignment="Center" MaxHeight="16" Margin="0,0,1,0" MouseDown="SearchIcon_OnMouseDown" Visibility="{Binding ElementName=SearchBox, Path=Text.Length, Converter={StaticResource StringHasValueToVisibility}}" /> |
| 495 | + <Button Grid.Row="1" Style="{StaticResource XButtonStyle}" HorizontalAlignment="Right" VerticalAlignment="Center" Height="18" Width="18" Margin="0,1,1,0" Visibility="{Binding ElementName=SearchBox, Path=Text.Length, Converter={StaticResource StringHasNoValueToVisibility}}" Click="ButtonBase_OnClick">✕</Button> |
| 496 | + |
440 | 497 | <controls:EmptyUIRefresh Grid.Row="2" />
|
441 | 498 |
|
442 | 499 | <TreeView x:Name="ProjectTree"
|
|
0 commit comments