mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[PTRun]Fix tooltip closing and improve Registry tooltip spacing (#31361)
This commit is contained in:
committed by
GitHub
parent
3e58382637
commit
37867e008b
@@ -85,12 +85,14 @@
|
||||
FontWeight="SemiBold"
|
||||
Style="{DynamicResource CollapsableTextblock}"
|
||||
Text="{Binding Result.ToolTipData.Title}"
|
||||
TextAlignment="Left"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBlock
|
||||
Margin="0,4,0,0"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Style="{DynamicResource CollapsableTextblock}"
|
||||
Text="{Binding Result.ToolTipData.Text}"
|
||||
TextAlignment="Left"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</ToolTip>
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace PowerLauncher
|
||||
|
||||
// From https://learn.microsoft.com/dotnet/desktop/wpf/data/how-to-find-datatemplate-generated-elements
|
||||
private TypeChildItem FindVisualChild<TypeChildItem>(DependencyObject obj)
|
||||
where TypeChildItem : DependencyObject
|
||||
where TypeChildItem : DependencyObject
|
||||
{
|
||||
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
|
||||
{
|
||||
@@ -80,20 +80,22 @@ namespace PowerLauncher
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1309:Use ordinal string comparison", Justification = "Using StringComparison.InvariantCulture since this is user facing")]
|
||||
private void ToolTip_Opened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.Equals(sender.GetType().FullName, "System.Windows.Controls.ToolTip", System.StringComparison.InvariantCulture))
|
||||
if (string.Equals(sender.GetType().FullName, "System.Windows.Controls.ToolTip", System.StringComparison.Ordinal))
|
||||
{
|
||||
HideCurrentToolTip();
|
||||
_previouslyOpenedToolTip = (ToolTip)sender;
|
||||
var openedToolTip = (ToolTip)sender;
|
||||
if (_previouslyOpenedToolTip != openedToolTip)
|
||||
{
|
||||
HideCurrentToolTip();
|
||||
_previouslyOpenedToolTip = openedToolTip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1309:Use ordinal string comparison", Justification = "Using StringComparison.InvariantCulture since this is user facing")]
|
||||
private void SuggestionsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (string.Equals(((ListView)e.OriginalSource).Name, "SuggestionsList", System.StringComparison.InvariantCulture))
|
||||
if (string.Equals(((ListView)e.OriginalSource).Name, "SuggestionsList", System.StringComparison.Ordinal))
|
||||
{
|
||||
HideCurrentToolTip();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user