|  12-07-2019, 11:17 PM | #31 | 
| Fervent Pleasure Seeker            Posts: 1,224 Karma: 712073 Join Date: Feb 2009 Location: The Windmills of My Mind Device: Clara HD | |
|   |   | 
|  12-08-2019, 08:22 AM | #32 | 
| Grand Sorcerer            Posts: 6,269 Karma: 16544702 Join Date: Sep 2009 Location: UK Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3 | 
			
			@Kovid, Thanks very much for Windows nightmode.  I spent a few hours with it yesterday without too many problems, but I did notice a few things for possible further consideration before initial release. 
 I attach a screencap showing issues 1 and 4. 
 | 
|   |   | 
|  12-08-2019, 11:44 AM | #33 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			@jackie_w: Adapting the icons for dark mode is a long tem project, I suggest switching to one of the other icon themes that works better with dark mode. As for the other issues, they are basically problems with the Qt fusion style, which may or may not be fixable, one will have to experiment. | 
|   |   | 
|  12-08-2019, 12:34 PM | #34 | ||
| Grand Sorcerer            Posts: 6,269 Karma: 16544702 Join Date: Sep 2009 Location: UK Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3 | Quote: 
  Quote: 
 Speaking of custom icons ... I can't remember whether it is possible to customise calibre plugin icons in the config/resources/images directory in the same way you can for main calibre icons. I have a vague memory of kiwidude discussing it many years ago but I don't recall whether it was a special feature unique to his own plugins. Does anyone else remember? | ||
|   |   | 
|  12-08-2019, 12:56 PM | #35 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			Load the icons in your plugins as  I('plugin_name/image.png') and they will automatically come from the configresources directory if present. | 
|   |   | 
|  12-08-2019, 01:34 PM | #36 | 
| Wizard            Posts: 1,292 Karma: 1428263 Join Date: Dec 2016 Location: Goiânia - Brazil Device: iPad, Kindle Paperwhite, Kindle Oasis | 
			
			Hi, @Kovid. About this commit: https://github.com/kovidgoyal/calibr...9e118a40fa7a90 Can I import this from a plugin to detect if Dark Mode is set? Maybe like this: Code: from calibre.gui2 import is_dark_theme EDIT: Oops... already answered below as I was editing it. Last edited by thiago.eec; 12-08-2019 at 01:43 PM. | 
|   |   | 
|  12-08-2019, 01:42 PM | #37 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			In a plugin if you want to check if dark mode is currently active, you use QApplication.instance().is_dark_theme | 
|   |   | 
|  12-08-2019, 03:50 PM | #38 | |
| Grand Sorcerer            Posts: 6,269 Karma: 16544702 Join Date: Sep 2009 Location: UK Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3 | Quote: 
 Note: Non-techies may want to skip this post ... I have a plugin named 'TTS to MP3'. It's located as a .zip in config/plugins/TTS to MP3.zip. Inside the .zip is: 
 In the plugin genesis() I have: Code: self.icons = get_icons(['TTS to MP3/plugin_icon.png',
                        'TTS to MP3/play.png',
                        'TTS to MP3/stop.png'])
self.qaction.setIcon(get_icons('TTS to MP3/plugin_icon.png'))Code: button.setIcon(get_icons('TTS to MP3/play.png'))Code: config/resources/images/TTS to MP3/plugin_icon.png | |
|   |   | 
|  12-08-2019, 09:36 PM | #39 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			Use I() first and check if the path returned exists, if it does use it, otherwise use the image returned by get_icons().
		 | 
|   |   | 
|  12-09-2019, 01:59 PM | #40 | |
| Grand Sorcerer            Posts: 6,269 Karma: 16544702 Join Date: Sep 2009 Location: UK Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3 | Quote: 
  It's taken a while but after some experimentation, I think I now understand this a bit better. I think I have some boilerplate code I can add to my User Interface plugins as necessary. | |
|   |   | 
|  12-09-2019, 06:30 PM | #41 | 
| Grand Sorcerer            Posts: 24,905 Karma: 47303824 Join Date: Jul 2011 Location: Sydney, Australia Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos | 
			
			If you are using a common_utils.py from one of kiwidude's plugins, the "get_icons" method probably uses "I()". Or is a wrapper for "get_icon" which does.
		 | 
|   |   | 
|  12-09-2019, 07:04 PM | #42 | 
| Wizard            Posts: 1,292 Karma: 1428263 Join Date: Dec 2016 Location: Goiânia - Brazil Device: iPad, Kindle Paperwhite, Kindle Oasis | 
			
			Hi, @Kovid. About the change to make menu separators more visible (this commit). I saw no difference here. It's just like before. Menu separators are not visible. | 
|   |   | 
|  12-09-2019, 10:04 PM | #43 | |
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | Quote: 
 | |
|   |   | 
|  12-10-2019, 03:12 AM | #44 | 
| Wizard            Posts: 1,292 Karma: 1428263 Join Date: Dec 2016 Location: Goiânia - Brazil Device: iPad, Kindle Paperwhite, Kindle Oasis | |
|   |   | 
|  12-10-2019, 05:05 PM | #45 | 
| Junior Member  Posts: 9 Karma: 10 Join Date: Dec 2019 Device: none | |
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| night mode | cybmole | Amazon Fire | 9 | 04-27-2015 01:43 AM | 
| Glo Night mode ? | Ethanaul | Kobo Reader | 1 | 07-23-2013 10:23 PM | 
| Odyssey Anyone using Night-Mode? | DuckieTigger | Bookeen | 2 | 01-28-2012 12:13 PM | 
| help with night mode | golfgirl | Kobo Tablets | 5 | 11-04-2011 10:40 AM | 
| Is there a night mode? | zeroh | Nook Color & Nook Tablet | 5 | 12-04-2010 10:24 AM |