mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Code cleanup
This commit is contained in:
parent
a98b7b72bd
commit
29c6f12cc5
4 changed files with 9 additions and 30 deletions
|
|
@ -9,7 +9,14 @@ namespace Flow.Launcher.Infrastructure
|
|||
{
|
||||
public static class Win32Helper
|
||||
{
|
||||
#region Mica
|
||||
#region Backdrop
|
||||
|
||||
public static bool IsBackdropSupported()
|
||||
{
|
||||
// Windows 11 (22000) 이상에서만 Mica 및 Acrylic 효과 지원
|
||||
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
|
||||
Environment.OSVersion.Version.Build >= 22000;
|
||||
}
|
||||
|
||||
public static unsafe bool SetMicaForWindow(Window window, bool enableMica)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ using DataObject = System.Windows.DataObject;
|
|||
using System.Windows.Media;
|
||||
using System.Windows.Interop;
|
||||
using Windows.Win32;
|
||||
using Microsoft.VisualBasic.Devices;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using Window = System.Windows.Window;
|
||||
|
||||
namespace Flow.Launcher
|
||||
|
|
@ -749,13 +747,6 @@ namespace Flow.Launcher
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void InitSoundEffects()
|
||||
{
|
||||
if (_settings.WMPInstalled)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ using Flow.Launcher.ViewModel;
|
|||
using ModernWpf;
|
||||
using ThemeManager = Flow.Launcher.Core.Resource.ThemeManager;
|
||||
using ThemeManagerForColorSchemeSwitch = ModernWpf.ThemeManager;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Flow.Launcher.SettingPages.ViewModels;
|
||||
|
||||
|
|
@ -61,17 +60,11 @@ public partial class SettingsPaneThemeViewModel : BaseModel
|
|||
{
|
||||
get
|
||||
{
|
||||
if (!IsBackdropSupported()) return false;
|
||||
if (!Win32Helper.IsBackdropSupported()) return false;
|
||||
return SelectedTheme?.HasBlur ?? false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsBackdropSupported()
|
||||
{
|
||||
// Windows 11 (22000) 이상에서만 Mica 및 Acrylic 효과 지원
|
||||
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
|
||||
Environment.OSVersion.Version.Build >= 22000;
|
||||
}
|
||||
public bool IsDropShadowEnabled => !ThemeManager.Instance.BlurEnabled;
|
||||
|
||||
public bool DropShadowEffect
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ using Flow.Launcher.Infrastructure.Image;
|
|||
using System.Windows.Media;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
using System.Windows.Threading;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Interop;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
|
|
@ -1383,17 +1382,6 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
// DWM 관련 상수
|
||||
private const int DWMWA_CLOAK = 14;
|
||||
private const int SW_HIDE = 0;
|
||||
private const int SW_SHOW = 5;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
|
||||
|
||||
[DllImport("dwmapi.dll")]
|
||||
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int dwAttribute, ref int pvAttribute, int cbAttribute);
|
||||
|
||||
public void Show()
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue