@@ -31,24 +31,31 @@ public partial class MainWindow
31
31
{
32
32
#region Private Fields
33
33
34
+ // Dependency Injection
34
35
private readonly Settings _settings ;
35
36
private readonly Theme _theme ;
37
+
38
+ // Window Notify Icon
36
39
private NotifyIcon _notifyIcon ;
40
+
41
+ // Window Context Menu
37
42
private readonly ContextMenu contextMenu = new ( ) ;
38
43
private readonly MainViewModel _viewModel ;
39
- private bool _animating ;
44
+
45
+ // Window Event : Key Event
40
46
private bool isArrowKeyPressed = false ;
41
47
48
+ // Window Sound Effects
42
49
private MediaPlayer animationSoundWMP ;
43
50
private SoundPlayer animationSoundWPF ;
44
51
52
+ // Window WndProc
45
53
private int _initialWidth ;
46
54
private int _initialHeight ;
47
55
48
- // Window Animations
49
- private Storyboard clocksb ;
50
- private Storyboard iconsb ;
51
- private Storyboard windowsb ;
56
+ // Window Animation
57
+ private const double DefaultRightMargin = 66 ; //* this value from base.xaml
58
+ private bool _animating ;
52
59
private bool _isClockPanelAnimating = false ; // 애니메이션 실행 중인지 여부
53
60
54
61
#endregion
@@ -742,9 +749,9 @@ private void WindowAnimation()
742
749
ClockPanel . Opacity = 0 ;
743
750
SearchIcon . Opacity = 0 ;
744
751
745
- windowsb = new Storyboard ( ) ;
746
- clocksb = new Storyboard ( ) ;
747
- iconsb = new Storyboard ( ) ;
752
+ var windowsb = new Storyboard ( ) ;
753
+ var clocksb = new Storyboard ( ) ;
754
+ var iconsb = new Storyboard ( ) ;
748
755
CircleEase easing = new CircleEase { EasingMode = EasingMode . EaseInOut } ;
749
756
750
757
var animationLength = _settings . AnimationSpeed switch
@@ -799,8 +806,7 @@ private void WindowAnimation()
799
806
Duration = TimeSpan . FromMilliseconds ( animationLength ) ,
800
807
FillBehavior = FillBehavior . HoldEnd
801
808
} ;
802
-
803
- const double DefaultRightMargin = 66 ; //* this value from base.xaml
809
+
804
810
double rightMargin = GetThicknessFromStyle ( ClockPanel . Style , new Thickness ( 0 , 0 , DefaultRightMargin , 0 ) ) . Right ;
805
811
806
812
var thicknessAnimation = new ThicknessAnimation
@@ -819,10 +825,10 @@ private void WindowAnimation()
819
825
Storyboard . SetTargetProperty ( thicknessAnimation , new PropertyPath ( MarginProperty ) ) ;
820
826
821
827
Storyboard . SetTarget ( WindowOpacity , this ) ;
822
- Storyboard . SetTargetProperty ( WindowOpacity , new PropertyPath ( Window . OpacityProperty ) ) ;
828
+ Storyboard . SetTargetProperty ( WindowOpacity , new PropertyPath ( OpacityProperty ) ) ;
823
829
824
830
Storyboard . SetTarget ( WindowMotion , this ) ;
825
- Storyboard . SetTargetProperty ( WindowMotion , new PropertyPath ( Window . TopProperty ) ) ;
831
+ Storyboard . SetTargetProperty ( WindowMotion , new PropertyPath ( TopProperty ) ) ;
826
832
827
833
Storyboard . SetTarget ( IconMotion , SearchIcon ) ;
828
834
Storyboard . SetTargetProperty ( IconMotion , new PropertyPath ( TopProperty ) ) ;
0 commit comments