Applications set their icon at launch, to a compiled-in value. Most do it using the API of their graphics toolkit (Gtk provides various forms of the gtk_window_set_icon
API call), but it has its roots in an X Windows window-manager property that's as old as dirt — which is why, for example, okular
still has an application icon in Gnome Shell even though it's a KDE application.
You can see a grayscale representation of the icon(s) an application is exporting if you type xprop
in a terminal, then click the application's window. (You need to have the correct utilities package installed, it's called xorg-x11-utils
in Fedora.)
The application icon doesn't depend on Gnome or on the .desktop
file under any circumstances.
(In fact, you could create your own $HOME/.local/share/applications/okular.desktop
file that represented the application with a different icon, and launch it by clicking that icon, but it would be ignored in favor of the one that's compiled in to the application once it started. I have some custom launchers in my Favorites panel for different VNC sessions, using a different icon for each, but they all show up as TigerVNC with the standard icon when launched.)
AFAIK the only way to do what you want would be to compile your own separate version of okular
with the icon changed to something else. That's just not the way application icons were meant to be used, sorry.