Skip to content

Commit d90b82a

Browse files
committed
Code Cleanup
1 parent 4e15cb0 commit d90b82a

File tree

2 files changed

+7
-45
lines changed

2 files changed

+7
-45
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,10 @@ public struct MARGINS
117117

118118
public static class Methods
119119
{
120-
[DllImport("DwmApi.dll")]
121-
static extern int DwmExtendFrameIntoClientArea(
122-
IntPtr hwnd,
123-
ref ParameterTypes.MARGINS pMarInset);
124120

125121
[DllImport("dwmapi.dll")]
126122
static extern int DwmSetWindowAttribute(IntPtr hwnd, ParameterTypes.DWMWINDOWATTRIBUTE dwAttribute, ref int pvAttribute, int cbAttribute);
127123

128-
public static int ExtendFrame(IntPtr hwnd, ParameterTypes.MARGINS margins)
129-
=> DwmExtendFrameIntoClientArea(hwnd, ref margins);
130-
131124
public static int SetWindowAttribute(IntPtr hwnd, ParameterTypes.DWMWINDOWATTRIBUTE attribute, int parameter)
132125
=> DwmSetWindowAttribute(hwnd, attribute, ref parameter, Marshal.SizeOf<int>());
133126
}
@@ -154,19 +147,9 @@ public void RefreshFrame()
154147
if (mainWindowSrc == null)
155148
return;
156149

157-
ParameterTypes.MARGINS margins = new ParameterTypes.MARGINS();
158-
margins.cxLeftWidth = -1;
159-
margins.cxRightWidth = -1;
160-
margins.cyTopHeight = -1;
161-
margins.cyBottomHeight = -1;
162-
Methods.ExtendFrame(mainWindowSrc.Handle, margins);
163-
164150
// Remove OS minimizing/maximizing animation
165151
// Methods.SetWindowAttribute(new WindowInteropHelper(mainWindow).Handle, DWMWINDOWATTRIBUTE.DWMWA_TRANSITIONS_FORCEDISABLED, 3);
166152

167-
// Methods.SetWindowAttribute(new WindowInteropHelper(mainWindow).Handle, DWMWINDOWATTRIBUTE.DWMWA_BORDER_COLOR, 0x00FF0000);
168-
// Methods.SetWindowAttribute(new WindowInteropHelper(mainWindow).Handle, DWMWINDOWATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE, 3);
169-
170153
// The timing of adding the shadow effect should vary depending on whether the theme is transparent.
171154
if (BlurEnabled)
172155
{
@@ -389,7 +372,6 @@ private void ApplyPreviewBackground(Color? bgColor = null)
389372

390373
public void ColorizeWindow(string Mode)
391374
{
392-
Debug.WriteLine("창 DWM 색상 설정");
393375
Application.Current.Dispatcher.Invoke(() =>
394376
{
395377
var dict = GetThemeResourceDictionary(_settings.Theme);

Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ public Theme.ThemeData SelectedTheme
3535
_selectedTheme = value;
3636
ThemeManager.Instance.ChangeTheme(value.FileNameWithoutExtension);
3737

38-
// ✅ 비블러 테마로 변경 시 BackdropType을 None으로 자동 설정
38+
// when changed non-blur theme, change to backdrop to none
3939
if (!ThemeManager.Instance.BlurEnabled)
4040
{
4141
Settings.BackdropType = BackdropTypes.None;
4242
}
4343

44-
// ✅ 블러 테마에서는 DropShadow를 자동으로 켜고 비활성화 (사용자 변경 불가)
44+
// dropshadow on and control disabled.(user can't change dropshadow with blur theme)
4545
if (ThemeManager.Instance.BlurEnabled)
4646
{
4747
Settings.UseDropShadowEffect = true;
4848
}
4949

50-
// UI 상태 업데이트
50+
// Update UI state
5151
OnPropertyChanged(nameof(BackdropType));
5252
OnPropertyChanged(nameof(IsBackdropEnabled));
5353
OnPropertyChanged(nameof(IsDropShadowEnabled));
@@ -66,12 +66,12 @@ public bool DropShadowEffect
6666
{
6767
if (ThemeManager.Instance.BlurEnabled)
6868
{
69-
// 🔥 블러 테마에서는 항상 DropShadowEffect = true 유지
69+
// Always DropShadowEffect = true with blur theme
7070
Settings.UseDropShadowEffect = true;
7171
return;
7272
}
7373

74-
// ✅ 비블러 테마에서는 사용자가 수동으로 변경 가능
74+
// User can change shadow with non-blur theme.
7575
if (value)
7676
{
7777
ThemeManager.Instance.AddDropShadowEffectToCurrentTheme();
@@ -82,8 +82,6 @@ public bool DropShadowEffect
8282
}
8383

8484
Settings.UseDropShadowEffect = value;
85-
86-
// ✅ UI 업데이트
8785
OnPropertyChanged(nameof(DropShadowEffect));
8886
}
8987
}
@@ -220,27 +218,13 @@ public class BackdropTypeData : DropdownDataGeneric<BackdropTypes>
220218
{
221219
public void ApplyBackdrop()
222220
{
223-
//IntPtr hWnd = new WindowInteropHelper(Application.Current.MainWindow).Handle;
224-
//if (hWnd == IntPtr.Zero)
225-
// return;
226-
227-
//int backdropValue = Value switch
228-
//{
229-
// BackdropTypes.Acrylic => 3, // ✅ Acrylic (DWM_SYSTEMBACKDROP_TYPE = 3)
230-
// BackdropTypes.Mica => 2, // ✅ Mica (DWM_SYSTEMBACKDROP_TYPE = 2)
231-
// BackdropTypes.MicaAlt => 4, // ✅ MicaAlt (DWM_SYSTEMBACKDROP_TYPE = 4)
232-
// _ => 0 // ✅ None (DWM_SYSTEMBACKDROP_TYPE = 0)
233-
//};
234-
ThemeManager.Instance.SetBlurForWindow();
235-
//Methods.SetWindowAttribute(hWnd, ParameterTypes.DWMWINDOWATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE, backdropValue);
221+
ThemeManager.Instance.SetBlurForWindow();
236222
}
237223
}
238224

239-
// ✅ BackdropTypeData 리스트 (Dropdown과 연동)
240225
public List<BackdropTypeData> BackdropTypesList { get; } =
241226
DropdownDataGeneric<BackdropTypes>.GetValues<BackdropTypeData>("BackdropTypes");
242-
243-
// ✅ BackdropType 속성 (값 저장 + 자동 적용)
227+
244228
public BackdropTypes BackdropType
245229
{
246230
get => Enum.IsDefined(typeof(BackdropTypes), Settings.BackdropType)
@@ -254,12 +238,8 @@ public BackdropTypes BackdropType
254238
}
255239

256240
Settings.BackdropType = value;
257-
258-
// ✅ BackdropTypeData 리스트에서 해당하는 값 찾기
259241
var backdropData = BackdropTypesList.FirstOrDefault(b => b.Value == value);
260242
backdropData?.ApplyBackdrop();
261-
262-
// ✅ DropShadow 활성화 여부 갱신
263243
OnPropertyChanged(nameof(IsDropShadowEnabled));
264244
}
265245
}

0 commit comments

Comments
 (0)