![]() |
#31 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 169
Karma: 474196
Join Date: Jan 2011
Location: Canada
Device: Kobo Libra 2
|
I'm okay with the new dialog overall, despite a bit of getting used to; if it means a more consistent experience cross-platform then that's excellent. And the quick access bar is a lot nicer feature over Window's pinned folders in a Sigil/epub editing context.
As Stasia mentioned earlier, the big issue is that there doesn't seem to be an option to view thumbnails for images. I often find myself editing image-heavy books, where the images aren't really named anything recognizable, so it often helps to see a preview of the image. |
![]() |
![]() |
![]() |
#32 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
|
I already have a new PreviewFileDialog class that inherits from QFileDialog and adds a thumbnail side panel for images. I am thinking of how best for it to default to full native filedialogs if that option is set or creating a non-native one with the extra panel otherwise. Still very much in development and on the drawing board.
|
![]() |
![]() |
![]() |
#33 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Okay, I have pushed to master a test of the new PreviewFileDialog class that replaces just the Add Existing file dialog and only on those platforms that use non-native dialogs such as Windows, MacOS and maybe AppImage Linux builds. Repo based Linux builds and self-builds should still use their own native file dialog here if one exists with their choice of desktop.
I will post a test beta for people to try and see if the added thumbnail pane helps. If so, I will try to modify this new class to disable custom icon providers to speed up its use when working with networked drives/disks with lots of files. I will post a followup test beta when that feature is ready to be tested. |
![]() |
![]() |
![]() |
#34 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Sigil Testing Beta for new PreviewFileDialog and speed
Okay, I have created testing builds with the new PreviewFileDialog used for Sigil's Add Existing.
It adds a thumbnail pane to the normal non-native QFileDialog that shows both image and text file preview thumbnails of the selected file. Also, to kill two birds with one stone so to speak, I have added in a new environment variable called: SIGIL_NO_CUSTOM_DIRECTORY_ICONS If this environment variable is set, no Custom file icons are used which should help speed up things when networked drives with lots of files are used. It is only useful when non-native file dialogs are used. I have posted these testing builds (the macOS ones are signed but not notarized) to my personal github repo here: https://github.com/kevinhendricks/Bu...nMac/releases/ The files you want are called: Sigil-testing-Windows-x64-Setup.exe Sigil-testing-x86_64.AppImage Sigil.app-testing-Mac-arm64.tar.xz Sigil.app-testing-Mac-x86_64.tar.xz If you use Windows or Mac or the AppImage, please try Sigil with Add Existing to exercise this new Dialog and see if you like the new Thumbnail Preview (you may have to resize the dialog once). If you use network drives with lots of files, please try setting the new environment variable: export SIGIL_NO_CUSTOM_DIRECTORY_ICONS=1 and see if using this option helps speed up access to your network drive if it has lots of files. If you build your own on Linux, you should see no changes. All should work as before. But I would love to have that confirmed. Please let me know what you think? Last edited by KevinH; Yesterday at 12:10 PM. |
![]() |
![]() |
![]() |
#35 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 849
Karma: 3341026
Join Date: Jan 2017
Location: Poland
Device: Various
|
It's not bad
![]() I only have minor comments to make: 1. if the image is smaller than the preview window, then please display it in its original size (without stretching) 2. add svg file preview (now is only white background) Use the same mechanism that is in the file \src\Dialogs\SelectFiles.cpp if possible. |
![]() |
![]() |
![]() |
#36 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Hi BeckyEbook,
Thanks for testing and reporting back so fast! For 1. I thought the scaling of the QPixmap kept the aspect ratio. I will take another look at the code. But the thumbnail pane is a fixed 300 by 300 px size so that the dialog is not constantly resizing when different images are selected. It messes with the file list Window if it resizes automatically sometimes. For 2. Agreed svg should work. But I can't easily use the technique from src/Dialogs/SelectFiles as it would require embedding a QWebEngineView instead of a simple QPixmap stored in a QLabel. I was hoping to not need to add something that takes up so much memory and its own QWebProcess just to show a thumbnail. It is needed in SelectFiles as it can show audio and video previews which only a QWebEngineView can do. I will look into it. Last edited by KevinH; Yesterday at 01:46 PM. |
![]() |
![]() |
![]() |
#37 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Hi BeckEbook,
I pushed a change in "if" order so Previewing SVG should now work. The problem was that svg files are xml files and image files so they were picked up by the wrong thumbnail generator. That should now be fixed. At least it works on macOS now. I also tried to leave images whose width < 300px and height < 300 pixels to set the label pixmap directly without scaling. Hope that does what you want. Please pull from master and rebuild and retest when you get a free moment. Thanks for the feedback! |
![]() |
![]() |
![]() |
#38 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 849
Karma: 3341026
Join Date: Jan 2017
Location: Poland
Device: Various
|
|
![]() |
![]() |
![]() |
#39 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,643
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
I've not yet found the code where (or if) you've attempted to limit the use of the non-native dialog to only the Linux AppImage to see why that may be. It works fine, for the record! The image preview is great (and fast). The text preview isn't very useful for me on Linux or Windows as it stands, however. The text is very, very tiny, and when using a dark theme, the font looks very muted. The text is more legible (darker) in a light theme, but it's still tiny very tiny. I can basically see the shape of the paragraphs. The white background of the text preview is also bit jarring in a dark setting. But as you already mentioned somewhere, I'm not sure a full-blown QWebEngineView is the way to go here (to have better/more control over how the preview looks). Perhaps a setting to opt out of the text preview would be simpler/more appropriate if nothing can be done about the text preview background? Thanks! EDIT: just confirmed that earlier builds of Sigil on Linux were definitely using a native dialog for Add Existing. I'm not opposed to switching; I just wanted to be sure I was understanding how it should be working right now in a regular (or repo) Linux build. Last edited by DiapDealer; Yesterday at 06:44 PM. |
|
![]() |
![]() |
![]() |
#40 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Linux builds should use their native dialogs if one exists for your Desktop.
Nothing should have changed with it. If it did, then it is a bug. I will test my own Linux build on Manjaro with KDE to see if I see the same thing. I can easily remove the text Previews if people feel they do not add anything. Thanks for testing. |
![]() |
![]() |
![]() |
#41 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,643
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
You don't have to get rid of text preview on my account! See what others have to say about it. ![]() |
|
![]() |
![]() |
![]() |
#42 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,643
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Isn't line 98 in getOpenFileName() in PreviewFileDialog.cpp (and each subsequent function after) forcing the non-native issue?
Code:
options = options | QFileDialog::DontUseNativeDialog; if (!(options & QFileDialog::DontUseNativeDialog)) { return QFileDialog::getOpenFileName(parent, caption, dir, filter, selectedFilter, options); } Code:
return QFileDialog::getOpenFileName() |
![]() |
![]() |
![]() |
#43 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
|
You are right! I had hard coded things in every routine when trying to debug it under MacOS and just forgot I had done that.
I have removed the hard coded lines in each static routine and pushed it to master. I will work on making the text thumbnails more readable. I think I can actually handle dark and light mode too. But that is for tomorrow. Thanks! KevinH |
![]() |
![]() |
![]() |
#44 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,643
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Happy to help. This is great stuff!
|
![]() |
![]() |
![]() |
#45 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,837
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Okay, I have tried to make the text previews much more legible but still show enough text to be useful.
I have also converted the text thumbnailer to use QPalette::Base for the background colour and QPalette::Text for the foreground text colour. So under dark mode this should show white text on a dark background and visa-versa on a light mode. I tested this under macOS and the text shows nicely under both light and dark modes but I will have to figure something out to make it actively switch when the theme is changed in the middl;e of opeing a file (a possibility on MacOS that can auto change theme based on time of day). I have pushed this to master. So when you get a free moment, please give this a try and let me know if the changes help. If so, I will start work on detecting the palette change and reloading the current preview so auto theme changes are better handled. Thanks, |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with add existing files 2.6.0 | jwes | Sigil | 5 | 07-28-2025 03:05 PM |
calibre - Not using existing metadata from *.opf files when Add books | rolandt99 | Library Management | 19 | 06-15-2020 04:43 PM |
File name syntax change, existing files? | martienne | Library Management | 5 | 02-09-2014 08:48 AM |
Crashes when attempting to add existing files to images | BooksToGo | Sigil | 3 | 10-01-2013 06:17 AM |
Sigil crashes when Add Existing Files. | frichrdsn | Sigil | 2 | 05-28-2013 06:35 PM |