Skip to content

Commit 29c6f12

Browse files
committed
Code cleanup
1 parent a98b7b7 commit 29c6f12

File tree

4 files changed

+9
-30
lines changed

4 files changed

+9
-30
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ namespace Flow.Launcher.Infrastructure
99
{
1010
public static class Win32Helper
1111
{
12-
#region Mica
12+
#region Backdrop
13+
14+
public static bool IsBackdropSupported()
15+
{
16+
// Windows 11 (22000) 이상에서만 Mica 및 Acrylic 효과 지원
17+
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
18+
Environment.OSVersion.Version.Build >= 22000;
19+
}
1320

1421
public static unsafe bool SetMicaForWindow(Window window, bool enableMica)
1522
{

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
using System.Windows.Media;
2828
using System.Windows.Interop;
2929
using Windows.Win32;
30-
using Microsoft.VisualBasic.Devices;
31-
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
3230
using Window = System.Windows.Window;
3331

3432
namespace Flow.Launcher
@@ -749,13 +747,6 @@ private void UpdateClockPanelVisibility()
749747
}
750748
}
751749

752-
753-
754-
755-
756-
757-
758-
759750
private void InitSoundEffects()
760751
{
761752
if (_settings.WMPInstalled)

Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
using ModernWpf;
1616
using ThemeManager = Flow.Launcher.Core.Resource.ThemeManager;
1717
using ThemeManagerForColorSchemeSwitch = ModernWpf.ThemeManager;
18-
using System.Runtime.InteropServices;
1918

2019
namespace Flow.Launcher.SettingPages.ViewModels;
2120

@@ -61,17 +60,11 @@ public bool IsBackdropEnabled
6160
{
6261
get
6362
{
64-
if (!IsBackdropSupported()) return false;
63+
if (!Win32Helper.IsBackdropSupported()) return false;
6564
return SelectedTheme?.HasBlur ?? false;
6665
}
6766
}
6867

69-
private bool IsBackdropSupported()
70-
{
71-
// Windows 11 (22000) 이상에서만 Mica 및 Acrylic 효과 지원
72-
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
73-
Environment.OSVersion.Version.Build >= 22000;
74-
}
7568
public bool IsDropShadowEnabled => !ThemeManager.Instance.BlurEnabled;
7669

7770
public bool DropShadowEffect

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
using System.Windows.Media;
2828
using CommunityToolkit.Mvvm.DependencyInjection;
2929
using System.Windows.Threading;
30-
using System.Runtime.InteropServices;
3130
using System.Windows.Interop;
3231

3332
namespace Flow.Launcher.ViewModel
@@ -1383,17 +1382,6 @@ public void ToggleFlowLauncher()
13831382
}
13841383
}
13851384

1386-
// DWM 관련 상수
1387-
private const int DWMWA_CLOAK = 14;
1388-
private const int SW_HIDE = 0;
1389-
private const int SW_SHOW = 5;
1390-
1391-
[DllImport("user32.dll")]
1392-
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
1393-
1394-
[DllImport("dwmapi.dll")]
1395-
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int dwAttribute, ref int pvAttribute, int cbAttribute);
1396-
13971385
public void Show()
13981386
{
13991387
Application.Current.Dispatcher.Invoke(() =>

0 commit comments

Comments
 (0)