@@ -803,7 +803,8 @@ private async void checkUpdatesToolStripMenuItem_Click(object sender, EventArgs
803
803
var label = UpdateTooltips ( update ) ;
804
804
string line = label . Split ( '\r ' ) [ 0 ] ;
805
805
ShowStatus ( line ) ;
806
- AnimateUpdateButton ( UpdateRequired ( update . Latest ) ) ;
806
+ ShowUpdateButton ( ) ;
807
+ this . _delayedActions . StartDelayedAction ( "AnimateUpdateButton" , ( ) => AnimateUpdateButton ( null ) , TimeSpan . FromMilliseconds ( 0 ) ) ;
807
808
}
808
809
}
809
810
catch
@@ -812,60 +813,23 @@ private async void checkUpdatesToolStripMenuItem_Click(object sender, EventArgs
812
813
this . statusStrip1 . BackColor = saved ;
813
814
}
814
815
815
- private void AnimateUpdateButton ( bool updateAvailable )
816
+ private void AnimateUpdateButton ( string target )
816
817
{
817
- string caption = updateAvailable ? SR . UpdateAvailableCaption : SR . UpToDate ;
818
- //
819
- // animationCanvas1
820
- //
821
- var animationCanvas1 = new XmlNotepad . AnimationCanvas ( ) ;
822
- animationCanvas1 . Dock = System . Windows . Forms . DockStyle . Fill ;
823
- animationCanvas1 . Location = new System . Drawing . Point ( 0 , 0 ) ;
824
- animationCanvas1 . Margin = new System . Windows . Forms . Padding ( 0 ) ;
825
- animationCanvas1 . Name = "animationCanvas1" ;
826
- animationCanvas1 . Size = this . Size ;
827
- animationCanvas1 . TabIndex = 0 ;
828
- this . Controls . Add ( animationCanvas1 ) ;
829
-
830
- // give the AnimationCanvas the background image of the current state of this application so
831
- // that the animation looks like it is floating over this form. Using transparent Controls
832
- // doesn't work nicely with double buffered controls, and does an inefficient amount of repainting
833
- // and DrawToBitmap simply doesn't work at all for WebBrowser controls.
834
- Rectangle screenRectangle = this . RectangleToScreen ( this . ClientRectangle ) ;
835
- animationCanvas1 . InitializeBackgroundFromScreen ( screenRectangle . X , screenRectangle . Y + menuStrip1 . Height + toolStrip1 . Height ) ;
836
-
837
- int buttonWidth = 100 ;
838
- using ( var g = this . CreateGraphics ( ) )
839
- {
840
- var size = g . MeasureString ( caption , toolStripMenuItemUpdate . Font , this . Width ) ;
841
- buttonWidth = ( int ) size . Width + ( 4 * 2 ) ;
842
- }
843
-
844
- RectangleShape shape = new RectangleShape ( )
845
- {
846
- Fill = new System . Drawing . SolidBrush ( this . toolStripMenuItemUpdate . BackColor ) ,
847
- Label = caption ,
848
- Font = this . Font ,
849
- Foreground = new System . Drawing . SolidBrush ( this . ForeColor )
850
- } ;
851
-
852
- var animation = new BoundsAnimation ( )
818
+ if ( target == null )
853
819
{
854
- Duration = TimeSpan . FromSeconds ( 1 ) ,
855
- End = new Rectangle ( this . Width - 100 , 0 , 100 , 30 ) ,
856
- Start = new Rectangle ( 0 , this . Height - 30 , this . Width , 30 ) ,
857
- TargetProperty = "Bounds" ,
858
- Function = new AnimationEaseInFunction ( )
859
- } ;
860
- animation . Completed += ( s , e ) =>
820
+ target = this . toolStripMenuItemUpdate . Text ;
821
+ this . toolStripMenuItemUpdate . Text = "" ;
822
+ }
823
+ else if ( target == this . toolStripMenuItemUpdate . Text )
861
824
{
862
- this . Controls . Remove ( animationCanvas1 ) ;
863
- ShowUpdateButton ( ) ;
864
- } ;
865
-
866
- shape . BeginAnimation ( animation ) ;
867
- animationCanvas1 . Shapes . Add ( shape ) ;
868
- animationCanvas1 . BringToFront ( ) ;
825
+ return ; // we are finished.
826
+ }
827
+ else
828
+ {
829
+ // reveal single char at a time to catch the eye.
830
+ this . toolStripMenuItemUpdate . Text = target . Substring ( 0 , this . toolStripMenuItemUpdate . Text . Length + 1 ) ;
831
+ }
832
+ this . _delayedActions . StartDelayedAction ( "AnimateUpdateButton" , ( ) => AnimateUpdateButton ( target ) , TimeSpan . FromMilliseconds ( 20 ) ) ;
869
833
}
870
834
871
835
protected virtual void TabControlViews_Selected ( object sender , NoBorderTabControlEventArgs e )
@@ -1410,6 +1374,7 @@ public virtual void LoadConfig()
1410
1374
File . Delete ( this . TemporaryConfigFile ) ;
1411
1375
}
1412
1376
_settings . Load ( this . TemporaryConfigFile ) ;
1377
+ _settings [ "SettingsLocation" ] = ( int ) SettingsLocation . Roaming ;
1413
1378
}
1414
1379
else
1415
1380
{
0 commit comments