From 516b3b9aa3888881f6d9332bd3655ee2777f34f5 Mon Sep 17 00:00:00 2001 From: Marcos Date: Sun, 17 May 2026 16:02:39 +0200 Subject: [PATCH] feat: add application icon support and include icon asset in pubspec.yaml --- linux/runner/my_application.cc | 13 +++++++++++++ pubspec.yaml | 3 +++ 2 files changed, 16 insertions(+) diff --git a/linux/runner/my_application.cc b/linux/runner/my_application.cc index 1185808..cdb4f76 100644 --- a/linux/runner/my_application.cc +++ b/linux/runner/my_application.cc @@ -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). diff --git a/pubspec.yaml b/pubspec.yaml index 5ff9446..4ed744c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,6 +70,9 @@ flutter: # the material Icons class. uses-material-design: true +assets: + - assets/icon.png + hooks: user_defines: sqlite3: