Skip to content

Commit

Permalink
Build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmckeeth committed Sep 9, 2024
1 parent 286ff23 commit 83d1a93
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ __recovery/

# Boss dependency manager vendor folder https://github.com/HashLoad/boss
modules/
/bin
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# TelegramStickerBrowser
# [Telegram Sticker Browser](https://github.com/jimmckeeth/TelegramStickerBrowser)
A browser for Telegram Stickers (tgs) and Lottie (JSON) files written in Delphi with Skia4Delphi.

TelegramStickerBrowser uses the [Skia4Delphi library](https://github.com/skia4delphi/skia4delphi). Be sure you've installed the latest version from the **GetIt** package manager. Note that Skia4Delphi is a fast-moving project under very active development. If you have a problem it might be worth checking that you can reproduce it with the very latest release of Skia4Delphi which you can download directly from the Ski4Delphi [git hub releases page](https://github.com/skia4delphi/skia4delphi/releases).

The TelegramStickerBrowser project includes a small selection of stickers downloaded from [LottieFiles](https://lottiefiles.com/animated-stickers). You can download additional stickers from Telegram via the [@Stickerdownloadbot](https://t.me/Stickerdownloadbot).
The TelegramStickerBrowser project includes a small selection of stickers downloaded from [LottieFiles](https://lottiefiles.com/animated-stickers).

[Overview video](https://youtu.be/5CDFWCiOVNM)
[![YouTube overview video](screenshots/YouTubeThumb.jpg)](https://youtu.be/5CDFWCiOVNM)
Expand All @@ -13,4 +13,4 @@ The TelegramStickerBrowser project includes a small selection of stickers downlo

This was originally developed with the [Techno Light Style](https://delphistyles.com/fmx/TechnoLineLight.html) by DelphiStyles, but it is uploaded here with the Transparent style.

This is a FireMonkey (FMX) application, so should also work on Android, iOS, macOS, and Linux, but only tested on Windows. Developed with [Delphi 11.1 Alexadria](https://www.embarcadero.com/products/delphi), but should be compilable with the free [Delphi Community Edition](https://www.embarcadero.com/products/delphi/starter) as well.
This is a FireMonkey (FMX) application, so should also work on Android, iOS, macOS, and Linux, but only tested on Windows. Developed with [Delphi 12 Athens](https://www.embarcadero.com/products/delphi), but should be compilable with the free [Delphi Community Edition](https://www.embarcadero.com/products/delphi/starter) as well.
5 changes: 3 additions & 2 deletions src/TelegramStickerBrowser.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ProjectGuid>{64EBA922-FF0A-4A32-ABD0-2D2E921962E6}</ProjectGuid>
<ProjectName Condition="'$(ProjectName)'==''">TelegramStickerBrowser</ProjectName>
<ProjectVersion>20.1</ProjectVersion>
<TargetedPlatforms>693267</TargetedPlatforms>
<TargetedPlatforms>693395</TargetedPlatforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
Expand Down Expand Up @@ -303,11 +303,12 @@
<Platforms>
<Platform value="Android">True</Platform>
<Platform value="Android64">True</Platform>
<Platform value="Linux64">False</Platform>
<Platform value="Linux64">True</Platform>
<Platform value="OSX64">True</Platform>
<Platform value="OSXARM64">True</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">True</Platform>
<Platform value="Win64x">False</Platform>
<Platform value="iOSDevice64">True</Platform>
<Platform value="iOSSimARM64">True</Platform>
</Platforms>
Expand Down
6 changes: 3 additions & 3 deletions src/tgsBrowserMain.fmx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ object Form12: TForm12
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
DesignerMasterStyle = 0
object HorzScrollBox1: THorzScrollBox
Align = Top
Expand Down Expand Up @@ -772,7 +772,7 @@ object Form12: TForm12
Touch.InteractiveGestures = [LongTap, DoubleTap]
Anchors = [akLeft, akTop, akRight]
TabOrder = 0
Text = '..\..\..\Stickers'
Text = 'Stickers'
Position.X = 82.000000000000000000
Position.Y = 8.000000000000000000
Size.Width = 462.000000000000000000
Expand Down Expand Up @@ -14191,7 +14191,7 @@ object Form12: TForm12
'Telegram Stickers (*.tgs)|*.tgs|Lottie Files (*.json; *.lottie)|' +
'*.json; *.lottie|All supported|*.json; *.lottie; *.tgs|Any files' +
'|*.*'
Options = [ofHideReadOnly, ofPathMustExist, ofEnableSizing]
Options = [ofNoValidate, ofPathMustExist, ofNoDereferenceLinks, ofEnableSizing]
Left = 354
Top = 64
end
Expand Down
53 changes: 29 additions & 24 deletions src/tgsBrowserMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ TForm12 = class(TForm)
OpenDialog1: TOpenDialog;
SpeedButton2: TSpeedButton;
procedure TrackBar1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TrackBar1Click(Sender: TObject);
procedure TrackBar1KeyDown(Sender: TObject; var Key: Word;
var KeyChar: Char; Shift: TShiftState);
Expand All @@ -42,6 +41,7 @@ TForm12 = class(TForm)
procedure EditPathChange(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure SkAnimatedImage1AnimationProcess(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
FPreviewImages: TObjectList<TSkAnimatedImage>;
Expand All @@ -60,12 +60,6 @@ implementation

uses IOUtils;

procedure TForm12.FormCreate(Sender: TObject);
begin
FPreviewImages := TObjectList<TSkAnimatedImage>.Create(True);
LoadDirectories;
end;

procedure TForm12.FormDestroy(Sender: TObject);
begin
HorzScrollBox1.BeginUpdate;
Expand All @@ -76,6 +70,12 @@ procedure TForm12.FormDestroy(Sender: TObject);
end;
end;

procedure TForm12.FormShow(Sender: TObject);
begin
FPreviewImages := TObjectList<TSkAnimatedImage>.Create(True);
LoadDirectories;
end;

procedure TForm12.ckAnimateChange(Sender: TObject);
begin
if ckAnimate.IsChecked then
Expand Down Expand Up @@ -103,19 +103,21 @@ procedure TForm12.ListBox1Click(Sender: TObject);

procedure TForm12.LoadDirectories();
begin
HorzScrollBox1.BeginUpdate;
try
ListBox1.Items.Clear;
FPreviewImages.Clear;

var dirs := TDirectory.GetDirectories(EditPath.Text);
for var dir in dirs do
ListBox1.Items.Add(TPath.GetFileName(dir));
ListBox1.Items.Add('.');
ListBox1.ItemIndex := 0;
LoadTgs;
finally
HorzScrollBox1.EndUpdate;
if TDirectory.Exists(EditPath.Text) then
begin
HorzScrollBox1.BeginUpdate;
try
ListBox1.Items.Clear;
FPreviewImages.Clear;
var dirs := TDirectory.GetDirectories(EditPath.Text);
for var dir in dirs do
ListBox1.Items.Add(TPath.GetFileName(dir));
ListBox1.Items.Add('.');
ListBox1.ItemIndex := 0;
LoadTgs;
finally
HorzScrollBox1.EndUpdate;
end;
end;
end;

Expand Down Expand Up @@ -170,10 +172,13 @@ procedure TForm12.SkAnimatedImageClick(Sender: TObject);

procedure TForm12.SpeedButton1Click(Sender: TObject);
begin
ListBox1.ItemIndex := Random(ListBox1.Items.Count);
LoadTgs(False);
SkAnimatedImage1.Source.Assign(
FPreviewImages[Random(FPreviewImages.Count)].Source);
if ListBox1.Items.Count > 0 then
begin
ListBox1.ItemIndex := Random(ListBox1.Items.Count);
LoadTgs(False);
SkAnimatedImage1.Source.Assign(
FPreviewImages[Random(FPreviewImages.Count)].Source);
end;
end;

procedure TForm12.SpeedButton2Click(Sender: TObject);
Expand Down

0 comments on commit 83d1a93

Please sign in to comment.