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: