1
0
Эх сурвалжийг харах

All animations are on Glyphs module now and there are no unnamed animations anymore

Source commit: 908d2a012ef7087d6558628719f081722c0fcd5c
Martin Prikryl 10 жил өмнө
parent
commit
cb94148614

+ 1 - 1
source/forms/Authenticate.cpp

@@ -121,7 +121,7 @@ void __fastcall TAuthenticateForm::FormShow(TObject * /*Sender*/)
   }
 
   UnicodeString AnimationName = FSessionData->IsSecure() ? L"ConnectingSecure" : L"ConnectingInsecure";
-  FFrameAnimation.Init(AnimationPaintBox, NULL, AnimationName);
+  FFrameAnimation.Init(AnimationPaintBox, AnimationName);
   FFrameAnimation.Start();
 }
 //---------------------------------------------------------------------------

+ 1 - 1
source/forms/FileFind.cpp

@@ -62,7 +62,7 @@ __fastcall TFileFindDialog::TFileFindDialog(TComponent * Owner, TFindEvent OnFin
   UseDesktopFont(StatusBar);
 
   SetGlobalMinimizeHandler(this, GlobalMinimize);
-  FFrameAnimation.Init(AnimationPaintBox, NULL, L"Find");
+  FFrameAnimation.Init(AnimationPaintBox, L"Find");
   FixFormIcons(this);
 }
 //---------------------------------------------------------------------------

+ 1 - 1
source/forms/Progress.cpp

@@ -216,7 +216,7 @@ void __fastcall TProgressForm::UpdateControls()
 
     TopProgress->Style = IsIndetermiateOperation(FData.Operation) ? pbstMarquee : pbstNormal;
 
-    FFrameAnimation.Init(AnimationPaintBox, NULL, Animation);
+    FFrameAnimation.Init(AnimationPaintBox, Animation);
     FFrameAnimation.Start();
 
     int Delta = 0;

+ 1 - 1
source/forms/SynchronizeProgress.cpp

@@ -43,7 +43,7 @@ __fastcall TSynchronizeProgressForm::TSynchronizeProgressForm(TComponent * Owner
   {
     SetGlobalMinimizeHandler(this, GlobalMinimize);
   }
-  FFrameAnimation.Init(AnimationPaintBox, NULL, L"SynchronizeDirectories");
+  FFrameAnimation.Init(AnimationPaintBox, L"SynchronizeDirectories");
 }
 //---------------------------------------------------------------------------
 __fastcall TSynchronizeProgressForm::~TSynchronizeProgressForm()

+ 4 - 16
source/windows/GUITools.cpp

@@ -887,14 +887,9 @@ __fastcall TFrameAnimation::TFrameAnimation()
   FFirstFrame = -1;
 }
 //---------------------------------------------------------------------------
-void __fastcall TFrameAnimation::Init(TPaintBox * PaintBox, TPngImageList * ImageList)
+void __fastcall TFrameAnimation::Init(TPaintBox * PaintBox, const UnicodeString & Name)
 {
-  DoInit(PaintBox, ImageList, UnicodeString(), false);
-}
-//---------------------------------------------------------------------------
-void __fastcall TFrameAnimation::Init(TPaintBox * PaintBox, TPngImageList * ImageList, const UnicodeString & Name)
-{
-  DoInit(PaintBox, ImageList, Name, Name.IsEmpty());
+  DoInit(PaintBox, NULL, Name, Name.IsEmpty());
 }
 //---------------------------------------------------------------------------
 void __fastcall TFrameAnimation::DoInit(TPaintBox * PaintBox, TPngImageList * ImageList, const UnicodeString & Name, bool Null)
@@ -909,7 +904,6 @@ void __fastcall TFrameAnimation::DoInit(TPaintBox * PaintBox, TPngImageList * Im
   PaintBox->Height = FImageList->Height;
   FPaintBox = PaintBox;
 
-  FNamed = !Name.IsEmpty();
   if (!Null)
   {
     int Frame = 0;
@@ -917,10 +911,7 @@ void __fastcall TFrameAnimation::DoInit(TPaintBox * PaintBox, TPngImageList * Im
     {
       UnicodeString FrameData = FImageList->PngImages->Items[Frame]->Name;
       UnicodeString FrameName;
-      if (FNamed)
-      {
-        FrameName = CutToChar(FrameData, L'_', false);
-      }
+      FrameName = CutToChar(FrameData, L'_', false);
 
       if (SameText(Name, FrameName))
       {
@@ -1065,10 +1056,7 @@ void __fastcall TFrameAnimation::CalculateNextFrameTick()
 {
   TPngImageCollectionItem * ImageItem = GetCurrentImage();
   UnicodeString Duration = ImageItem->Name;
-  if (FNamed)
-  {
-    CutToChar(Duration, L'_', false);
-  }
+  CutToChar(Duration, L'_', false);
   // skip index (is not really used)
   CutToChar(Duration, L'_', false);
   // This should overflow, when tick count wraps.

+ 1 - 3
source/windows/GUITools.h

@@ -91,15 +91,13 @@ class TFrameAnimation
 {
 public:
   __fastcall TFrameAnimation();
-  void __fastcall Init(TPaintBox * PaintBox, TPngImageList * ImageList);
-  void __fastcall Init(TPaintBox * PaintBox, TPngImageList * ImageList, const UnicodeString & Name);
+  void __fastcall Init(TPaintBox * PaintBox, const UnicodeString & Name);
   void __fastcall Start();
   void __fastcall Stop();
 
 private:
   TPaintBox * FPaintBox;
   TPngImageList * FImageList;
-  bool FNamed;
   int FFirstFrame;
   int FFirstLoopFrame;
   int FLastFrame;