diff --git a/deb/usr/share/applications/imajviewer.desktop b/deb/usr/share/applications/imajviewer.desktop index 9e94813..8a67120 100644 --- a/deb/usr/share/applications/imajviewer.desktop +++ b/deb/usr/share/applications/imajviewer.desktop @@ -8,4 +8,4 @@ Terminal=false Categories=Graphics;Viewer;RasterGraphics; MimeType=image/png;image/jpeg;image/webp;image/bmp;image/gif;image/jpg;image/vnd.wap.wbmp; StartupNotify=false -StartupWMClass=com.example.imajviewer +StartupWMClass=Com.example.imajviewer diff --git a/deb/usr/share/icons/hicolor/index.theme b/deb/usr/share/icons/hicolor/index.theme new file mode 100644 index 0000000..9740d0e --- /dev/null +++ b/deb/usr/share/icons/hicolor/index.theme @@ -0,0 +1,9 @@ +[Icon Theme] +Name=Hicolor +Comment=Fallback icon theme +Directories=64x64/apps + +[64x64/apps] +Size=64 +Context=Applications +Type=Fixed diff --git a/dist/imajviewer_1.0.0_amd64.deb b/dist/imajviewer_1.0.0_amd64.deb index 1360c02..c78b130 100644 Binary files a/dist/imajviewer_1.0.0_amd64.deb and b/dist/imajviewer_1.0.0_amd64.deb differ diff --git a/dist/rebuild-deb.sh b/dist/rebuild-deb.sh index 2e4fa11..c0f5b15 100644 --- a/dist/rebuild-deb.sh +++ b/dist/rebuild-deb.sh @@ -27,6 +27,10 @@ echo "• .desktop dosyası kaynaktan kopyalanıyor…" DESKTOP_FILE="$TMPDIR/pkg/usr/share/applications/${APP}.desktop" cp "${PROJECT_DIR}/deb/usr/share/applications/${APP}.desktop" "$DESKTOP_FILE" +echo "• İkonlar ve hicolor tema indeksi kopyalanıyor…" +mkdir -p "$TMPDIR/pkg/usr/share/icons/hicolor" +cp -r "${PROJECT_DIR}/deb/usr/share/icons/hicolor/." "$TMPDIR/pkg/usr/share/icons/hicolor/" + echo "• Yeni .deb paketi oluşturuluyor…" fakeroot dpkg-deb --build "$TMPDIR/pkg" "${DEB}.tmp" >/dev/null mv "${DEB}.tmp" "$DEB" diff --git a/install.sh b/install.sh index fe8a949..f541e03 100755 --- a/install.sh +++ b/install.sh @@ -63,6 +63,22 @@ else ok "İkon zaten mevcut" fi +# ── Hicolor tema indeksi (GTK ikon temasını tanısın) ── +if [ ! -f "${HOME}/.local/share/icons/hicolor/index.theme" ]; then + mkdir -p "${HOME}/.local/share/icons/hicolor/64x64/apps" + cat > "${HOME}/.local/share/icons/hicolor/index.theme" << 'EOF' +[Icon Theme] +Name=Hicolor +Comment=Fallback icon theme +Directories=64x64/apps + +[64x64/apps] +Size=64 +Context=Applications +Type=Fixed +EOF +fi + # ── .desktop dosyası ── info ".desktop dosyası oluşturuluyor…" cat > "$DESKTOP_FILE" << EOF @@ -76,7 +92,7 @@ Terminal=false Categories=Graphics;Viewer;RasterGraphics; MimeType=image/png;image/jpeg;image/webp;image/bmp;image/gif;image/jpg;image/vnd.wap.wbmp; StartupNotify=false -StartupWMClass=com.example.imajviewer +StartupWMClass=Com.example.imajviewer EOF ok "${DESKTOP_FILE}" diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index ed63d18..704f574 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -121,6 +121,12 @@ install(CODE " install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) +# Bundle the application icon so the runner can set the window icon at runtime. +install(FILES "${PROJECT_SOURCE_DIR}/../imajviewericon.png" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + RENAME "imajviewer.png" + COMPONENT Runtime) + # Install the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" diff --git a/linux/runner/my_application.cc b/linux/runner/my_application.cc index d7bd4e2..ee9b52b 100644 --- a/linux/runner/my_application.cc +++ b/linux/runner/my_application.cc @@ -156,6 +156,20 @@ MyApplication* my_application_new() { // the application to be recognized beyond its binary name. g_set_prgname(APPLICATION_ID); + // App-level default icon. GTK writes _NET_WM_ICON from this when windows + // are realized, so taskbars show the application icon. + g_autofree gchar* exe_path = g_file_read_link("/proc/self/exe", nullptr); + if (exe_path != nullptr) { + g_autofree gchar* bundle_dir = g_path_get_dirname(exe_path); + g_autofree gchar* icon_path = + g_build_filename(bundle_dir, "data", "imajviewer.png", nullptr); + GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file(icon_path, nullptr); + if (pixbuf != nullptr) { + gtk_window_set_default_icon(pixbuf); + g_object_unref(pixbuf); + } + } + return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, "flags", G_APPLICATION_NON_UNIQUE, nullptr)); diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico index 48be4f4..5d4bb1a 100644 Binary files a/windows/runner/resources/app_icon.ico and b/windows/runner/resources/app_icon.ico differ