Skip to content

Commit f6e8a80

Browse files
committed
merge next
2 parents d297bfa + d9e4a3c commit f6e8a80

29 files changed

+895
-360
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ A clear and concise description of what you expected to happen.
3333
If applicable, add screenshots to help explain your problem.
3434

3535
**Logfile**
36-
Rubberduck generates extensive logging in TRACE-Level. If no log was created at `%APP_DATA%\Rubberduck\Logs`, check your settings. Include this Log for bugreports about the behavior of Rubbberduck
36+
Rubberduck generates extensive logging in TRACE-Level. If no log was created at `%APPDATA%\Rubberduck\Logs`, check your settings. Include this Log for bugreports about the behavior of Rubbberduck
3737

3838
**Additional context**
3939
Add any other context about the problem here.

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerItemComparer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ public override int Compare(ICodeExplorerNode x, ICodeExplorerNode y)
192192
return 1;
193193
}
194194

195-
return SortOrder[first.Value].CompareTo(SortOrder[second.Value]);
195+
var component = SortOrder[first.Value].CompareTo(SortOrder[second.Value]);
196+
197+
return component == 0 ? CodeExplorerItemComparer.Name.Compare(x, y) : component;
196198
}
197199
}
198200

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,15 @@ public double? FontSize
214214
}
215215
}
216216

217+
// This is just a binding hack to force the icon binding to re-evaluate. It has no other functionality and should
218+
// not be used for anything else.
219+
public bool ParserReady
220+
{
221+
get => true;
222+
// ReSharper disable once ValueParameterNotUsed
223+
set => OnPropertyChanged();
224+
}
225+
217226
private void HandleStateChanged(object sender, ParserStateEventArgs e)
218227
{
219228
Unparsed = false;
@@ -232,6 +241,7 @@ private void HandleStateChanged(object sender, ParserStateEventArgs e)
232241

233242
Unparsed = !Projects.Any();
234243
IsBusy = false;
244+
ParserReady = true;
235245
});
236246
return;
237247
}

Rubberduck.Core/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@
595595
<Binding RelativeSource="{RelativeSource Self}" Path="DataContext"/>
596596
<Binding Path="Declaration" />
597597
<Binding Path="IsExpanded" />
598+
<Binding ElementName="CodeExplorer" Path="DataContext.ParserReady" />
598599
</MultiBinding.Bindings>
599600
</MultiBinding>
600601
</Image.Source>

Rubberduck.Core/UI/CodeExplorer/CodeExplorerControl.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ private void TreeView_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
2121
if (ViewModel != null && ViewModel.OpenCommand.CanExecute(ViewModel.SelectedItem))
2222
{
2323
ViewModel.OpenCommand.Execute(ViewModel.SelectedItem);
24+
e.Handled = true;
2425
}
25-
e.Handled = true;
2626
}
2727

2828
private void TreeView_OnMouseRightButtonDown(object sender, MouseButtonEventArgs e)

Rubberduck.Core/UI/CodeExplorer/Commands/RenameCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public RenameCommand(IVBE vbe, RubberduckParserState state, IMessageBox msgBox,
3131
_state = state;
3232
_rewritingManager = rewritingManager;
3333
_msgBox = msgBox;
34+
_factory = factory;
3435
}
3536

3637
public override IEnumerable<Type> ApplicableNodeTypes => ApplicableNodes;

Rubberduck.Core/UI/Command/ReparseCommand.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515

1616
namespace Rubberduck.UI.Command
1717
{
18+
[ComVisible(false)]
19+
public class ReparseCancellationFlag
20+
{
21+
public bool Canceled { get; set; }
22+
}
23+
1824
[ComVisible(false)]
1925
public class ReparseCommand : CommandBase
2026
{
@@ -58,13 +64,21 @@ protected override void OnExecute(object parameter)
5864
{
5965
if (!VerifyCompileOnDemand())
6066
{
67+
if (parameter is ReparseCancellationFlag cancellation)
68+
{
69+
cancellation.Canceled = true;
70+
}
6171
return;
6272
}
6373

6474
if (AreAllProjectsCompiled(out var failedNames))
6575
{
6676
if (!PromptUserToContinue(failedNames))
6777
{
78+
if (parameter is ReparseCancellationFlag cancellation)
79+
{
80+
cancellation.Canceled = true;
81+
}
6882
return;
6983
}
7084
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Windows;
2+
using System.Windows.Controls;
3+
using System.Windows.Interactivity;
4+
using GongSolutions.Wpf.DragDrop.Utilities;
5+
6+
namespace Rubberduck.UI.Controls
7+
{
8+
public class GroupItemExpandedBehavior : Behavior<DataGrid>
9+
{
10+
public object ExpandedState
11+
{
12+
get => GetValue(ExpandedStateProperty);
13+
set => SetValue(ExpandedStateProperty, value);
14+
}
15+
16+
public static readonly DependencyProperty ExpandedStateProperty =
17+
DependencyProperty.Register("ExpandedState", typeof(object), typeof(GroupItemExpandedBehavior), new UIPropertyMetadata(null, OnExpandedStateChanged));
18+
19+
private static void OnExpandedStateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
20+
{
21+
if (!(sender is GroupItemExpandedBehavior data) ||
22+
!(data.AssociatedObject is DataGrid grid) ||
23+
!grid.IsGrouping ||
24+
!(e.NewValue is bool))
25+
{
26+
return;
27+
}
28+
29+
foreach (var expander in grid.GetVisualDescendents<Expander>())
30+
{
31+
expander.IsExpanded = (bool)e.NewValue;
32+
}
33+
}
34+
}
35+
}

Rubberduck.Core/UI/Controls/GroupingGrid.xaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<Setter Property="Template">
6161
<Setter.Value>
6262
<ControlTemplate>
63-
<Expander Background="WhiteSmoke" Foreground="Black" FontWeight="SemiBold" IsExpanded="True">
63+
<Expander Background="WhiteSmoke" Foreground="Black" FontWeight="SemiBold">
6464
<Expander.Header>
6565
<StackPanel Orientation="Horizontal">
6666
<TextBlock Margin="4"
@@ -107,7 +107,6 @@
107107
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
108108
<Setter Property="ItemContainerStyle" Value="{StaticResource PrettifyRow}" />
109109
<Setter Property="ColumnHeaderHeight" Value="22" />
110-
<Setter Property="SelectionMode" Value="Single" />
111110
</Style>
112111
</DataGrid.Style>
113112
<DataGrid.CellStyle>
@@ -116,7 +115,16 @@
116115
<Setter Property="Background" Value="Transparent" />
117116
<Setter Property="Padding" Value="0" />
118117
<Setter Property="VerticalContentAlignment" Value="Stretch" />
119-
<Setter Property="VerticalAlignment" Value="Center" />
118+
<Setter Property="VerticalAlignment" Value="Stretch" />
119+
<Setter Property="Template">
120+
<Setter.Value>
121+
<ControlTemplate TargetType="{x:Type DataGridCell}">
122+
<Grid Background="{TemplateBinding Background}">
123+
<ContentPresenter VerticalAlignment="Center" />
124+
</Grid>
125+
</ControlTemplate>
126+
</Setter.Value>
127+
</Setter>
120128
</Style>
121129
</DataGrid.CellStyle>
122130
</DataGrid>

Rubberduck.Core/UI/Controls/GroupingGrid.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Rubberduck.UI.Controls
77
public partial class GroupingGrid
88
{
99
public static readonly DependencyProperty ShowGroupingItemCountProperty =
10-
DependencyProperty.Register("ShowGroupingItemCount", typeof (bool), typeof (GroupingGrid));
10+
DependencyProperty.Register("ShowGroupingItemCount", typeof (bool), typeof(GroupingGrid));
1111

1212
public bool ShowGroupingItemCount
1313
{

0 commit comments

Comments
 (0)