Gtk+ icon missing when running in MS Windows

后端 未结 2 1699
时光取名叫无心
时光取名叫无心 2021-02-06 08:27

I have a C/GTK+ application developed on Ubuntu, and I want to cross-compile it so that it runs on MS Windows.

I followed this guide to set up the compiler, and the prog

相关标签:
2条回答
  • 2021-02-06 09:06

    As a workaround I have converted the icons from svg to png, then placing them in share/icons. The icons now show up, though there is a minor problem: when the search entry is empty, an additional magnifying glass icon will shop up on the right.

    enter image description here

    The additional magnifying glass will be replaced by the "clear" icon when there is text in the entry, so I do not consider this that much of a problem... (Although admittedly it looks quite weird...)

    As this is only a workaround and not a perfect solution, I will not mark this as accepted answer. I think the problem may be related to how the svg files are displayed, but I have all the DLLs from here so I don't really understand what the problem is.

    0 讨论(0)
  • 2021-02-06 09:20

    This is a late reply but I encountered this issue and I have solved it with the following steps:

    SVG icons of the default theme (adwaita) needs to be copyed to a share directory relative to the bin directory bin../share/icons/Adwaita/scalable/* also bin../share/icons/Adwaita/icon-theme.cache and bin../share/icons/Adwaita/index.theme

    After several test, it appears that the following files are also required:

    lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll
    lib/gdk-pixbuf-2.0/2.10.0/loaders/loaders.cache
    

    The first line of this loaders.cache file also needs to be edited to "../lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll"

    The file tree looks like this:

    bin/gtkapplication.exe
    bin/*.dll
    share/loader.cache
    share/glib-2.0/gschemas.compiled
    share/icons/Adwaita/scalable/*
    share/icons/Adwaita/icon-theme.cache
    share/icons/Adwaita/index.theme
    lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll
    lib/gdk-pixbuf-2.0/2.10.0/loaders/loaders.cache
    

    Most up-to-date repository containing GTK+3 Runtime files for Windows (as of 5-23-2019): https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer

    0 讨论(0)
提交回复
热议问题