mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-29 08:29:10 +01:00
Compare commits
4 Commits
update-tel
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0add0d5d48 | ||
|
|
77c7688bdd | ||
|
|
58e3e362f8 | ||
|
|
bdecd75099 |
@@ -8,7 +8,6 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ManagedCommon;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
@@ -16,11 +15,11 @@ using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Telemetry.Events;
|
||||
using Microsoft.PowerToys.Settings.UI.SerializationContext;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Microsoft.PowerToys.Settings.UI.SettingsXAML.Controls.Dashboard;
|
||||
using Microsoft.PowerToys.Settings.UI.Views;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.UI.Xaml;
|
||||
using PowerToys.Interop;
|
||||
using Windows.UI.Popups;
|
||||
using WinRT.Interop;
|
||||
using WinUIEx;
|
||||
|
||||
@@ -365,6 +364,7 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
private static MainWindow settingsWindow;
|
||||
private static OobeWindow oobeWindow;
|
||||
private static FlyoutWindow flyoutWindow;
|
||||
private static ShortcutConflictWindow shortcutConflictWindow;
|
||||
|
||||
public static void ClearSettingsWindow()
|
||||
{
|
||||
@@ -406,6 +406,21 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
flyoutWindow = null;
|
||||
}
|
||||
|
||||
public static ShortcutConflictWindow GetShortcutConflictWindow()
|
||||
{
|
||||
return shortcutConflictWindow;
|
||||
}
|
||||
|
||||
public static void SetShortcutConflictWindow(ShortcutConflictWindow window)
|
||||
{
|
||||
shortcutConflictWindow = window;
|
||||
}
|
||||
|
||||
public static void ClearShortcutConflictWindow()
|
||||
{
|
||||
shortcutConflictWindow = null;
|
||||
}
|
||||
|
||||
public static Type GetPage(string settingWindow)
|
||||
{
|
||||
switch (settingWindow)
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.HotkeyConflicts;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Telemetry.Events;
|
||||
using Microsoft.PowerToys.Settings.UI.SettingsXAML.Controls.Dashboard;
|
||||
@@ -154,11 +151,16 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
||||
ConflictCount = this.ConflictCount,
|
||||
});
|
||||
|
||||
// Create and show the new window instead of dialog
|
||||
var conflictWindow = new ShortcutConflictWindow();
|
||||
|
||||
// Show the window
|
||||
conflictWindow.Activate();
|
||||
if (App.GetShortcutConflictWindow() == null)
|
||||
{
|
||||
var conflictWindow = new ShortcutConflictWindow();
|
||||
App.SetShortcutConflictWindow(conflictWindow);
|
||||
conflictWindow.Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
App.GetShortcutConflictWindow().Activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,13 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using CommunityToolkit.WinUI.Controls;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.HotkeyConflicts;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
using Microsoft.PowerToys.Settings.UI.Views;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
@@ -26,6 +23,9 @@ namespace Microsoft.PowerToys.Settings.UI.SettingsXAML.Controls.Dashboard
|
||||
|
||||
public ShortcutConflictWindow()
|
||||
{
|
||||
App.ThemeService.ThemeChanged += OnThemeChanged;
|
||||
App.ThemeService.ApplyTheme();
|
||||
|
||||
var settingsUtils = new SettingsUtils();
|
||||
ViewModel = new ShortcutConflictViewModel(
|
||||
settingsUtils,
|
||||
@@ -50,6 +50,11 @@ namespace Microsoft.PowerToys.Settings.UI.SettingsXAML.Controls.Dashboard
|
||||
ViewModel.OnPageLoaded();
|
||||
}
|
||||
|
||||
private void OnThemeChanged(object sender, ElementTheme theme)
|
||||
{
|
||||
WindowHelper.SetTheme(this, theme);
|
||||
}
|
||||
|
||||
private void CenterOnScreen()
|
||||
{
|
||||
var displayArea = DisplayArea.GetFromWindowId(this.AppWindow.Id, DisplayAreaFallback.Nearest);
|
||||
@@ -126,7 +131,16 @@ namespace Microsoft.PowerToys.Settings.UI.SettingsXAML.Controls.Dashboard
|
||||
|
||||
private void WindowEx_Closed(object sender, WindowEventArgs args)
|
||||
{
|
||||
App.ClearShortcutConflictWindow();
|
||||
ViewModel?.Dispose();
|
||||
|
||||
var mainWindow = App.GetSettingsWindow();
|
||||
if (mainWindow != null)
|
||||
{
|
||||
mainWindow.CloseHiddenWindow();
|
||||
}
|
||||
|
||||
App.ThemeService.ThemeChanged -= OnThemeChanged;
|
||||
}
|
||||
|
||||
private void Window_Activated_SetIcon(object sender, WindowActivatedEventArgs args)
|
||||
|
||||
@@ -9,7 +9,6 @@ using System.Linq;
|
||||
using CommunityToolkit.WinUI;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.HotkeyConflicts;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Telemetry.Events;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Microsoft.PowerToys.Settings.UI.SettingsXAML.Controls.Dashboard;
|
||||
@@ -300,9 +299,16 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
||||
// Close the current shortcut dialog
|
||||
shortcutDialog.Hide();
|
||||
|
||||
// Create and show the ShortcutConflictWindow
|
||||
var conflictWindow = new ShortcutConflictWindow();
|
||||
conflictWindow.Activate();
|
||||
if (App.GetShortcutConflictWindow() == null)
|
||||
{
|
||||
var conflictWindow = new ShortcutConflictWindow();
|
||||
App.SetShortcutConflictWindow(conflictWindow);
|
||||
conflictWindow.Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
App.GetShortcutConflictWindow().Activate();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateKeyVisualStyles()
|
||||
|
||||
@@ -7,7 +7,6 @@ using global::PowerToys.GPOWrapper;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.HotkeyConflicts;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
||||
using Microsoft.PowerToys.Settings.UI.OOBE.Enums;
|
||||
using Microsoft.PowerToys.Settings.UI.OOBE.ViewModel;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
@@ -280,9 +279,16 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
|
||||
return;
|
||||
}
|
||||
|
||||
// Create and show the shortcut conflict window
|
||||
var conflictWindow = new ShortcutConflictWindow();
|
||||
conflictWindow.Activate();
|
||||
if (App.GetShortcutConflictWindow() == null)
|
||||
{
|
||||
var conflictWindow = new ShortcutConflictWindow();
|
||||
App.SetShortcutConflictWindow(conflictWindow);
|
||||
conflictWindow.Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
App.GetShortcutConflictWindow().Activate();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user