Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 12-30-2014, 05:51 AM   #1
wa4557
Junior Member
wa4557 began at the beginning.
 
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?
wa4557 is offline   Reply With Quote
Old 12-30-2014, 08:07 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 02-08-2015, 07:50 AM   #3
wa4557
Junior Member
wa4557 began at the beginning.
 
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?
wa4557 is offline   Reply With Quote
Old 02-08-2015, 08:41 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 02-09-2015, 06:18 AM   #5
wa4557
Junior Member
wa4557 began at the beginning.
 
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...
wa4557 is offline   Reply With Quote
Advert
Old 02-09-2015, 10:04 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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).
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 02:06 AM.


MobileRead.com is a privately owned, operated and funded community.