|
|
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » FileSel is now using icons from windows....
|
Re: FileSel is now using icons from windows.... [message #11111 is a reply to message #10903] |
Mon, 20 August 2007 16:53 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
I've got an idea of how to do this, but I haven't been able to test it yet. It's considerably more complicated than on Windows.
It should go something like this:
First check the standard icons paths/names as defined by the Tango project (I have seen these on their website, but it currently seems to be down ). This seems to be the standard adopted by KDE (it's where my icons are anyway), but I'm unsure about GNOME.
If the icon is not found fallback to Gtk icons by using GtkImage("gtk-home") etc. as defined here. This should be correct for Gnome, but appears to be less complete than the Windows selection or the Tango project.
This is not very pleasant, but seems to be the only Desktop agnostic way.
Edit: Actually it seems I'm mistaken about the KDE icons. Now I can't find them anywhere...
[Updated on: Mon, 20 August 2007 17:23] Report message to a moderator
|
|
|
Re: FileSel is now using icons from windows.... [message #11112 is a reply to message #11111] |
Mon, 20 August 2007 17:53 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Found them KDE doesn't actually follow Tango, though it is close.
Running
gives:
/home/James/.kde/share/icons/
/usr/share/icons/
/opt/kde/share/icons/
So presumably the sequence should be:
1) Try and find the KDE icons (is it possible to determine whether GNOME or KDE is running?). This is further complicated by needing to determine which theme is running.
2) Optional: Try and find Tango icons
3) Use GetGtkImage.
It may be more trouble than it's worth to match icons on KDE. Anyone who really cares can set the GTK theme to match KDE, so perhaps you could just use the Gtk icons?
[Updated on: Mon, 20 August 2007 17:55] Report message to a moderator
|
|
|
|
|
Re: FileSel is now using icons from windows.... [message #11127 is a reply to message #11118] |
Tue, 21 August 2007 10:34 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Sorry, I thought you knew because it's used in Chameleon:
enum GtkIconSize {
ICON_SIZE_INVALID,
ICON_SIZE_MENU,
ICON_SIZE_SMALL_TOOLBAR,
ICON_SIZE_LARGE_TOOLBAR,
ICON_SIZE_DND,
ICON_SIZE_DIALOG
};
Image file_icon = GtkImage("gtk-file", ICON_SIZE_SMALL_TOOLBAR, 22);
You may have to fiddle with the sizes, and AFAIK GtkImage isn't currently exposed in Draw/Ch.h.
And to get the GTK theme to match QT/KDE you want this
James
[Updated on: Tue, 21 August 2007 10:40] Report message to a moderator
|
|
|
|
Re: FileSel is now using icons from windows.... [message #11129 is a reply to message #11127] |
Tue, 21 August 2007 13:19 |
|
mirek
Messages: 14039 Registered: November 2005
|
Ultimate Member |
|
|
mrjt wrote on Tue, 21 August 2007 04:34 | Sorry, I thought you knew because it's used in Chameleon:
enum GtkIconSize {
ICON_SIZE_INVALID,
ICON_SIZE_MENU,
ICON_SIZE_SMALL_TOOLBAR,
ICON_SIZE_LARGE_TOOLBAR,
ICON_SIZE_DND,
ICON_SIZE_DIALOG
};
Image file_icon = GtkImage("gtk-file", ICON_SIZE_SMALL_TOOLBAR, 22);
You may have to fiddle with the sizes, and AFAIK GtkImage isn't currently exposed in Draw/Ch.h.
And to get the GTK theme to match QT/KDE you want this
James
|
Ah, sorry, I perhaps was not clear enough.
What works in Windows is that files are displayed with icons dedicated to their types. Means, .txt files have different icon than .xls and from .exe the icon is extracted.
This is what I would like to know how to implement in Ggnome...
Mirek
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 03:06:26 CEST 2024
Total time taken to generate the page: 0.02571 seconds
|
|
|