Skip to content

Commit 52fb48d

Browse files
committed
Mostly close #1759. Just have to retain the selection.
1 parent 20c1ab7 commit 52fb48d

File tree

1 file changed

+49
-42
lines changed

1 file changed

+49
-42
lines changed

RetailCoder.VBE/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<BitmapImage x:Key="RefreshImage" UriSource="../../Resources/arrow-circle-double.png" />
1818
<BitmapImage x:Key="UndoImage" UriSource="../../Resources/arrow-circle-left.png" />
1919
<BitmapImage x:Key="PrintImage" UriSource="../../Resources/printer.png" />
20-
20+
2121
<BooleanToVisibilityConverter x:Key="BoolToVisibility"/>
2222
<converters:BoolToHiddenVisibilityConverter x:Key="BoolToHiddenVisibility" />
2323
<converters:InvertBoolValueConverter x:Key="InvertBoolValue" />
@@ -255,7 +255,7 @@
255255
</Trigger>
256256
</Style.Triggers>
257257
</Style>
258-
258+
259259
<LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" EndPoint="0,1" StartPoint="0,0">
260260
<GradientStop Color="#FFD9F4FF" Offset="0"/>
261261
<GradientStop Color="#FF9BDDFB" Offset="1"/>
@@ -291,16 +291,17 @@
291291
</Style>
292292
</Style.Resources>
293293
</Style>
294-
294+
295295
<Style x:Key="IconStyle" TargetType="Image">
296296
<Setter Property="Height" Value="16" />
297297
<Setter Property="Width" Value="16" />
298298
<Setter Property="Margin" Value="2,0,2,0" />
299299
<Setter Property="VerticalAlignment" Value="Top" />
300300
</Style>
301-
301+
302302
<Style x:Key="TreeViewItemStyle" TargetType="TextBlock">
303303
<Setter Property="Text" Value="{Binding Name}" />
304+
<Setter Property="FontSize" Value="10" />
304305
<Setter Property="MaxWidth" Value="200" />
305306
<Setter Property="Margin" Value="2,0,2,0" />
306307
<Setter Property="VerticalAlignment" Value="Center" />
@@ -311,6 +312,7 @@
311312

312313
<Style x:Key="TreeViewItemStyleWithSignatures" TargetType="TextBlock">
313314
<Setter Property="Text" Value="{Binding NameWithSignature}" />
315+
<Setter Property="FontSize" Value="10" />
314316
<Setter Property="MaxWidth" Value="200" />
315317
<Setter Property="Margin" Value="2,0,2,0" />
316318
<Setter Property="VerticalAlignment" Value="Center" />
@@ -337,7 +339,7 @@
337339
<TextBlock Style="{StaticResource TreeViewItemStyleWithSignatures}" Visibility="{Binding ElementName=DisplaySignatures, Path=IsChecked, Converter={StaticResource BoolToVisibility}}" />
338340
</StackPanel>
339341
</HierarchicalDataTemplate>
340-
342+
341343
<HierarchicalDataTemplate x:Key="CodeExplorerTemplate"
342344
DataType="codeExplorer:CodeExplorerProjectViewModel"
343345
ItemsSource="{Binding Items}">
@@ -676,14 +678,14 @@
676678
IsCheckable="True" />
677679
<MenuItem Name="SortBySelection"
678680
Style="{DynamicResource MenuItemStyle}" VerticalAlignment="Center"
679-
Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SortStyle_BySelection}"
681+
Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SortStyle_ByCodeOrder}"
680682
IsChecked="{Binding SortBySelection, UpdateSourceTrigger=PropertyChanged}"
681683
Command="{Binding SetSelectionSortCommand}"
682684
CommandParameter="{Binding ElementName=SortBySelection, Path=IsChecked}"
683685
IsCheckable="True" />
684-
686+
685687
<Separator />
686-
688+
687689
<MenuItem Style="{DynamicResource MenuItemStyle}" VerticalAlignment="Center"
688690
Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SortStyle_ByType}"
689691
IsChecked="{Binding SortByType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
@@ -695,7 +697,7 @@
695697
</ToggleButton>
696698

697699
<Separator />
698-
700+
699701
<Button Command="{Binding OpenDesignerCommand}" CommandParameter="{Binding SelectedItem}">
700702
<Image Height="16" Source="../../Resources/Microsoft/PNG/VSProject_form.png" />
701703
<Button.ToolTip>
@@ -734,39 +736,44 @@
734736

735737
<Border Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="DimGray">
736738

737-
<StackPanel Orientation="Vertical" MinHeight="48" Background="WhiteSmoke">
738-
739-
<Grid Margin="4" HorizontalAlignment="Stretch">
740-
<Grid.ColumnDefinitions>
741-
<ColumnDefinition Width="20" />
742-
<ColumnDefinition />
743-
</Grid.ColumnDefinitions>
744-
<Image Style="{StaticResource IconStyle}" VerticalAlignment="Top"
745-
Source="{Binding SelectedItem.CollapsedIcon}" Grid.Column="0"/>
746-
<TextBlock Margin="4" Text="{Binding PanelTitle}" FontWeight="Bold"
747-
TextWrapping="WrapWithOverflow" Grid.Column="1"/>
748-
</Grid>
749-
750-
<TextBlock Margin="4" Text="{Binding Description}" FontSize="10" TextWrapping="WrapWithOverflow"/>
751-
752-
<WrapPanel>
753-
<controls:LinkButton Margin="4"
754-
Visibility="{Binding CanExecuteIndenterCommand, Converter={StaticResource BoolToVisibility}, UpdateSourceTrigger=PropertyChanged}"
755-
Command="{Binding IndenterCommand}"
756-
CommandParameter="{Binding SelectedItem}"
757-
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SmartIndenterMenu}" />
758-
<controls:LinkButton Margin="4"
759-
Visibility="{Binding CanExecuteRenameCommand, Converter={StaticResource BoolToVisibility}}"
760-
Command="{Binding RenameCommand}"
761-
CommandParameter="{Binding SelectedItem}"
762-
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Rename}" />
763-
<controls:LinkButton Margin="4"
764-
Visibility="{Binding CanExecuteFindAllReferencesCommand, Converter={StaticResource BoolToVisibility}}"
765-
Command="{Binding FindAllReferencesCommand}"
766-
CommandParameter="{Binding SelectedItem}"
767-
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_FindAllReferencesText}" />
768-
</WrapPanel>
769-
</StackPanel>
739+
<ScrollViewer Background="WhiteSmoke" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
740+
<StackPanel Orientation="Vertical" MinHeight="48" Background="WhiteSmoke">
741+
742+
<Grid Margin="4" HorizontalAlignment="Stretch">
743+
<Grid.ColumnDefinitions>
744+
<ColumnDefinition Width="20" />
745+
<ColumnDefinition />
746+
</Grid.ColumnDefinitions>
747+
<Image Style="{StaticResource IconStyle}"
748+
Source="{Binding SelectedItem.CollapsedIcon}" Grid.Column="0"/>
749+
<TextBox IsReadOnly="True" Margin="4" Text="{Binding PanelTitle, Mode=OneWay}" FontWeight="Bold"
750+
TextWrapping="WrapWithOverflow" Grid.Column="1" FontSize="10"
751+
Background="WhiteSmoke" BorderThickness="0" Foreground="Black" />
752+
</Grid>
753+
754+
<TextBox IsReadOnly="True" Margin="4" Text="{Binding Description, Mode=OneWay}"
755+
BorderThickness="0" Background="WhiteSmoke" Foreground="Black"
756+
FontSize="10" TextWrapping="WrapWithOverflow" />
757+
758+
<WrapPanel>
759+
<controls:LinkButton Margin="4"
760+
Visibility="{Binding CanExecuteIndenterCommand, Converter={StaticResource BoolToVisibility}, UpdateSourceTrigger=PropertyChanged}"
761+
Command="{Binding IndenterCommand}"
762+
CommandParameter="{Binding SelectedItem}"
763+
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SmartIndenterMenu}" />
764+
<controls:LinkButton Margin="4"
765+
Visibility="{Binding CanExecuteRenameCommand, Converter={StaticResource BoolToVisibility}}"
766+
Command="{Binding RenameCommand}"
767+
CommandParameter="{Binding SelectedItem}"
768+
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Rename}" />
769+
<controls:LinkButton Margin="4"
770+
Visibility="{Binding CanExecuteFindAllReferencesCommand, Converter={StaticResource BoolToVisibility}}"
771+
Command="{Binding FindAllReferencesCommand}"
772+
CommandParameter="{Binding SelectedItem}"
773+
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_FindAllReferencesText}" />
774+
</WrapPanel>
775+
</StackPanel>
776+
</ScrollViewer>
770777
</Border>
771778
</Grid>
772779
</UserControl>

0 commit comments

Comments
 (0)