Skip to content

Feat/country flag tray icon - #25

Open
mhabedini wants to merge 5 commits into
javaherisaber:masterfrom
mhabedini:feat/country-flag-tray-icon
Open

Feat/country flag tray icon#25
mhabedini wants to merge 5 commits into
javaherisaber:masterfrom
mhabedini:feat/country-flag-tray-icon

Conversation

@mhabedini

Copy link
Copy Markdown

No description provided.

Optional (off by default) tray icon that reflects the country of the
current public IP, so VPN/proxy exit nodes can be verified without
opening the app.

The flags shipped by country_flags are vectors and the tray only accepts
a file path, so FlagTrayIcon rasterises them on demand into the app
support directory: a multi resolution .ico on Windows, a .png on Linux.
Icons are rendered once per country per run and reused afterwards.

When the country is unknown, or the flag cannot be rendered, the tray
falls back to the bundled IRNet icons. A leak keeps being reported while
a flag is shown by badging it with a red dot.

macOS is excluded: system_tray loads macOS icons through the asset
bundle, so it cannot display an icon generated at runtime.
The Inno script pointed at C:\Workspace\Flutter\ir_net for the license
file and the build output, so ISCC failed on every machine but the one
it was written on. Inno resolves relative paths against the directory
holding the .iss, so the repo layout is enough.
The flag of the detected IP country replaces the globe marker on the
"Connected from" card (both layouts) and in the header chip, so the
location is recognisable at a glance.

CountryFlagTile falls back to the globe whenever the country is still
unknown or has no flag of its own, which also covers the first seconds
after launch while the IP lookup is running.
Keeps the tray icon recognisable as this app once it shows a flag. The
shield is drawn as a path (same silhouette as the launcher icon) in the
bottom left, diagonally opposite the leak badge, with a dark rim so it
survives on light flags.

It reads as a shield on the 32px and 48px frames; at 16px it is only a
small brand coloured mark, which is as much as that canvas allows next
to a flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant