feat: add application icon support and include icon asset in pubspec.yaml

This commit is contained in:
2026-05-17 16:02:39 +02:00
parent 61c1ab8de7
commit 516b3b9aa3
2 changed files with 16 additions and 0 deletions
+13
View File
@@ -25,6 +25,19 @@ static void my_application_activate(GApplication* application) {
GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
// --- BLOQUE PARA EL ICONO ---
GError* error = nullptr;
gchar* exe_path = g_file_read_link("/proc/self/exe", &error);
if (exe_path != nullptr) {
gchar* exe_dir = g_path_get_dirname(exe_path);
gchar* icon_path = g_build_filename(exe_dir, "data", "flutter_assets", "assets", "icon.png", nullptr);
gtk_window_set_icon_from_file(window, icon_path, nullptr);
g_free(icon_path);
g_free(exe_dir);
g_free(exe_path);
}
// ----------------------------------------
// Use a header bar when running in GNOME as this is the common style used
// by applications and is the setup most users will be using (e.g. Ubuntu
// desktop).