Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed highlights flickering after closing the properties window #11498

Merged
merged 5 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 2 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,7 @@ private void Page_KeyDown(object sender, KeyRoutedEventArgs e)
private void ClosePage()
{
if (_usingWinUI)
AppWindow.Destroy();
Window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461)
hishitetsu marked this conversation as resolved.
Show resolved Hide resolved
else
_propertiesDialog?.Hide();
}
Expand Down
9 changes: 5 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,7 @@ private async void OKButton_Click(object sender, RoutedEventArgs e)
{
if (ViewModel.SetFilePermissions())
{
appWindow.Destroy();
window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461)
}
}
else
Expand All @@ -137,7 +138,7 @@ private async void CancelButton_Click(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
{
appWindow.Destroy();
window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461)
}
else
{
Expand All @@ -150,7 +151,7 @@ private async void Page_KeyDown(object sender, KeyRoutedEventArgs e)
{
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
{
appWindow.Destroy();
window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461)
}
else
{
Expand Down Expand Up @@ -183,4 +184,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