feat: wire the logo in as app icon and splash

This commit is contained in:
randogoth 2026-10-11 22:58:02 +03:00
parent dcb70a93d1
commit 8426818712
14 changed files with 129 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<!-- The launch splash: the logo centered on the window background, which
follows the system's light and dark setting. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
android:src="@drawable/splash_logo" />
</item>
</layer-list>

View file

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<!-- The launch splash: the logo centered on the window background. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
android:src="@drawable/splash_logo" />
</item>
</layer-list>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 2.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

BIN
app/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View file

@ -24,9 +24,9 @@
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="0.54252946"
inkscape:cx="292.15003"
inkscape:cx="291.22842"
inkscape:cy="292.15003"
inkscape:window-width="1563"
inkscape:window-width="1536"
inkscape:window-height="891"
inkscape:window-x="0"
inkscape:window-y="0"
@ -40,18 +40,27 @@
id="layer1"
transform="translate(-27.689651,-71.189651)">
<rect
style="fill:#18191b;stroke:#5a8f66;stroke-width:1;stroke-linecap:round"
style="fill:#18191b"
id="rect1"
width="153.6207"
height="153.6207"
x="28.189651"
y="71.689651"
inkscape:label="background" />
<path
style="font-size:40.9665px;font-family:'Atkinson Hyperlegible';-inkscape-font-specification:'Atkinson Hyperlegible';text-align:center;letter-spacing:0px;text-anchor:middle;fill:#e3e1dc;stroke-linecap:round"
d="m 55.482232,161.41132 v -20.31939 h 2.539923 l 0.901263,3.07249 q 0.860296,-1.43383 2.33509,-2.41702 1.515761,-0.9832 3.768918,-0.9832 2.335091,0 3.768918,0.94223 1.433828,0.94223 2.089292,2.62186 1.228995,-1.88446 2.949588,-2.70379 1.761559,-0.8603 3.891817,-0.8603 3.523119,0 5.038879,2.17122 1.515761,2.13026 1.515761,5.61242 v 12.86348 H 80.840495 V 149.572 q 0,-1.55673 -0.327732,-2.86766 -0.286766,-1.35189 -1.228995,-2.17122 -0.901263,-0.81933 -2.785722,-0.81933 -2.212191,0 -3.564085,1.72059 -1.310928,1.67963 -1.310928,4.95695 v 11.01999 H 68.181847 V 149.572 q 0,-1.55673 -0.327732,-2.86766 -0.286766,-1.35189 -1.228995,-2.17122 -0.901263,-0.81933 -2.785722,-0.81933 -2.212191,0 -3.564086,1.72059 -1.351894,1.67963 -1.351894,4.95695 v 11.01999 z m 42.646121,0.49159 q -3.195387,0 -5.407578,-1.39286 -2.212191,-1.43382 -3.400219,-3.80988 -1.147062,-2.41702 -1.147062,-5.40758 0,-3.23635 1.310928,-5.57144 1.310927,-2.37606 3.523118,-3.64602 2.253158,-1.31093 5.03888,-1.31093 2.41702,0 4.26052,0.9832 1.84349,0.94223 3.03152,2.58089 1.22899,1.59769 1.76156,3.64601 0.57353,2.04833 0.40966,4.21955 H 91.860478 q 0.08193,2.53993 1.106096,4.01472 1.065129,1.47479 2.498956,2.08929 1.433828,0.57353 2.662823,0.57353 1.720593,0 2.867657,-0.53256 1.18803,-0.57353 1.88446,-1.4748 l 3.31828,0.9832 q -1.10609,1.76156 -3.15442,2.90862 -2.04832,1.14706 -4.915977,1.14706 z M 91.901445,149.4491 h 11.962215 q 0,-1.43383 -0.73739,-2.74476 -0.69643,-1.31093 -2.00736,-2.13026 -1.269964,-0.86029 -3.07249,-0.86029 -1.515761,0 -2.867655,0.57353 -1.351895,0.57353 -2.253158,1.84349 -0.860296,1.26996 -1.024162,3.31829 z m 22.654455,11.96222 -5.85821,-20.31939 h 3.68699 l 3.89181,15.03471 4.05569,-15.03471 h 3.56408 l 4.01472,15.03471 3.89182,-15.03471 h 3.68698 l -5.81724,20.31939 h -3.15442 l -4.42438,-16.34564 -4.42439,16.34564 z m 30.72485,0.49159 q -1.76156,0 -3.48216,-0.53256 -1.67962,-0.57353 -3.03152,-1.67963 -1.31093,-1.14706 -2.00736,-2.86765 l 3.31829,-1.229 q 0.45063,1.80253 1.96639,2.62186 1.55673,0.77836 3.23636,0.77836 1.22899,0 2.29412,-0.3687 1.1061,-0.36869 1.80253,-1.06513 0.69643,-0.69643 0.69643,-1.59769 0,-1.67962 -1.3519,-2.37606 -1.31093,-0.69643 -3.15442,-1.06512 l -2.82669,-0.57354 q -1.47479,-0.32773 -2.74475,-0.90126 -1.26996,-0.6145 -2.04833,-1.72059 -0.77836,-1.1061 -0.77836,-2.94959 0,-1.84349 1.14706,-3.07249 1.14706,-1.26996 2.90862,-1.92542 1.80253,-0.65547 3.76892,-0.65547 2.41702,0 4.54728,1.02417 2.17123,0.98319 3.07249,3.11345 l -3.23635,1.18803 q -0.53257,-1.229 -1.88446,-1.80253 -1.31093,-0.61449 -2.74476,-0.61449 -1.55673,0 -2.82669,0.69643 -1.26996,0.69643 -1.26996,2.00735 0,1.31093 1.06513,1.92543 1.1061,0.57353 2.70379,0.90126 l 2.66282,0.53257 q 1.63866,0.32773 3.11346,0.94223 1.47479,0.61449 2.41702,1.84349 0.94223,1.18803 0.94223,3.35925 0,1.92543 -1.18803,3.27732 -1.18803,1.3519 -3.07249,2.08929 -1.88446,0.69643 -4.01471,0.69643 z"
id="text1"
aria-label="mews"
inkscape:label="text" />
<g
id="g3"
transform="translate(0,-1.8520955)">
<path
style="font-size:40.9665px;font-family:'Atkinson Hyperlegible';-inkscape-font-specification:'Atkinson Hyperlegible';text-align:center;letter-spacing:0px;text-anchor:middle;fill:#e3e1dc;stroke-linecap:round"
d="m 55.963126,175.96176 v -20.31939 h 2.539923 l 0.901263,3.07249 q 0.860296,-1.43383 2.33509,-2.41702 1.515761,-0.9832 3.768918,-0.9832 2.335091,0 3.768918,0.94223 1.433828,0.94223 2.089292,2.62186 1.228995,-1.88446 2.949588,-2.70379 1.761559,-0.8603 3.891817,-0.8603 3.523119,0 5.038879,2.17122 1.515761,2.13026 1.515761,5.61242 v 12.86348 h -3.441186 v -11.83932 q 0,-1.55673 -0.327732,-2.86766 -0.286766,-1.35189 -1.228995,-2.17122 -0.901263,-0.81933 -2.785722,-0.81933 -2.212191,0 -3.564085,1.72059 -1.310928,1.67963 -1.310928,4.95695 v 11.01999 h -3.441186 v -11.83932 q 0,-1.55673 -0.327732,-2.86766 -0.286766,-1.35189 -1.228995,-2.17122 -0.901263,-0.81933 -2.785722,-0.81933 -2.212191,0 -3.564086,1.72059 -1.351894,1.67963 -1.351894,4.95695 v 11.01999 z m 42.646121,0.49159 q -3.195387,0 -5.407578,-1.39286 -2.212191,-1.43382 -3.400219,-3.80988 -1.147062,-2.41702 -1.147062,-5.40758 0,-3.23635 1.310928,-5.57144 1.310927,-2.37606 3.523118,-3.64602 2.253158,-1.31093 5.03888,-1.31093 2.417016,0 4.260516,0.9832 1.84349,0.94223 3.03152,2.58089 1.22899,1.59769 1.76156,3.64601 0.57353,2.04833 0.40966,4.21955 H 92.341372 q 0.08193,2.53993 1.106096,4.01472 1.065129,1.47479 2.498956,2.08929 1.433828,0.57353 2.662823,0.57353 1.720593,0 2.867653,-0.53256 1.18803,-0.57353 1.88446,-1.4748 l 3.31828,0.9832 q -1.10609,1.76156 -3.15442,2.90862 -2.04832,1.14706 -4.915973,1.14706 z m -6.226908,-12.45381 h 11.962211 q 0,-1.43383 -0.73739,-2.74476 -0.69643,-1.31093 -2.00736,-2.13026 -1.26996,-0.86029 -3.072486,-0.86029 -1.515761,0 -2.867655,0.57353 -1.351895,0.57353 -2.253158,1.84349 -0.860296,1.26996 -1.024162,3.31829 z m 22.654451,11.96222 -5.85821,-20.31939 h 3.68699 l 3.89181,15.03471 4.05569,-15.03471 h 3.56408 l 4.01472,15.03471 3.89182,-15.03471 h 3.68698 l -5.81724,20.31939 h -3.15442 l -4.42438,-16.34564 -4.42439,16.34564 z m 30.72485,0.49159 q -1.76156,0 -3.48216,-0.53256 -1.67962,-0.57353 -3.03152,-1.67963 -1.31093,-1.14706 -2.00736,-2.86765 l 3.31829,-1.229 q 0.45063,1.80253 1.96639,2.62186 1.55673,0.77836 3.23636,0.77836 1.22899,0 2.29412,-0.3687 1.1061,-0.36869 1.80253,-1.06513 0.69643,-0.69643 0.69643,-1.59769 0,-1.67962 -1.3519,-2.37606 -1.31093,-0.69643 -3.15442,-1.06512 l -2.82669,-0.57354 q -1.47479,-0.32773 -2.74475,-0.90126 -1.26996,-0.6145 -2.04833,-1.72059 -0.77836,-1.1061 -0.77836,-2.94959 0,-1.84349 1.14706,-3.07249 1.14706,-1.26996 2.90862,-1.92542 1.80253,-0.65547 3.76892,-0.65547 2.41702,0 4.54728,1.02417 2.17123,0.98319 3.07249,3.11345 l -3.23635,1.18803 q -0.53257,-1.229 -1.88446,-1.80253 -1.31093,-0.61449 -2.74476,-0.61449 -1.55673,0 -2.82669,0.69643 -1.26996,0.69643 -1.26996,2.00735 0,1.31093 1.06513,1.92543 1.1061,0.57353 2.70379,0.90126 l 2.66282,0.53257 q 1.63866,0.32773 3.11346,0.94223 1.47479,0.61449 2.41702,1.84349 0.94223,1.18803 0.94223,3.35925 0,1.92543 -1.18803,3.27732 -1.18803,1.3519 -3.07249,2.08929 -1.88446,0.69643 -4.01471,0.69643 z"
id="text1"
aria-label="mews"
inkscape:label="text" />
<path
d="m 86.065063,151.61647 q -1.925425,0 -2.990554,-0.3687 -1.024163,-0.40967 -1.433828,-1.51576 -0.368698,-1.1061 -0.368698,-3.19539 v -12.49478 h -3.441186 v -2.74476 h 3.441186 v -5.12081 h 3.441186 v 5.12081 h 3.932784 v 2.74476 h -3.932784 v 11.92125 q 0,1.55673 0.286765,2.08929 0.327732,0.53257 1.802526,0.53257 h 1.843493 v 3.03152 z m 7.087181,0 v -27.36563 h 3.441186 v 10.11873 q 0.860296,-1.43383 2.417023,-2.41703 1.556727,-0.98319 4.137607,-0.98319 3.68699,0 5.20275,2.17122 1.51576,2.13026 1.51576,5.61242 v 12.86348 h -3.44119 v -11.83932 q 0,-1.55673 -0.28676,-2.86766 -0.28677,-1.35189 -1.26996,-2.17122 -0.94223,-0.81933 -2.90863,-0.81933 -2.498945,0 -3.932773,1.72059 -1.433827,1.67963 -1.433827,4.95695 v 11.01999 z m 30.560996,0.49159 q -3.19539,0 -5.40758,-1.39286 -2.21219,-1.43382 -3.40022,-3.80988 -1.14706,-2.41702 -1.14706,-5.40758 0,-3.23635 1.31093,-5.57144 1.31093,-2.37606 3.52312,-3.64602 2.25315,-1.31093 5.03888,-1.31093 2.41702,0 4.26051,0.98319 1.84349,0.94223 3.03152,2.58089 1.229,1.5977 1.76156,3.64603 0.57353,2.04832 0.40967,4.21954 h -15.6492 q 0.0819,2.53993 1.10609,4.01472 1.06513,1.4748 2.49896,2.08929 1.43382,0.57353 2.66282,0.57353 1.72059,0 2.86765,-0.53256 1.18803,-0.57353 1.88446,-1.47479 l 3.31829,0.98319 q -1.1061,1.76156 -3.15442,2.90862 -2.04833,1.14706 -4.91598,1.14706 z m -6.22691,-12.45381 h 11.96222 q 0,-1.43383 -0.7374,-2.74476 -0.69643,-1.31092 -2.00736,-2.13026 -1.26996,-0.86029 -3.07248,-0.86029 -1.51576,0 -2.86766,0.57353 -1.35189,0.57353 -2.25316,1.84349 -0.86029,1.26996 -1.02416,3.31829 z"
id="text2"
style="font-size:40.9665px;font-family:'Atkinson Hyperlegible';-inkscape-font-specification:'Atkinson Hyperlegible';letter-spacing:0px;fill:#e3e1dc;stroke-linecap:round"
aria-label="the" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Before After
Before After

View file

@ -54,6 +54,16 @@ static void my_application_activate(GApplication* application) {
gtk_window_set_default_size(window, 1280, 720);
// The window wears the bundled logo, which lives beside the binary with
// the Flutter assets, where the engine also finds it.
g_autofree gchar* exe_path = g_file_read_link("/proc/self/exe", NULL);
if (exe_path != NULL) {
g_autofree gchar* exe_dir = g_path_get_dirname(exe_path);
g_autofree gchar* icon_path = g_build_filename(
exe_dir, "data", "flutter_assets", "assets", "logo.png", NULL);
gtk_window_set_icon_from_file(window, icon_path, NULL);
}
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(
project, self->dart_entrypoint_arguments);

View file

@ -331,6 +331,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_svg:
dependency: "direct dev"
description:
name: flutter_svg
sha256: "35882981abcbfb8c15b286f0cd690ff25bac12d95eff3e25ee207f37d4c42e7f"
url: "https://pub.dev"
source: hosted
version: "2.3.0"
flutter_test:
dependency: "direct dev"
description: flutter
@ -541,6 +549,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.1"
path_parsing:
dependency: transitive
description:
name: path_parsing
sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
path_provider:
dependency: "direct main"
description:
@ -874,6 +890,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.6"
vector_graphics:
dependency: transitive
description:
name: vector_graphics
sha256: "9d0e3b9cb16542ad660daee871e726a10d13a93b7b5391677c3160e8f5e83935"
url: "https://pub.dev"
source: hosted
version: "1.2.3"
vector_graphics_codec:
dependency: transitive
description:
name: vector_graphics_codec
sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146"
url: "https://pub.dev"
source: hosted
version: "1.1.13"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: "4dca4feb77dc3ec7f6e27e49c53241eb8217f55e4f9b12599a27f8903bca5682"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
vector_math:
dependency: transitive
description:

View file

@ -33,11 +33,13 @@ dev_dependencies:
flutter_lints: ^6.0.0
drift_dev: ^2.34.0
build_runner: ^2.14.1
flutter_svg: ^2.3.0
flutter:
uses-material-design: true
assets:
- assets/logo.png
- locales/en-US/main.ftl
- locales/de/main.ftl
- locales/es/main.ftl

View file

@ -0,0 +1,50 @@
import 'dart:io';
import 'dart:ui' as ui show ImageByteFormat, PictureRecorder;
import 'package:flutter/widgets.dart' show Canvas;
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_test/flutter_test.dart';
/// Rasterizes `assets/logo.svg` into the PNGs the platforms want: the
/// Android launcher icons at every density, the splash logo, and the
/// bundled logo the Linux window icon loads. Run with:
///
/// flutter test tool/generate_icons.dart
///
/// The committed PNGs are the product; this exists so a new logo can be
/// dropped in as the SVG and every platform follows in one run.
const sizes = {
'android/app/src/main/res/mipmap-mdpi/ic_launcher.png': 48,
'android/app/src/main/res/mipmap-hdpi/ic_launcher.png': 72,
'android/app/src/main/res/mipmap-xhdpi/ic_launcher.png': 96,
'android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png': 144,
'android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png': 192,
'android/app/src/main/res/drawable-nodpi/splash_logo.png': 432,
'assets/logo.png': 256,
};
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
test('rasterizes the logo for every platform', () async {
final svg = File('assets/logo.svg').readAsStringSync();
final info = await vg.loadPicture(SvgStringLoader(svg), null);
for (final entry in sizes.entries) {
final size = entry.value;
final recorder = ui.PictureRecorder();
final canvas = Canvas(recorder);
// The logo is square, so one scale fits both axes.
canvas.scale(size / info.size.width, size / info.size.height);
canvas.drawPicture(info.picture);
final image = await recorder.endRecording().toImage(size, size);
final bytes = await image.toByteData(format: ui.ImageByteFormat.png);
final file = File(entry.key);
await file.parent.create(recursive: true);
await file.writeAsBytes(bytes!.buffer.asUint8List());
// ignore: avoid_print
print('wrote ${file.path} (${size}x$size)');
}
});
}