Correctly show application icon in Gtk - gtk

I have created an icon file and placed it in /usr/share/icons/hicolor/apps/scalable but how do I set it as the icon for my application? I have tried set_default_icon_name and set_icon_name but nether had any effect.

Have you run gtk-update-icon-cache after installing the icon? Here's a tutorial on installing icons and desktop files which you may find useful.

Related

VSCode Extension Icons?

Just installed VSCode and went to install some extensions and noticed that no icons were showing up associated with the extensions. Yes I know thats of no real consequence but it just really stood out compared to the screen shots on the vscode page.
This is what is shown as a screen shot on the vscode page:
This is what I see in vscode:
I found the fix was as simple as dragging the window splitter and making it larger. Icons will then appear. The view was simply too compact for the icons apparently.

How to get native windows decorations on GTK3 on Windows 7+ and MSYS2

I am trying to port my application from linux to windows and I have a problem with theming. In linux this works out of a box, just compile it and application is using good theme and looks native.
I have installed gtkmm3 and gtk3 in MSYS2 and I am building it with CMake. This is OK, I had to copy all dlls to directory with binary to be able to execute it. I did not copy anything else. I am trying to create "unzip and execute" package.
My problem is, that application looks out of place. It does not look native at all. There are shadows around the window, which is fine in Windows10, but in Windows 7 it looks not native. Also several icons are missing.
Even gitk3-demo looks non-native in the same way (but it has at least the minimize/maximize/close icons correct).
So the question is: How can I achieve native look of GTK3 application on Windows? Or at least native window decorations?
Thanks
Thera are two sub-problems: missing icons and setting right theme.
Missing icons
For missing icons it was enough to copy these icons
window-close-symbolic.symbolic.png
window-maximize-symbolic.symbolic.png
window-minimize-symbolic.symbolic.png
from: C:\msys64\mingw32\share\icons\Adwaita\22x22\actions
to: "your executable folder"\share\icons\Adwaita\22x22\actions
Theme
Using win32 native theme
There is actually a built-in native-like theme in GTK3. For using native-like theme just create file "your executable folder"\etc\gtk-3.0\settings.ini with this in it
[Settings]
gtk-theme-name=win32
win32 theme is built in into GTK3 and only three icons from previous step seems to be needed.
On windows 7 this looks as following:
The problem is, that the decorations looks the same even on Windows 10 (including window decorations).
From comment from #andlabs : GTK+ 3 uses the uxtheme.dll APIs to get its Windows look and feel, and unfortunately Microsoft has kept those Windows 7-like for window borders. (more in comments)
You can see Windows 10 Gtk3 application with win32 theme here:
Using non default theme
And if you are not happy with default or win32 theme, you can use custom themes (like this Flat-Pat) from the internet. :) In order to do it you need to create config file:
"your executable folder"\etc\gtk-3.0\settings.ini with this in it
[Settings]
gtk-theme-name=Flat-Plat
and you need to copy the theme files to directory in path of your executable
"your executable folder"\share\themes\Flat-Plat
in that folder, the index.theme file and gtk-x.x folders should be present. Obviously gtk-theme-name and folder name should match.
After you run the executable you should be able to get different theme.
EDIT: So there is a win32 theme built-in, thank you #andlabs
EDIT2: Added screenshots
EDIT3: Added Windows 10 screenshot and corrected facts.
You can set GTK_CSD=0 environment variable to disable client-side window decorations and enable Windows native decorations, which gets rid of the ugly win7-like titlebar, as well as Adwaita-like one.
Actually, Gtk+3 been compatible with Windows 10 and you can use the native windows theme by making this your default theme.
gtk-theme-name = MS-Windows
For people like me who use (activestate) perl, the /share and /etc need to be placed one directory above the perl.exe (say in C:\Perl64 if perl.exe is in C:\Perl64\bin).
While GTK_CSD=0 is doing a fine job for windows frame icons, it seams that default Drag-And-Drop (DND) icons are missing too.
Dragging GtkEntry or GtkTreeView contents shows a drag-icon.
I've prepared a button as drag source under Gtk+-3.24.4. When dragging the button, the mouse cursor disappears and no drag icon is shown.
When using gtk_drag_source_set_icon_pixbuf(bt, pixbuf), the pixbuf appears as drag icon. But doing it this way is only half the job done, because move/copy indicators are missing on the icon.

How can i change the app icon while building in Rhomobile

I followed the docs for creating the ios application using Rhomobile.
I have all the icon images placed inside icon folder.
But after opening the application in xcode, it shows the rhomobile default icon.
How and where can i change the icon ?
click on your project name go to TARGETS>>summary>>App icon.
Now drag your icon.
When you runs the command to create the xcode project, in your rhodes folder, one icon.png image is generated. You need to replace that image with yours.
Path : <rhodes_path>/platform/iphone/icon.png
Then you can open the xcode and start building the app.

Is there a way to change the default eclipse toolbar icons built into eclipse?

I am talking about the tiny icons on the toolbar.
There doesn't seem to be any questions like this on the web, they all refer to android or a custom application as opposed to the icons bundled with eclipse.
I want to know if anyone has tried this or can tell me that its not worth my time because it is a lot of work.
Cheers.
I don't think this is possible. The standard icons are declared using the org.eclipse.ui.commandImages extension point in the org.eclipse.ui plugin and reference icons in that plugin.
Try Darkest Dark Theme. Also its dev style preview (for more themes). It can change icons as well as have an icon designer integrated in it.

Shortcut icon inside a cab file

How do I place the shortcut icon in the cab file? Can anyone shed some light on this? I searched online and found no info about this at all, except a claim that the icon used in the smart device project is automatically pulled into a cab. Well, it isn't so. It got pulled in once and after that when i CHANGED the icon it still shows an old one.
Any clues?
The shortcut icon is the icon from the application itself, so you don't "add" one. Bear in mind that WinMo/Pocket PC caches that icon for the Start menu, so if your app had a different icon to begin with, then you'll probably have to soft-reset the device to get the start menu to pick up the new icon.