12-30-2014, 05:51 AM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2014
Device: Kindle Keyboard
|
Icons from system theme
I really like calibre, it is certainly one of the best pieces of software I have on my computer. Nevertheless it somehow looks alien on my computer because it uses its own icon theme.
I know it is possible to change the icon theme (by putting icons in .config/calibre/resources/images in Linux), but in order for theme designers (Numix, Moka, Nitrux etc...) to create custom icons for calibre, wouldn't it be a good idea to look for system-themed icons before looking for icons in .config/calibre/resources/images/ and /opt/calibre/resources/images/? (Probably only in Linux; I don't know if something similar exists in OSX or Windows) I suppose a hasThemeIcon in resources.py should do the trick, shouldn't it? |
12-30-2014, 08:07 AM | #2 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm not in favor of loading system icons. The chance that the system theme icons cover all the icons needed in calibre is zero. Which means that the icons you will see will be an unpredictable mishmash of some system icons and some calibre icons.
That said, I have no objection to adding say an environment variable to get calibre to preferentially load system theme icons. But I am not going to do the work for it. |
Advert | |
|
02-08-2015, 07:50 AM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2014
Device: Kindle Keyboard
|
Ok, I'm working on this right now, and it works really great without changing a lot of code.
However I could use a little bit of help getting the current icon theme name. I think the used Qt5 libraries don't work as expected. Why does: app = QApplication([]) QIcon.themeName() always return an empty string? Is there a workaround for this? |
02-08-2015, 08:41 AM | #4 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Not that I know of. The system theme is dependent on the desktop environment used. Every desktop environment has different ways of specifying the current icon theme. I assume Qt uses some heuristics to try to detect the system theme. I have no idea how and where those work.
IIRC KDE 4 sets a symlink called default.kde4 in /usr/share/icons Dunno what all the other desktop environments do. |
02-09-2015, 06:18 AM | #5 |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2014
Device: Kindle Keyboard
|
That's a pitty... It's just weird that the PyQt5 libraries used by the system return the correct theme name. I will look into that further...
|
Advert | |
|
02-09-2015, 10:04 AM | #6 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That's most likely because whatever desktop environment you are using has its own Qt 5 platform theme plugin, which the bundled Qt 5 in calibre knows nothing about (and could not load in any case since it's likely that the versions of glibc/libstdc++ they are compiled against are incompatible).
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Theme problem | meho_r | Calibre | 12 | 12-22-2013 10:09 PM |
Board Theme | Xanthe | Feedback | 5 | 11-12-2013 08:47 PM |
theme source for modern and sdk default theme | gshank | PocketBook Developer's Corner | 6 | 07-18-2011 04:06 PM |
Sony Reader Icons, Other Reader Icons and much more! | TheHeartlessHero | Deals and Resources (No Self-Promotion or Affiliate Links) | 27 | 11-21-2008 06:21 AM |
how to clean more disk space in root file system to upgrade system | chinaet | iRex | 1 | 12-18-2006 03:54 PM |