37089 Commits

Author SHA1 Message Date
Kovid Goyal
aaeee5f7a3
Fix #2049968 [[Enhancement - E-book viewer] Unnecessary separator in Preferences > Shortcuts sections](https://bugs.launchpad.net/calibre/+bug/2049968) 2024-02-05 14:23:06 +05:30
Kovid Goyal
f5c5a149e9
Show a warning when configuring colors with system user interface style 2024-02-05 12:11:14 +05:30
Kovid Goyal
bdc000d2ec
Wire up the color palette preferences into the main preferences GUI 2024-02-05 12:03:56 +05:30
Kovid Goyal
95c28f6ab4
Output the full path to the exe as part of basic debug info 2024-02-05 08:05:35 +05:30
Kovid Goyal
1392a95abc
Fix restore defaults 2024-02-04 22:32:05 +05:30
Kovid Goyal
b7382d6f52
... 2024-02-04 22:26:04 +05:30
Kovid Goyal
b47e0d5125
UI for customizing palettes
Needs integration in to calibre preferences
2024-02-04 22:24:42 +05:30
Kovid Goyal
085862b062
Change to using a fixed standard light palette
This fixes all manner of subtle issues introduced by Qt's broken
attempts to map system colors to a QPalette.

1) Highlight color being same as Windows' accent color (this is anyway
   reverted in Qt 6.6)

2) Window titlebars not following system light/dark changes on Windows.

3) All the custom code that I wrote for tracking system light/dark
   changes can be dropped in favor of the new QStyleHints::colorScheme
   property

4) We had a fixed dark mode palette but not a fixed light mode palette.

I am sure people, especially on Linux, are going to complain about this,
but there are simply too many upsides. I will perhaps add a way to
configure the details of the light and dark palettes for people that
need it. This dialog could theoretically have a button to try to import
the standard system palette automatically to create the custom palette.
2024-02-04 11:52:10 +05:30
Kovid Goyal
3a4787577b
... 2024-02-04 09:19:53 +05:30
Kovid Goyal
90a0a33723
Windows: Fix a regression in 7.0 that caused images referring to files on the disk within comments columns to not display in some circumstances 2024-02-04 09:18:30 +05:30
Kovid Goyal
7e3ac04222
E-book viewer: Fix clock showing hour as zero instead of 12 between 12 and 1 am/pm 2024-02-03 09:13:33 +05:30
Kovid Goyal
e1956f3cff
Ignore a filenotfound error that happens during folder removal on windows despite exists() succeeding 2024-01-30 12:23:33 +05:30
Kovid Goyal
3fd6c7f915
... 2024-01-29 11:30:25 +05:30
Kovid Goyal
f01474325e
Fix tooltips not being displayed for layout buttons in layout menu 2024-01-29 08:21:14 +05:30
Charles Haley
c1b727ff52 Minor changes:
- Correct some comments so they reflect what the code is now doing.
- Make return None explicit in a few places.
- Wrap render_cover() in an if to check that cover_tuple is valid. This doesn't change behavior because the thrown exception would do the same thing, but being explicit is nice.
2024-01-27 11:35:32 +00:00
Kovid Goyal
6f82b8e36c
If there is an error rendering the cover thumbnail report it to the GUI with thumb=None 2024-01-27 09:06:01 +05:30
Kovid Goyal
f97147afec
Some optimizations for previous PR
1) Set device pixel ratio on generated QPixmap
2) Avoid copying image data when loading cover from library
3) Convert thumbnail to RGBA in cover thread so as to do less work in
   GUI thread
2024-01-27 09:01:52 +05:30
Charles Haley
d6f5384b8a Move convert_PIL_image_to_pixmap to the GUI thread 2024-01-26 20:35:44 +00:00
Charles Haley
3960e6a8d5
Merge branch 'kovidgoyal:master' into master 2024-01-26 18:03:33 +00:00
Charles Haley
5ba71155ac Use the new convert_PIL_image_to_pixmap function.
I can't use ReadOnlyFileBuffer because PIL requires that the buffer have the lstrip() function. I did eliminate a copy operation when writing the image to the thumbnail cache.
2024-01-26 18:00:56 +00:00
Kovid Goyal
99c0ce77f7
... 2024-01-26 21:41:24 +05:30
Charles Haley
7ab5fedd1a
Merge branch 'kovidgoyal:master' into master 2024-01-26 16:09:27 +00:00
Kovid Goyal
f7d9b0383e
... 2024-01-26 21:35:58 +05:30
Kovid Goyal
ea7d80c79b
Add a function to efficiently convert PIL images to QPixmaps 2024-01-26 21:33:19 +05:30
Charles Haley
f312435b59 Change to using PIL for image rendering. This lets us do all thumbnail generation on the cover thread.
I couldn't make the PIL ImageQt stuff work. It seems to use a common butter somewhere. Generating and adding a second image to the CoverCache corrupted previously added images. This implementation avoids this problem by passing a byte string of the PIL thumbnail to re_render(), which creates the QPixmap on the GUI thread. As a side effect, all the CoverCache operations are now on the GUI thread.

This implementation is visibly faster than the last one.
2024-01-26 13:24:50 +00:00
Kovid Goyal
07f988b109
No need to make two filesystem calls when checking version of thumbnail cache 2024-01-25 21:29:17 +05:30
Kovid Goyal
3dcdc766ee
Ensure self.dbref always exists 2024-01-25 21:23:33 +05:30
Kovid Goyal
3a56d5ca48
Do not call self.model() in the fetch covers thread
That is Qt code and Qt is not safe ot use outside the GUI thread
2024-01-25 21:21:51 +05:30
Charles Haley
4972af52ab Fix for the cover render hang discussed in https://www.mobileread.com/forums/showthread.php?t=358705.
- All Qt operations are now done on the GUI thread. File operations are done on a separate thread.
- QPixmap is used instead of QImage.
- The ThumbnailCache is now versioned.

The rendering operations are done using a FunctionDispatcher instead of a Qt signal to avoid a long queue of render operations causing the UI to be sluggish.

Emblems etc aren't rendered if the cover cache hasn't been set for the book. This reduces some subtle flashing as the cover is repainted. However, covers are seen as empty regions until the cover is actually rendered.

I also fixed a bug where the wrong cache would be used after a switch library. The UUID used for the cache was set at thread creation time instead of set_database time.
2024-01-25 13:54:12 +00:00
Charles Haley
1ce6a63a62 Bug #2049992: unknown function when referencing stored template "function" in epub:save_to_disk plugboard template
The comments in Saver.__init__ are there in case there is some reason to not remove the load_user_template_functions() call. They can be removed.
2024-01-21 14:38:34 +00:00
Kovid Goyal
dff94f6f62
Better fix for delegate max width calculation
Use the width of the viewport widget as that automatically excludes
scrollbars.
2024-01-20 08:26:28 +05:30
Charles Haley
c3acf05664 Fix for edit widget placement problem
described in https://www.mobileread.com/forums/showthread.php?p=4390503#post4390503
2024-01-19 21:52:41 +00:00
Kovid Goyal
32baf23f21
Fix #2049928 [go to location shortcut doesn't change cursor focus properly](https://bugs.launchpad.net/calibre/+bug/2049928) 2024-01-19 22:27:45 +05:30
Kovid Goyal
42d9538e2c
version 7.4.0 2024-01-19 07:41:29 +05:30
Charles Haley
7871cd5bea Fix tweak for the enter key and 'show_book_details'. Add 'show_locked_book_details' as an option.
See https://www.mobileread.com/forums/showthread.php?t=358579
2024-01-18 15:20:29 +00:00
Kovid Goyal
6c18b02642
Only highlight cursor line after syntax highlighter is finished
This is because cursor line highlight relies on data from syntax
highlighting (to apply background colors)
2024-01-18 20:06:45 +05:30
Kovid Goyal
6ff92e685f
Add support for the Supernote A6X2 2024-01-17 15:33:55 +05:30
Kovid Goyal
b714fc5023
Category notes browser: Add a button to search for books in the currently selected category. Fixes #2046825 [[Enhancement] Browse category notes](https://bugs.launchpad.net/calibre/+bug/2046825) 2024-01-16 21:34:15 +05:30
Kovid Goyal
5875303a48
Separate category value from notes in results list
Only works if there is no search or the match is close enough for the
result text to include the category value.
2024-01-16 21:16:54 +05:30
Kovid Goyal
d4d45eb5b9
Merge branch 'master' of https://github.com/cbhaley/calibre
Fixes #2049428 [Lookup name #readstatus doesn't have a link map](https://bugs.launchpad.net/calibre/+bug/2049428)
2024-01-16 07:08:49 +05:30
Kovid Goyal
401c3b615f
Fix #2049410 [A minor bug in source code src/calibre/web/feeds /news.py](https://bugs.launchpad.net/calibre/+bug/2049410) 2024-01-16 07:06:56 +05:30
Charles Haley
18482c9ff8 Bug #2049428: Lookup name ... doesn't have a link map 2024-01-15 20:03:19 +00:00
Charles Haley
d7481f5b0c Correct the position supplied by Qt in QTextBrowser when using the context menu key so the anchor is recognized. 2024-01-11 11:19:49 +00:00
Kovid Goyal
081bceb9e4
Fix #2048667 [Update label wrong position](https://bugs.launchpad.net/calibre/+bug/2048667) 2024-01-09 08:58:03 +05:30
Kovid Goyal
a1b06901fd
Move Preferences to the left in the default toolbar
Makes it less likely to be hidden behind the three bots bar expander on
small screens.
2024-01-09 08:44:39 +05:30
Charles Haley
90656de624 Two small changes:
1) In the central widget, use instance variables instead of class variables. I don't think this matters now, but it might if central can ever be reinstantiated.
2) Slight wording change on the new option's help text.
2024-01-08 12:22:25 +00:00
Kovid Goyal
e9cc00560a
Fix #2048475 [Tests fail with lxml 5.0](https://bugs.launchpad.net/calibre/+bug/2048475) 2024-01-08 09:12:35 +05:30
Kovid Goyal
140ea63f8c
Cleanup previous PR
We dont disable the preference as now the layout is dynamically
switchable via keyboard shortcut, so it is conceivable the user might
want to set that preference even when the current layout is Wide.
2024-01-08 08:26:46 +05:30
Charles Haley
9f2045c3ba The cover browser position option with the "auto" choice. 2024-01-07 11:28:23 +00:00
Kovid Goyal
3f35571f8d
Restore tooltip for window layout preference 2024-01-07 14:17:06 +05:30