![]() |
#16 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73
Karma: 11638
Join Date: Aug 2010
Location: Spain
Device: iPad, Kindle Paperwhite, Kobo Libra 2
|
I will have a look at how to use that module @BeckyEbook. I did style Qt using CSS and as you have noticed learned that if you style it Qt expects you to provide images for the drop-down arrow and checkmark....which would have been fine if you could just drop them in your plugin but apparently to work reliably you have to create a .qrc file using some sorcery with PySide tools.
I went to check untranslated strings and have these ones to add: Code:
"Changes to be applied:": "Number of search hits:" "Changes applied to file:": "Matching tag found for text:": "Search in text": "Error applying changes to file:": "Error occurred while processing (text, new tag, lang):": "Error details:": Thanks. Last edited by Coleccionista; 09-21-2024 at 05:59 AM. |
![]() |
![]() |
![]() |
#17 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,594
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It might be a bit of work incorporating my plugin_utils module after the fact. It's main goal was to allow plugin devs to support both PyQt5 in Sigil pre-2.0 and PySide6 in Sigil post-2.0.But it does include a lot of stuff that makes it easier to match Sigil's palette, fonts and such. It uses a subclass of QApplication to make most of it fairly transparent. You'd definitely want to disable the automatic QTranslations stuff since you have your own translation mechanism in place. It defaults to being enabled, but most of the features are able to be easily enabled/disabled with optional parameters to the PluginApplication class.
It's entirely up to you. Use it wholesale, cherry-picked the parts you might want (like dark mode), or don't use it at all. I won't mind! There's plenty of people here (myself included) that can help you with using the module. This all reminds me that I should create a newer, much leaner, version of my utility module that leaves out the PyQt5 support. We encourage folks to support older versions of Sigil wherever possible, but there does come a point where asking newer plugin devs to design their plugins with backward compatibility becomes overly complicated and self-defeating. EDIT: And yes... compared to creating/using qrc resources in C++, PyQt/PySide's usage does seem to be a bit like sorcery! ![]() Last edited by DiapDealer; 09-21-2024 at 09:06 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,594
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Also for the record... from Qt6.5 on, there's no need to do much of anything special for plugins to match the system colors/theme. Just add app.setStyle('Fusion') somewhere appropriate and your plugin will match your system colors/theme (and will even change on the "fly"). To my knowledge, system theme matching has worked with PySide6 apps on Linux and macOS without needing to specify app.setStyle('Fusion') for some time (Fusion is default on Linux, and macOS uses a different dark capable theme). But it's definitely still needed on Windows (which defaults to another style).
There should be no need to check for a system dark theme on any platform. If you make Sigil 2.0 the minimum for your plugin, you should be able to just add app.SetSyle('Fusion') to your code and PySide6 theming (including on the fly theming) will take care of itself. I wouldn't set the style to Fusion on macOS, but something like the following should work across the board: Code:
_plat = sys.platform.lower() iswindows = 'win32' in _plat or 'win64' in _plat if iswindows: app.setStyle('Fusion') Last edited by DiapDealer; 09-21-2024 at 10:48 AM. |
![]() |
![]() |
![]() |
#19 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73
Karma: 11638
Join Date: Aug 2010
Location: Spain
Device: iPad, Kindle Paperwhite, Kobo Libra 2
|
I thought the same but gave it a try anyways. To use it properly I might have to rewrite the plugin but as you can see it does make a difference.
I only did the bare minimum so not sure if I broke something else but I might give it a try. Code:
app = PluginApplication(files, bk, icon) app.match_sigil_darkmode() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Plugin] LOI-Generator - edit] plugin to generate a List of Illustrations | KevinH | Plugins | 1 | 01-19-2023 04:31 PM |
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) | mneimeyer | Plugins | 3 | 11-11-2019 08:07 PM |
[Plugin] QuickPrefsEdit - Edit plugin prefs json files. | slowsmile | Plugins | 3 | 07-25-2018 08:14 PM |
Goodread Perception Expander plugin not shown on plugin list (kobo h2o) | www | KOReader | 4 | 09-28-2017 10:34 AM |
Problem with my ScrambleEbook plugin and the Plugin Updater tool | jackie_w | Development | 14 | 01-19-2017 10:49 PM |