Skip to content

Commit b3b4604

Browse files
committed
Merge branch 'next' into AnnotationQuickFixesForAttributeInspections
2 parents 8c9c4bd + 559991e commit b3b4604

File tree

7 files changed

+38
-8
lines changed

7 files changed

+38
-8
lines changed

Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
SelectionMode="Single"
233233
ItemsSource="{Binding AvailableReferences}"
234234
HorizontalContentAlignment="Stretch"
235-
ScrollViewer.HorizontalScrollBarVisibility="Hidden">
235+
ScrollViewer.HorizontalScrollBarVisibility="Auto">
236236
<ListView.ItemContainerStyle>
237237
<Style TargetType="ListViewItem">
238238
<Setter Property="Height" Value="20" />
@@ -289,7 +289,7 @@
289289
SelectedItem="{Binding SelectedReference, Mode=TwoWay}"
290290
SelectionMode="Single"
291291
ItemsSource="{Binding ProjectReferences, NotifyOnTargetUpdated=True}"
292-
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
292+
ScrollViewer.HorizontalScrollBarVisibility="Auto"
293293
HorizontalContentAlignment="Stretch">
294294
<ListView.ItemContainerStyle>
295295
<Style TargetType="ListViewItem">

Rubberduck.Core/UI/Inspections/InspectionResultsViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public void FilterResults(IEnumerable<CodeInspectionSeverity> inspections)
329329

330330
private void OpenSettings(object param)
331331
{
332-
using (var window = _settingsFormFactory.Create())
332+
using (var window = _settingsFormFactory.Create(SettingsViews.InspectionSettings))
333333
{
334334
window.ShowDialog();
335335
_settingsFormFactory.Release(window);

Rubberduck.Core/UI/Settings/SettingsForm.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace Rubberduck.UI.Settings
1212
public interface ISettingsFormFactory
1313
{
1414
SettingsForm Create();
15+
SettingsForm Create(SettingsViews activeView);
1516
void Release(SettingsForm form);
1617
}
1718

Rubberduck.Core/UI/ToDoItems/ToDoExplorerViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public CommandBase OpenTodoSettings
224224
}
225225
return _openTodoSettings = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ =>
226226
{
227-
using (var window = _settingsFormFactory.Create())
227+
using (var window = _settingsFormFactory.Create(SettingsViews.TodoSettings))
228228
{
229229
window.ShowDialog();
230230
_settingsFormFactory.Release(window);

Rubberduck.Core/UI/UnitTesting/TestExplorerControl.xaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@
627627
SelectedItem="{Binding SelectedTest}"
628628
ShowGroupingItemCount="True"
629629
Visibility="{Binding GroupByOutcome, Converter={StaticResource BoolToVisibility}}"
630-
Margin="-1,0,1,0">
630+
IsVisibleChanged="ResultsGroupingGrid_IsVisibleChanged">
631631
<DataGrid.Columns>
632632
<DataGridTemplateColumn Header="{Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_Outcome}">
633633
<DataGridTemplateColumn.CellTemplate>
@@ -646,7 +646,8 @@
646646
<controls:GroupingGrid ItemsSource="{Binding Source={StaticResource ResultsByModule}}"
647647
SelectedItem="{Binding SelectedTest}"
648648
ShowGroupingItemCount="True"
649-
Visibility="{Binding GroupByLocation, Converter={StaticResource BoolToVisibility}}">
649+
Visibility="{Binding GroupByLocation, Converter={StaticResource BoolToVisibility}}"
650+
IsVisibleChanged="ResultsGroupingGrid_IsVisibleChanged">
650651
<DataGrid.Columns>
651652
<DataGridTemplateColumn Header="{Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_Outcome}">
652653
<DataGridTemplateColumn.CellTemplate>
@@ -665,7 +666,8 @@
665666
<controls:GroupingGrid ItemsSource="{Binding Source={StaticResource ResultsByCategory}}"
666667
SelectedItem="{Binding SelectedTest}"
667668
ShowGroupingItemCount="True"
668-
Visibility="{Binding GroupByCategory, Converter={StaticResource BoolToVisibility}}">
669+
Visibility="{Binding GroupByCategory, Converter={StaticResource BoolToVisibility}}"
670+
IsVisibleChanged="ResultsGroupingGrid_IsVisibleChanged">
669671
<DataGrid.Columns>
670672
<DataGridTemplateColumn Header="{Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_Outcome}">
671673
<DataGridTemplateColumn.CellTemplate>

Rubberduck.Core/UI/UnitTesting/TestExplorerControl.xaml.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Windows.Data;
33
using System.Windows.Threading;
4+
using Rubberduck.UI.Controls;
45

56
namespace Rubberduck.UI.UnitTesting
67
{
@@ -68,5 +69,31 @@ protected virtual void Dispose(bool disposing)
6869
DataContextChanged -= TestExplorerControl_DataContextChanged;
6970
_isDisposed = true;
7071
}
72+
private GroupingGrid _newGroupingGrid;
73+
private void ResultsGroupingGrid_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
74+
{
75+
if (sender is GroupingGrid)
76+
{
77+
GroupingGrid groupingGrid = (GroupingGrid)sender;
78+
// actual height checks that form is visible at this point
79+
// don't set up the "new" visible element until we see an object with an actual height
80+
if (!((groupingGrid.ActualHeight == 0) && (_newGroupingGrid is null))) // check form elements are actually set up (i.e. not initialising form)
81+
{
82+
// this code relies on the new element being made visible before the old is hidden, so we save the new element
83+
// and then copy column widths from the old now hidden element on the subsequent invocation
84+
if (groupingGrid.IsVisible)
85+
_newGroupingGrid = groupingGrid;
86+
else
87+
{
88+
// copy column widths from previously visible grouping grid to ensure widths are consistent
89+
for (int columnIndex = 0; columnIndex < groupingGrid.Columns.Count; columnIndex++)
90+
{
91+
// copy column widths from current now hidden columns to the new visible columns
92+
_newGroupingGrid.Columns[columnIndex].Width = groupingGrid.Columns[columnIndex].Width;
93+
}
94+
}
95+
}
96+
}
97+
}
7198
}
7299
}

Rubberduck.Core/UI/UnitTesting/TestExplorerViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public bool GroupByCategory
193193

194194
private void OpenSettings(object param)
195195
{
196-
using (var window = _settingsFormFactory.Create())
196+
using (var window = _settingsFormFactory.Create(SettingsViews.UnitTestSettings))
197197
{
198198
window.ShowDialog();
199199
_settingsFormFactory.Release(window);

0 commit comments

Comments
 (0)