mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +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();
|
InitializeComponent();
|
||||||
TitleBarRootContainer.SizeChanged += TitleBarRootContainer_SizeChanged;
|
TitleBarRootContainer.SizeChanged += TitleBarRootContainer_SizeChanged;
|
||||||
|
|
||||||
|
LaunchAppButton.RegisterPropertyChangedCallback(VisibilityProperty, LaunchAppButtonVisibilityChangedCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IFileSystemItem Item
|
public IFileSystemItem Item
|
||||||
@@ -117,6 +119,9 @@ namespace Peek.UI.Views
|
|||||||
if (AppWindowTitleBar.IsCustomizationSupported())
|
if (AppWindowTitleBar.IsCustomizationSupported())
|
||||||
{
|
{
|
||||||
UpdateTitleBarCustomization(mainWindow);
|
UpdateTitleBarCustomization(mainWindow);
|
||||||
|
|
||||||
|
// Ensure the drag region of the title bar is updated on first Peek activation
|
||||||
|
UpdateDragRegion();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -357,5 +362,16 @@ namespace Peek.UI.Views
|
|||||||
OpenWithAppToolTip = string.Empty;
|
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