Skip to content

Commit 0119a34

Browse files
committed
Merge branch 'next' into CureBangNotationParsing
2 parents b110234 + ee57718 commit 0119a34

File tree

6 files changed

+18
-3
lines changed

6 files changed

+18
-3
lines changed

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/Converters/CodeExplorerNodeToIconConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public override object Convert(object value, Type targetType, object parameter,
9292
return ExceptionIcon;
9393
}
9494

95-
if (component.Declaration is ClassModuleDeclaration classModule && classModule.IsInterface)
95+
if (component.Declaration is ClassModuleDeclaration classModule &&
96+
(classModule.IsInterface || classModule.Annotations.Any(annotation => annotation is InterfaceAnnotation)))
9697
{
9798
return InterfaceIcon;
9899
}

0 commit comments

Comments
 (0)