2828using System . Windows . Interop ;
2929using Windows . Win32 ;
3030using Window = System . Windows . Window ;
31+ using System . Linq ;
3132
3233namespace Flow . Launcher
3334{
@@ -37,17 +38,17 @@ public partial class MainWindow
3738
3839 private readonly Storyboard _progressBarStoryboard = new Storyboard ( ) ;
3940 private bool isProgressBarStoryboardPaused ;
40- private Settings _settings ;
41+ private readonly Settings _settings ;
4142 private NotifyIcon _notifyIcon ;
42- private ContextMenu contextMenu = new ContextMenu ( ) ;
43- private MainViewModel _viewModel ;
43+ private readonly ContextMenu contextMenu = new ( ) ;
44+ private readonly MainViewModel _viewModel ;
4445 private bool _animating ;
4546 private bool isArrowKeyPressed = false ;
4647
4748 private MediaPlayer animationSoundWMP ;
4849 private SoundPlayer animationSoundWPF ;
4950
50- //For Window Animations
51+ // Window Animations
5152 private Storyboard clocksb ;
5253 private Storyboard iconsb ;
5354 private Storyboard windowsb ;
@@ -112,7 +113,6 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
112113 return IntPtr . Zero ;
113114 }
114115
115-
116116 private void OnResizeEnd ( )
117117 {
118118 int shadowMargin = 0 ;
@@ -383,7 +383,7 @@ private void InitializeNotifyIcon()
383383 {
384384 _notifyIcon = new NotifyIcon
385385 {
386- Text = Infrastructure . Constant . FlowLauncherFullName ,
386+ Text = Constant . FlowLauncherFullName ,
387387 Icon = Constant . Version == "1.0.0" ? Properties . Resources . dev : Properties . Resources . app ,
388388 Visible = ! _settings . HideNotifyIcon
389389 } ;
@@ -564,8 +564,7 @@ public void WindowAnimator()
564564 FillBehavior = FillBehavior . HoldEnd
565565 } ;
566566
567- double TargetIconOpacity = GetOpacityFromStyle ( SearchIcon , SearchIcon . Style , 1.0 ) ;
568-
567+ double TargetIconOpacity = GetOpacityFromStyle ( SearchIcon . Style , 1.0 ) ;
569568
570569 var IconOpacity = new DoubleAnimation
571570 {
@@ -577,7 +576,7 @@ public void WindowAnimator()
577576 } ;
578577
579578 const double DefaultRightMargin = 66 ; //* this value from base.xaml
580- double rightMargin = GetThicknessFromStyle ( ClockPanel , ClockPanel . Style , new Thickness ( 0 , 0 , DefaultRightMargin , 0 ) ) . Right ;
579+ double rightMargin = GetThicknessFromStyle ( ClockPanel . Style , new Thickness ( 0 , 0 , DefaultRightMargin , 0 ) ) . Right ;
581580
582581 var thicknessAnimation = new ThicknessAnimation
583582 {
@@ -626,14 +625,14 @@ public void WindowAnimator()
626625 windowsb . Begin ( FlowMainWindow ) ;
627626 }
628627
629- private double GetOpacityFromStyle ( UIElement element , Style style , double defaultOpacity = 1.0 )
628+ private static double GetOpacityFromStyle ( Style style , double defaultOpacity = 1.0 )
630629 {
631630 if ( style == null )
632631 return defaultOpacity ;
633632
634- foreach ( Setter setter in style . Setters )
633+ foreach ( Setter setter in style . Setters . Cast < Setter > ( ) )
635634 {
636- if ( setter . Property == UIElement . OpacityProperty )
635+ if ( setter . Property == OpacityProperty )
637636 {
638637 return setter . Value is double opacity ? opacity : defaultOpacity ;
639638 }
@@ -642,14 +641,14 @@ private double GetOpacityFromStyle(UIElement element, Style style, double defaul
642641 return defaultOpacity ;
643642 }
644643
645- private Thickness GetThicknessFromStyle ( UIElement element , Style style , Thickness defaultThickness )
644+ private static Thickness GetThicknessFromStyle ( Style style , Thickness defaultThickness )
646645 {
647646 if ( style == null )
648647 return defaultThickness ;
649648
650- foreach ( Setter setter in style . Setters )
649+ foreach ( Setter setter in style . Setters . Cast < Setter > ( ) )
651650 {
652- if ( setter . Property == FrameworkElement . MarginProperty )
651+ if ( setter . Property == MarginProperty )
653652 {
654653 return setter . Value is Thickness thickness ? thickness : defaultThickness ;
655654 }
@@ -658,8 +657,6 @@ private Thickness GetThicknessFromStyle(UIElement element, Style style, Thicknes
658657 return defaultThickness ;
659658 }
660659
661-
662-
663660 private bool _isClockPanelAnimating = false ; // 애니메이션 실행 중인지 여부
664661
665662 private void UpdateClockPanelVisibility ( )
@@ -722,7 +719,7 @@ private void UpdateClockPanelVisibility()
722719 _isClockPanelAnimating = false ;
723720 } ;
724721
725- ClockPanel . BeginAnimation ( UIElement . OpacityProperty , fadeOut ) ;
722+ ClockPanel . BeginAnimation ( OpacityProperty , fadeOut ) ;
726723 }
727724 // ✅ 4. ClockPanel을 표시하는 경우 (페이드인 애니메이션 적용)
728725 else if ( shouldShowClock && ClockPanel . Visibility != Visibility . Visible && ! _isClockPanelAnimating )
@@ -742,7 +739,7 @@ private void UpdateClockPanelVisibility()
742739 } ;
743740
744741 fadeIn . Completed += ( s , e ) => _isClockPanelAnimating = false ;
745- ClockPanel . BeginAnimation ( UIElement . OpacityProperty , fadeIn ) ;
742+ ClockPanel . BeginAnimation ( OpacityProperty , fadeIn ) ;
746743 } , DispatcherPriority . Render ) ;
747744 }
748745 }
@@ -864,7 +861,7 @@ public void HideStartup()
864861
865862 public Screen SelectedScreen ( )
866863 {
867- Screen screen = null ;
864+ Screen screen ;
868865 switch ( _settings . SearchWindowScreen )
869866 {
870867 case SearchWindowScreens . Cursor :
0 commit comments