Skip to content

Commit

Permalink
Fix: Fixed highlights flickering after closing the properties window (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hishitetsu authored Feb 28, 2023
1 parent 1e34141 commit acbcefb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/Files.App/Helpers/FilePropertiesHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ public static async Task OpenPropertiesWindowAsync(object item, IShellPage assoc
appWindow.SetIcon(LogoPath);

if (frame.Content is Views.Properties.MainPropertiesPage properties)
{
properties.Window = propertiesWindow;
properties.AppWindow = appWindow;
}

appWindow.Show();

Expand Down
4 changes: 3 additions & 1 deletion src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public sealed partial class MainPropertiesPage : Page
public SettingsViewModel AppSettings
=> App.AppSettings;

public Window Window;
public AppWindow AppWindow;

public ObservableCollection<SquareNavViewItem> NavViewItems { get; set; }
Expand Down Expand Up @@ -308,7 +309,8 @@ private void Page_KeyDown(object sender, KeyRoutedEventArgs e)
private void ClosePage()
{
if (_usingWinUI)
AppWindow.Destroy();
// AppWindow.Destroy() doesn't seem to work well. (#11461)
Window.Close();
else
_propertiesDialog?.Hide();
}
Expand Down
12 changes: 8 additions & 4 deletions src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public sealed partial class SecurityAdvancedPage : Page

public SecurityViewModel ViewModel { get; set; }

public Window window;
public AppWindow appWindow;

public SecurityAdvancedPage()
Expand Down Expand Up @@ -125,7 +126,8 @@ private async void OKButton_Click(object sender, RoutedEventArgs e)
{
if (ViewModel.SetFilePermissions())
{
appWindow.Destroy();
// AppWindow.Destroy() doesn't seem to work well. (#11461)
window.Close();
}
}
else
Expand All @@ -137,7 +139,8 @@ private async void CancelButton_Click(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
{
appWindow.Destroy();
// AppWindow.Destroy() doesn't seem to work well. (#11461)
window.Close();
}
else
{
Expand All @@ -150,7 +153,8 @@ private async void Page_KeyDown(object sender, KeyRoutedEventArgs e)
{
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
{
appWindow.Destroy();
// AppWindow.Destroy() doesn't seem to work well. (#11461)
window.Close();
}
else
{
Expand Down Expand Up @@ -183,4 +187,4 @@ private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs
}
}
}
}
}
3 changes: 3 additions & 0 deletions src/Files.App/Views/Properties/SecurityPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ private void OpenAdvancedProperties()
// Set content
propertiesWindow.Content = frame;
if (frame.Content is SecurityAdvancedPage properties)
{
properties.window = propertiesWindow;
properties.appWindow = appWindow;
}

// Set min size
propertiesWindow.MinWidth = 850;
Expand Down

0 comments on commit acbcefb

Please sign in to comment.