Skip to content

Commit 56ff99d

Browse files
committed
UI tweaks
1 parent 84e1f6d commit 56ff99d

File tree

6 files changed

+95
-105
lines changed

6 files changed

+95
-105
lines changed

RetailCoder.VBE/UI/RubberduckUI.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/RubberduckUI.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ All our stargazers, likers & followers, for the warm fuzzies
15751575
<value>Parser Errors</value>
15761576
</data>
15771577
<data name="GeneralSettings_MinimumLogLevelLabel" xml:space="preserve">
1578-
<value>Minimum Log Level</value>
1578+
<value>Minimum Log Level:</value>
15791579
</data>
15801580
<data name="GeneralSettings_DebugLogLevel" xml:space="preserve">
15811581
<value>Debug</value>
@@ -1764,6 +1764,6 @@ All our stargazers, likers &amp; followers, for the warm fuzzies
17641764
<value>Regular Expression Analyzer</value>
17651765
</data>
17661766
<data name="CodeInspectionSettings_WhitelistedNamesLabel" xml:space="preserve">
1767-
<value>Whitelisted Names</value>
1767+
<value>Whitelisted Names:</value>
17681768
</data>
17691769
</root>

RetailCoder.VBE/UI/Settings/InspectionSettings.xaml

Lines changed: 86 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -275,52 +275,56 @@
275275
</Style>
276276
</Label.Style>
277277
</Label>
278-
<controls:GroupingGrid ItemsSource="{Binding InspectionSettings}"
279-
AutoGenerateColumns="False"
280-
CanUserReorderColumns="False"
281-
IsReadOnly="False"
282-
SelectionMode="Single"
283-
CanUserAddRows="False"
284-
HorizontalGridLinesBrush="Transparent"
285-
VerticalGridLinesBrush="Transparent"
286-
HeadersVisibility="None"
287-
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
288-
ColumnHeaderHeight="22"
289-
BorderThickness="0"
290-
CellEditEnding="GroupingGrid_CellEditEnding"
291-
MaxHeight="200">
292-
<controls:GroupingGrid.Columns>
293-
<DataGridTemplateColumn Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=NameLabelText}"
294-
Width="2.75*"
295-
IsReadOnly="True"
296-
SortMemberPath="{Binding LocalizedName}">
297-
<DataGridTemplateColumn.CellTemplate>
298-
<DataTemplate>
299-
<TextBlock Text="{Binding LocalizedName}">
300-
<TextBlock.ToolTip>
301-
<StackPanel>
302-
<TextBlock Text="{Binding LocalizedName}"
303-
FontWeight="SemiBold"
304-
MaxWidth="300"
305-
TextWrapping="WrapWithOverflow" />
306-
<TextBlock Text="{Binding Meta}"
307-
MaxWidth="300"
308-
TextWrapping="WrapWithOverflow" />
309-
</StackPanel>
310-
</TextBlock.ToolTip>
311-
</TextBlock>
312-
</DataTemplate>
313-
</DataGridTemplateColumn.CellTemplate>
314-
</DataGridTemplateColumn>
315-
<DataGridComboBoxColumn Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SeverityLabelText}"
316-
Width="*"
317-
ItemsSource="{Binding Source={StaticResource Severities}, Converter={StaticResource CodeInspectionSeverityEnumToText}, UpdateSourceTrigger=PropertyChanged}"
318-
SelectedItemBinding="{Binding Path=SeverityLabel}" />
319-
</controls:GroupingGrid.Columns>
320-
</controls:GroupingGrid>
278+
<Border BorderBrush="DarkGray" BorderThickness="1" CornerRadius="2">
279+
<controls:GroupingGrid ItemsSource="{Binding InspectionSettings}"
280+
AutoGenerateColumns="False"
281+
CanUserReorderColumns="False"
282+
IsReadOnly="False"
283+
SelectionMode="Single"
284+
CanUserAddRows="False"
285+
HorizontalGridLinesBrush="Transparent"
286+
VerticalGridLinesBrush="Transparent"
287+
HeadersVisibility="None"
288+
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
289+
ColumnHeaderHeight="22"
290+
BorderThickness="0"
291+
CellEditEnding="GroupingGrid_CellEditEnding"
292+
Height="200">
293+
<controls:GroupingGrid.Columns>
294+
<DataGridTemplateColumn Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=NameLabelText}"
295+
Width="2.75*"
296+
IsReadOnly="True"
297+
SortMemberPath="{Binding LocalizedName}">
298+
<DataGridTemplateColumn.CellTemplate>
299+
<DataTemplate>
300+
<TextBlock Text="{Binding LocalizedName}">
301+
<TextBlock.ToolTip>
302+
<StackPanel>
303+
<TextBlock Text="{Binding LocalizedName}"
304+
FontWeight="SemiBold"
305+
MaxWidth="300"
306+
TextWrapping="WrapWithOverflow" />
307+
<TextBlock Text="{Binding Meta}"
308+
MaxWidth="300"
309+
TextWrapping="WrapWithOverflow" />
310+
</StackPanel>
311+
</TextBlock.ToolTip>
312+
</TextBlock>
313+
</DataTemplate>
314+
</DataGridTemplateColumn.CellTemplate>
315+
</DataGridTemplateColumn>
316+
<DataGridComboBoxColumn Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SeverityLabelText}"
317+
Width="*"
318+
ItemsSource="{Binding Source={StaticResource Severities}, Converter={StaticResource CodeInspectionSeverityEnumToText}, UpdateSourceTrigger=PropertyChanged}"
319+
SelectedItemBinding="{Binding Path=SeverityLabel}" />
320+
</controls:GroupingGrid.Columns>
321+
</controls:GroupingGrid>
322+
</Border>
323+
<Label Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeInspectionSettings_WhitelistedNamesLabel}"
324+
FontWeight="SemiBold"
325+
Margin="0,5,0,0" />
321326
<ToolBarTray IsLocked="True"
322-
Background="Transparent"
323-
Margin="0,5,0,0">
327+
Background="Transparent">
324328
<ToolBar Style="{DynamicResource ToolBarWithOverflowOnlyShowingWhenNeededStyle}"
325329
Background="Transparent">
326330
<Button ToolTip="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Add}"
@@ -335,10 +339,10 @@
335339
</Button>
336340
<Button ToolTip="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Remove}"
337341
Command="{Binding DeleteWhitelistedNameCommand}"
338-
CommandParameter="{Binding ElementName=TodoMarkerGrid, Path=CurrentItem}"
342+
CommandParameter="{Binding ElementName=WhitelistedNamesGrid, Path=CurrentItem}"
339343
BorderThickness="0"
340344
Background="Transparent"
341-
IsEnabled="{Binding ElementName=TodoMarkerGrid, Path=SelectedItem, Converter={StaticResource HasSelectedItems}}">
345+
IsEnabled="{Binding ElementName=WhitelistedNamesGrid, Path=SelectedItem, Converter={StaticResource HasSelectedItems}}">
342346
<StackPanel Orientation="Horizontal">
343347
<Image Source="{StaticResource DeleteImage}" />
344348
<TextBlock Text="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Remove}"
@@ -347,40 +351,41 @@
347351
</Button>
348352
</ToolBar>
349353
</ToolBarTray>
350-
<DataGrid Name="WhitelistedNamesGrid"
351-
ItemsSource="{Binding WhitelistedNameSettings}"
352-
AutoGenerateColumns="False"
353-
CanUserReorderColumns="False"
354-
IsReadOnly="False"
355-
SelectionMode="Single"
356-
CanUserAddRows="False"
357-
CanUserSortColumns="False"
358-
HorizontalGridLinesBrush="Transparent"
359-
VerticalGridLinesBrush="Transparent"
360-
HeadersVisibility="Column"
361-
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
362-
ItemContainerStyle="{StaticResource PrettifyRow}"
363-
ColumnHeaderHeight="22"
364-
BorderThickness="0">
365-
<DataGrid.InputBindings>
366-
<KeyBinding Key="Delete"
367-
Command="{Binding DeleteWhitelistedNameCommand}"
368-
CommandParameter="{Binding ElementName=WhitelistedNamesGrid, Path=SelectedItem}" />
369-
</DataGrid.InputBindings>
370-
<DataGrid.CellStyle>
371-
<Style TargetType="{x:Type DataGridCell}">
372-
<Setter Property="BorderThickness" Value="0" />
373-
<Setter Property="VerticalAlignment" Value="Center" />
374-
<Setter Property="Background" Value="Transparent" />
375-
</Style>
376-
</DataGrid.CellStyle>
377-
<DataGrid.Columns>
378-
<DataGridTextColumn Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeInspectionSettings_WhitelistedNamesLabel}"
379-
Width="*"
380-
Binding="{Binding Name}"
381-
SortDirection="Ascending" />
382-
</DataGrid.Columns>
383-
</DataGrid>
354+
<Border BorderBrush="DarkGray" BorderThickness="1" CornerRadius="2">
355+
<DataGrid Name="WhitelistedNamesGrid"
356+
ItemsSource="{Binding WhitelistedNameSettings}"
357+
AutoGenerateColumns="False"
358+
CanUserReorderColumns="False"
359+
IsReadOnly="False"
360+
SelectionMode="Single"
361+
CanUserAddRows="False"
362+
CanUserSortColumns="False"
363+
HorizontalGridLinesBrush="Transparent"
364+
VerticalGridLinesBrush="Transparent"
365+
HeadersVisibility="None"
366+
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
367+
ItemContainerStyle="{StaticResource PrettifyRow}"
368+
ColumnHeaderHeight="22"
369+
BorderThickness="0"
370+
Height="200">
371+
<DataGrid.InputBindings>
372+
<KeyBinding Key="Delete"
373+
Command="{Binding DeleteWhitelistedNameCommand}"
374+
CommandParameter="{Binding ElementName=WhitelistedNamesGrid, Path=SelectedItem}" />
375+
</DataGrid.InputBindings>
376+
<DataGrid.CellStyle>
377+
<Style TargetType="{x:Type DataGridCell}">
378+
<Setter Property="BorderThickness" Value="0" />
379+
<Setter Property="VerticalAlignment" Value="Center" />
380+
<Setter Property="Background" Value="Transparent" />
381+
</Style>
382+
</DataGrid.CellStyle>
383+
<DataGrid.Columns>
384+
<DataGridTextColumn Width="*"
385+
Binding="{Binding Name}" />
386+
</DataGrid.Columns>
387+
</DataGrid>
388+
</Border>
384389
</StackPanel>
385390
</ScrollViewer>
386391
</Grid>

RetailCoder.VBE/UI/Settings/InspectionSettingsViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public InspectionSettingsViewModel(Configuration config)
1818
config.UserSettings.CodeInspectionSettings.CodeInspections.ToList());
1919

2020
WhitelistedNameSettings = new ObservableCollection<WhitelistedNameSetting>(
21-
config.UserSettings.CodeInspectionSettings.WhitelistedNames.Distinct());
21+
config.UserSettings.CodeInspectionSettings.WhitelistedNames.OrderBy(o => o.Name).Distinct());
2222

2323
if (InspectionSettings.GroupDescriptions != null)
2424
{

RetailCoder.VBE/UI/Settings/TodoSettings.xaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
</Style>
245245
</UserControl.Resources>
246246
<Grid>
247-
<DockPanel Margin="5,5,5,0">
247+
<StackPanel Margin="5,5,5,0">
248248
<Label DockPanel.Dock="Top"
249249
Background="DarkGray"
250250
Foreground="White"
@@ -261,8 +261,7 @@
261261
</Style>
262262
</Label.Style>
263263
</Label>
264-
<ToolBarTray DockPanel.Dock="Top"
265-
IsLocked="True"
264+
<ToolBarTray IsLocked="True"
266265
Background="Transparent">
267266
<ToolBar Style="{DynamicResource ToolBarWithOverflowOnlyShowingWhenNeededStyle}"
268267
Background="Transparent">
@@ -303,8 +302,7 @@
303302
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
304303
ItemContainerStyle="{StaticResource PrettifyRow}"
305304
ColumnHeaderHeight="22"
306-
BorderThickness="0"
307-
CellEditEnding="TodoMarkerGrid_CellEditEnding">
305+
BorderThickness="0">
308306
<DataGrid.InputBindings>
309307
<KeyBinding Key="Delete"
310308
Command="{Binding DeleteTodoCommand}"
@@ -323,6 +321,6 @@
323321
Binding="{Binding Text}" />
324322
</DataGrid.Columns>
325323
</DataGrid>
326-
</DockPanel>
324+
</StackPanel>
327325
</Grid>
328326
</UserControl>

RetailCoder.VBE/UI/Settings/TodoSettings.xaml.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,5 @@ public TodoSettings(ISettingsViewModel vm)
2222
}
2323

2424
public ISettingsViewModel ViewModel { get { return DataContext as ISettingsViewModel; } }
25-
26-
private void TodoMarkerGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
27-
{
28-
if (e.Cancel || e.EditAction == DataGridEditAction.Cancel) { return; }
29-
30-
var markers = TodoMarkerGrid.ItemsSource.OfType<ToDoMarker>().ToList();
31-
32-
var editedIndex = e.Row.GetIndex();
33-
markers.RemoveAt(editedIndex);
34-
markers.Insert(editedIndex, new ToDoMarker(((TextBox)e.EditingElement).Text));
35-
36-
((TodoSettingsViewModel) ViewModel).TodoSettings = new ObservableCollection<ToDoMarker>(markers);
37-
}
3825
}
3926
}

0 commit comments

Comments
 (0)