mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 19:27:56 +01:00
[Peek]Fix TitleBar Drag Region and unclickable open button issues (#32004)
This commit is contained in:
committed by
GitHub
parent
42fb394bf3
commit
d67b02bae3
@@ -82,6 +82,8 @@ namespace Peek.UI.Views
|
||||
{
|
||||
InitializeComponent();
|
||||
TitleBarRootContainer.SizeChanged += TitleBarRootContainer_SizeChanged;
|
||||
|
||||
LaunchAppButton.RegisterPropertyChangedCallback(VisibilityProperty, LaunchAppButtonVisibilityChangedCallback);
|
||||
}
|
||||
|
||||
public IFileSystemItem Item
|
||||
@@ -117,6 +119,9 @@ namespace Peek.UI.Views
|
||||
if (AppWindowTitleBar.IsCustomizationSupported())
|
||||
{
|
||||
UpdateTitleBarCustomization(mainWindow);
|
||||
|
||||
// Ensure the drag region of the title bar is updated on first Peek activation
|
||||
UpdateDragRegion();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -357,5 +362,16 @@ namespace Peek.UI.Views
|
||||
OpenWithAppToolTip = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensure the drag region of the title bar is updated when the visibility of the launch app button changes.
|
||||
/// </summary>
|
||||
private async void LaunchAppButtonVisibilityChangedCallback(DependencyObject sender, DependencyProperty dp)
|
||||
{
|
||||
// Ensure the ActualWidth is updated
|
||||
await Task.Delay(100);
|
||||
|
||||
UpdateDragRegion();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user