Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-25-2024, 06:36 AM   #16
jwes
Enthusiast
jwes began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2023
Device: none
Quote:
Originally Posted by KevinH View Post
@jwes,

8 and 9. I will look into ways for a user to use an environment variable to override the automatic refresh delay.

That said, a Preview refresh is a full fresh QWebEngine load and scroll and there is no way around that. I can not stop Preview (or any webpage that is reloaded) from flashing on old or slow systems.
Would this work for stopping the flash?
jwes is offline   Reply With Quote
Old 03-25-2024, 07:11 AM   #17
jwes
Enthusiast
jwes began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2023
Device: none
Quote:
Originally Posted by KevinH View Post
Because when you open the Insert Special Character dialog you are stealing the focus away from whatever had it. Whatever had that focus last is the target for the Dialog whether it is a CodeView, the Find field or the Replace field or another field in a completely different Dialog.

That was the whole design from the beginning and after more than 10 years, I am not making ui changes without really good reasoning.

That is not changing.

Happy for suggestions for changes or new features and will consider them, but that in *no* way guarantees these changes or requests will ever be accepted into Sigil master.
I looked at this again. If I enter text in the find and replace boxes, click on the find icon, then open Insert Special Character, the character goes into the code window. If Insert Special Character is already open when I enter text in the find and replace boxes and click on the find icon, then the character goes into the replace box.
jwes is offline   Reply With Quote
Advert
Old 03-25-2024, 08:03 AM   #18
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
What controls it is when you open it. That said, both CodeView and FindReplace have strong focus and will grab focus back and forth to aid in Find and Replace. Once you clicked the Find button, focus moved to the Codeview. In Sigil we track focus changes so that the last widget with focus is recorded.

FWIW, most users open it and select and have it auto close as insert special characters are relatively rare.

If you are opening Insert Special chars and leaving it open for long periods while constantly using it, then using clips may actually be easier as they always target CodeView.

Try creating clips for your most often used Insert Special Character values. I think you may find that does what you want.

Last edited by KevinH; 03-25-2024 at 11:40 AM.
KevinH is offline   Reply With Quote
Old 03-25-2024, 08:21 AM   #19
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by jwes View Post
Would this work for stopping the flash?
As far as I know, a QWebEngineView (the QtWebEngine browser widget - not a regular widget) uses asynchronous updating and painting using a different rendering process that is gpu intensive. We can not suspend and then un-suspend big updates any more than a Web Browser can. The "web page must be fully loaded before it can scroll. We can only hide then show it but that creates an even larger flash.

Again, try *not* editing the entire ebook as one file. Try Splitting it into normal chapters as that makes things work much better. Use Find and Replace to insert Sigil SplitMarkers just before each chapter start and then use Sigil Split at Markers. Turn off auto red squiggly spell checking.

Or invest in a better machine. On my M2 Mac Studio, with well designed even huge epubs I rarely see any reload delay of any kind. Even repeatedly working near the bottom of the xhtml file.

Another approach that many people use is to do almost all of their major writing and text editing in a Word Processor (not in Sigil) with proper styles set. Then when ready export it as html into Sigil (or use one of Sigil's input plugins). Once in Sigil, split it, structure it, add Metadata, make and do final clean-ups, review it, spellcheck it etc. This process works better than actually trying to write the book in Sigil. Sigil is not designed for writing books. A Word processor is. Sigil is designed to edit epubs.

Sorry.

Last edited by KevinH; 03-25-2024 at 09:08 AM.
KevinH is offline   Reply With Quote
Old 03-25-2024, 11:49 AM   #20
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Quote:
Originally Posted by jwes View Post
I looked at this again. If I enter text in the find and replace boxes, click on the find icon, then open Insert Special Character, the character goes into the code window.
I do not understand this problem.
When you click "Find" the focus is in the Code View window and that is where the character from Insert Special Character is inserted.
If you do not press "Find" then the character is inserted at the cursor position.
BeckyEbook is offline   Reply With Quote
Advert
Old 03-25-2024, 12:23 PM   #21
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes just as BeckyEbook has said ...

If I click in Find field and then hit Insert Special Character and Ctrl-click on a char, it gets pasted into Find field.

If I click in the Replace field and then hit Insert Special Character and Ctrl-click on a char, it gets pasted into the Replace Field.

If I am editing in CodeView and then hit Insert Special Character and Ctrl-click on a char, it gets pasted in CodeView.

If I am in the Find field, and then hit the Find button, then control and focus moves to CodeView. If I then Insert Special Character and Ctrl-click on a char, it gets pasted in CodeView.

This is exactly the reason it was designed that way and has worked that way literally for most of a decade.

And to make this very clear: I will not be changing that.

If you do not like that feel free to use Clips to insert any characters or strings you want. That is what clips was designed for.

Or get the Sigil code and tweak and build a version of Sigil that works the way you want.

Last edited by KevinH; 03-25-2024 at 12:33 PM.
KevinH is offline   Reply With Quote
Old 03-25-2024, 12:28 PM   #22
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
@jwes

I really do like people making suggestions as most of the recent good changes have been suggestions from others!

But I really dislike having to argue with people who think only they know better and that they can control what direction Sigil goes. Especially when there are valid reasons for things working the way they do and have done for a decade.

So please stop.

Given Sigil is opensource, you can always tweak it to work the way you want and I am okay with that. Just do not call it Sigil.


FWIW:
BeckyEbook has many changes and tweaks she makes in her own Sigil builds. So it is achievable.

Last edited by KevinH; 03-25-2024 at 12:37 PM.
KevinH is offline   Reply With Quote
Old 03-25-2024, 04:05 PM   #23
jwes
Enthusiast
jwes began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2023
Device: none
Quote:
Originally Posted by KevinH View Post
Yes just as BeckyEbook has said ...

If I click in Find field and then hit Insert Special Character and Ctrl-click on a char, it gets pasted into Find field.

If I click in the Replace field and then hit Insert Special Character and Ctrl-click on a char, it gets pasted into the Replace Field.

If I am editing in CodeView and then hit Insert Special Character and Ctrl-click on a char, it gets pasted in CodeView.

If I am in the Find field, and then hit the Find button, then control and focus moves to CodeView. If I then Insert Special Character and Ctrl-click on a char, it gets pasted in CodeView.

This is exactly the reason it was designed that way and has worked that way literally for most of a decade.

And to make this very clear: I will not be changing that.

If you do not like that feel free to use Clips to insert any characters or strings you want. That is what clips was designed for.

Or get the Sigil code and tweak and build a version of Sigil that works the way you want.
I am not trying to argue. I want it to work the way I think you are saying it does work, but in this one case I believe it does not. If the Insert Special Character window is open and I enter text in the find and replace boxes and press find, focus for the keyboard goes to the code window but focus for the Insert Special Character window is not changed. Now characters from the keyboard go to a different place than characters from the Insert Special Character window. Is this really what you want?
jwes is offline   Reply With Quote
Old 03-25-2024, 04:47 PM   #24
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
It was designed to be opened by keyboard shortcut, and ctrl-clicked on char to insert char and auto close, so that the user can keep typing in whatever field they are in (Find, Replace, or CodeView) without missing a beat. It picks up where focus was just before it was launched.

If you leave it open, Insert Char will be targeting the previous focus location as tracked by Sigil. And from the sound of things, that is exactly what it is doing in your example.

If you want to insert characters or strings only into CodeView, then use clips. That is what clips are designed for.

As for not trying to be argumentative, I find that hard to believe. You have kept asking the same thing and I have kept repeating the same answer - that this behaviour is as designed and won't be changed. Then you ignore repeated suggestions to use clips, which are designed to do exactly what you seem to want (to only target CodeView) and are more flexible given they can be used to enclose selected text, as well as append it.

And that is now the last I will say on the subject. For me this topic is now closed.

Last edited by KevinH; 03-25-2024 at 05:16 PM.
KevinH is offline   Reply With Quote
Old 03-25-2024, 05:19 PM   #25
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
@KevinH.
I think I know what the issue is.
If the cursor is in the cbFind field then pressing "Find" takes the focus to Code View and that is understandable.
The problem arises when we are in the cbReplace field and then press "Find" (because we can). Then the focus stays in the cbReplace field.

If you remember this commit then maybe you just need to add some code there for the cbReplace field to make it work well.
BeckyEbook is offline   Reply With Quote
Old 03-25-2024, 05:26 PM   #26
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes, I remember that commit, but I do not think that behaviour is the issue, as it only happens for him when he leaves Insert Special Character dialog open.

If you understand what he is complaining about, and truly think it is a bug, then please post the fix and I will merge it as long as it does not break anything else. I think it is consistently operating on the previous place that had focus, which is how it was designed.
KevinH is offline   Reply With Quote
Old 03-25-2024, 05:34 PM   #27
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
This is without Insert Special Character.

Cursor in "Find" – OK, focus moving to Code View.
Cursor in "Replace" – leaving in "Replace".
Attached Thumbnails
Click image for larger version

Name:	focus-cbReplace.gif
Views:	19
Size:	158.4 KB
ID:	207150  
BeckyEbook is offline   Reply With Quote
Old 03-25-2024, 05:53 PM   #28
jwes
Enthusiast
jwes began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2023
Device: none
Quote:
Originally Posted by KevinH View Post
It was designed to be opened by keyboard shortcut, and ctrl-clicked on char to insert char and auto close, so that the user can keep typing in whatever field they are in (Find, Replace, or CodeView) without missing a beat. It picks up where focus was just before it was launched.

If you leave it open, Insert Char will be targeting the previous focus location as tracked by Sigil. And from the sound of things, that is exactly what it is doing in your example.

If you want to insert characters or strings only into CodeView, then use clips. That is what clips are designed for.

As for not trying to be argumentative, I find that hard to believe. You have kept asking the same thing and I have kept repeating the same answer - that this behaviour is as designed and won't be changed. Then you ignore repeated suggestions to use clips, which are designed to do exactly what you seem to want (to only target CodeView) and are more flexible given they can be used to enclose selected text, as well as append it.

And that is now the last I will say on the subject. For me this topic is now closed.
I want to be sure that I understand you. You are saying that in some cases characters from Insert Special Character should go to a different window than characters from the keyboard.
jwes is offline   Reply With Quote
Old 03-25-2024, 06:09 PM   #29
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
I have quick and dirty solution (you can certainly optimise this):

Code:
bool FindReplace::HasFocus2()
{
    return ui.cbReplace->lineEdit()->hasFocus();
}
...

Code:
void FindReplace::SetCodeViewIfNeeded()
{
    bool has_focus = HasFocus();
    if (has_focus) {
        // give the current tab CodeView Tab the focus
        ui.cbFind->lineEdit()->clearFocus();
        ui.cbReplace->lineEdit()->clearFocus();
        ContentTab * current_tab = m_MainWindow->GetCurrentContentTab();
        if (current_tab) current_tab->setFocus();
    }

    bool has_focus2 = HasFocus2();
    if (has_focus2) {
        // give the current tab CodeView Tab the focus
        ui.cbReplace->lineEdit()->clearFocus();
        ContentTab * current_tab = m_MainWindow->GetCurrentContentTab();
        if (current_tab) current_tab->setFocus();
    }
}
BeckyEbook is offline   Reply With Quote
Old 03-25-2024, 07:08 PM   #30
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi BeckyEbook,

That will force focus from Replace to CodeView for any Find and Replace button action. I can add that, but it will not directly change the code that determines where to insert special characters, it will just change the focus so the last focus target is changed.

How does that impact anything related to leaving the InsertSpecialCharacter dialog open though? Which I think was the issue he wanted changed?

Either way your change makes sense from a parallel perspective, if using the Find button moves focus to CodeView it should do it no matter if Focus is in the Find field or the Replace field just before the button is pressed.

I will push your change to master after our upcoming release so we have lots of time to make sure there are no unintended consequences.

Thank You!

Last edited by KevinH; 03-25-2024 at 09:48 PM.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil Error Message: Book File Would Not Open in Sigil fkustaa Sigil 5 03-18-2017 12:54 AM
Insert special character: some niggles Phssthpok Editor 2 11-19-2016 12:55 PM
Sigil-0.8.900 released for testing - Wait for Sigil-0.8.901 KevinH Sigil 106 10-04-2015 10:41 AM
Sigil on Nook vs Sigil on Kobo vs Sigil on iBook rosshalde Sigil 12 11-13-2014 09:34 AM
Some small editor niggles Phssthpok Editor 5 11-07-2014 07:39 AM


All times are GMT -4. The time now is 01:38 PM.


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