Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-09-2024, 03:29 PM   #16
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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by BetterRed View Post
Added: if you were to ask me to rank the issues raised here against the issue of Tab shifting focus between windows, I'd probably rank the latter lower. I put that down to BekkyEbook's .qss patch. IMO it should be a built-in preference in all Qt apps… spotting which control has focus is also hard in other Qt based applications I use.
BR
Unfortunately, QWebEgineViews (Preview) do not allow stylesheets at all so making Preview show that it has focus is not easy.

I have to wrap Preview in another widget and then manually track focus in and focus out of Preview because for some reason it is does not detect it has focus (even if you properly set the FocusProxy) and therefore does not get influenced by BeckyEbook's qss at all. So we would have to manually set the border red at the code level on focusIn and manualy remove the border on focusOut.

To make matters worse, Qt only supports a single stylesheet at the application level and will not merge or inherit from multiple qss styles at once.

So what I really need to hear is from people who have played around with BeckyEbook's qss focus border on all platforms under both light and dark mode to see if it works (aside from Preview) and to see if this is a real change to keep on 100% of the time.

So feedback appreciated on showing focus with a solid red line as the default and only behaviour (ie. that can not be turned off).

Last edited by KevinH; 04-09-2024 at 03:31 PM.
KevinH is offline   Reply With Quote
Old 04-09-2024, 03:42 PM   #17
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,561
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I would definitely want to have a way to turn any such feature off (including with Preview).

I also worry that the widget that Preview would get wrapped in might cause issues with future Qt incarnations. We had a border coded around one of the widgets (which I'm thinking was Code View) that caused all kinds of problems with Windows dark mode until it was finally removed.

But as long as there's a functioning "turn off all visible focus decorations" preference checkbox, I'm not opposed.
DiapDealer is offline   Reply With Quote
Advert
Old 04-09-2024, 06:22 PM   #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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
Okay, I think I have a way to make it all work.

I have temporarily hard coded it to use an environment variable:

QString focus_highlight = Utility::GetEnvironmentVar("SIGIL_HIGHLIGHT_FOCUS_ WIDGET");

export SIGIL_HIGHLIGHT_FOCUS_WIDGET=1

will turn it on in Settings

unset SIGIL_HIGHLIGHT_FOCUS_WIDGET

will turn it off. Note: these are checked only once at startup.

If people like it then we can fart around with the horrible Preferences code and remove the need to use an Environment variable.

All just pushed to master now.

Last edited by KevinH; 04-09-2024 at 06:49 PM.
KevinH is offline   Reply With Quote
Old 04-09-2024, 08:29 PM   #19
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,594
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@KevinH - I had an interrupt, and hadn't posted this.

FTR: On Windows 10, BeckyEbook's border tweak doesn't appear in CodeView or Preview windows, in both Dark and Light modes, it appears everywhere else… I think.

My "IMO it should be a built-in preference in all Qt apps…" was meant to be read as "In an ideal world it should be a built-in preference in all Qt apps…".

So, I suggest - do nothing.

FWIW: I don't have a problem with using EnvVars


I stumbled into a Windows Ease of Access setting that I didn't know about - Text cursor indicator. It's useful sometimes.

It isn't being handled as it should be in Codeview. Because I can see the same behaviour in the calibre editor codeview window, there's no doubt it's a Qt issue. I've attached some relevant screen shots.

There's no problem with single line text boxes, but things go awry in multiline text boxes line. The indicators appear, but they're detached from the cursor, I'd rather they didn't appear at all… as is the case in Notepad++.

Kevin, Perhaps you could nudge Qt, maybe it's already been reported. I have reasonably convenient way to turn the indicators off/on.

BR
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-04-10 082845.jpg
Views:	36
Size:	162.3 KB
ID:	207455   Click image for larger version

Name:	Screenshot 2024-04-10 084017.jpg
Views:	37
Size:	142.9 KB
ID:	207456   Click image for larger version

Name:	Screenshot 2024-04-10 084410.jpg
Views:	33
Size:	349.7 KB
ID:	207457  

Last edited by BetterRed; 04-09-2024 at 08:39 PM.
BetterRed is offline   Reply With Quote
Old 04-09-2024, 10:23 PM   #20
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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
@BetterRed

I just pushed a fix for Preview to show the red outline but it requires a clean new checkout and build of Sigil, setting that environment variable and removing BeckyEbooks code from your qt_styles.qss file.

FYI, CodeView has no border to highlight as that caused issues with Dark mode on Windows. Luckily CodeView always shows the current line highlighted when it has focus. So it is easy to see focus. And you control the CodeView highlight colour palette in Sigil Preferences.

As for your Windows only Ease of Access issue, I have no idea about it, and as I do not even own a Windows box, I can not recreate it.

So I can not create a simple example standalone bug reproducer program required for bug reports.

And I have no way to test it. So I won't be the one to file a bug report with Qt. Perhaps you can convince Kovid to.
KevinH is offline   Reply With Quote
Advert
Old 04-09-2024, 10:34 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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
@BetterRed
I googled Qt and "Windows Ease of Access" and they said to double check that the font size set by Windows Ease of Access" exactly matches the font size used in the text editor (ie. CodeView font size that you control in Sigil Preferences). Otherwise the cursor location becomes out of sync in multiple lines situations.

There are also ways to set a cursor shape for most Qt apps. Perhaps styling a larger cursor in qss might help.
KevinH is offline   Reply With Quote
Old 04-09-2024, 11:43 PM   #22
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,594
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I assumed this Text cursor indicator feature was fairly new, it's been in Windows for almost 4 years (earlier in preview releases) - why wasn't I told

Quote:
Originally Posted by KevinH View Post
@BetterRed
I googled Qt and "Windows Ease of Access" and they said to double check that the font size set by Windows Ease of Access" exactly matches the font size used in the text editor (ie. CodeView font size that you control in Sigil Preferences). Otherwise the cursor location becomes out of sync in multiple lines situations.
I have no idea what "…the font size set by Windows Ease of Access (EoA) exactly matches the font size used in the text editor" might mean, the Font size adjustment in EoA is for the Windows interface - it has no effect on applications like Sigil… nor should it!

Quote:
Originally Posted by KevinH View Post
There are also ways to set a cursor shape for most Qt apps. Perhaps styling a larger cursor in qss might help.
AFAIK Qt has never paid much heed to the Windows Ease of Access features - the setting for text cursor thickness has been there for decades, Qt blithely ignores it. But in that it's not alone, Notepad++, and Firefox are the same for multiline text boxes.

If anyone knows of a qss tweak I can use to 'enhance' the text cursor, maybe they can give me clue - width and color maybe.

BR

Last edited by BetterRed; 04-10-2024 at 12:12 AM.
BetterRed is offline   Reply With Quote
Old 04-10-2024, 12:27 PM   #23
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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
Okay just pushed a fix for adding the red solid focus highlight box to CodeView that depends on a Sigil setting / environment var right now.
Now both CodeView and Prview act like the other focus highlight widgets.
KevinH is offline   Reply With Quote
Old 04-10-2024, 12:53 PM   #24
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,561
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'll volunteer to fart around with getting the Preferences code in order (if this is something everyone wants keep).

I'm assuming the default will be off, like the environment variable, correct?
DiapDealer is offline   Reply With Quote
Old 04-10-2024, 01:02 PM   #25
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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DiapDealer View Post
I'll volunteer to fart around with getting the Preferences code in order (if this is something everyone wants keep).

I'm assuming the default will be off, like the environment variable, correct?
Yes please. And yes default off. I have already updated the SettingsStore with the calls to get the current value and update it.
KevinH is offline   Reply With Quote
Old 04-10-2024, 05:02 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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
@BetterRed
I have looked into somehow highlighting the blinking text insertion point (caret) in a cross platform manner.

It does not appear doable without just growing the font size. Recent versions of qt can use qss caret-color property to set it to some other color but I can't see a way to change its height or thickness as those are tied to the font being used. A very thin blinking red line can be as hard to see as a very thin blinking black line.

It might be possible with setting QStyle controls but I could not find it in the Qt docs.

That just leaves system level Accessibility controls. On Windows it is "Ease Of Access" but as you pointed out that is broken. On macOS, you can change cursor size but not caret size as it is tied to the font size. There is a tool on macOS to show a zoomed in hover of the text near the caret but it is awkward to use.

So unless there is some qt codebase that draws insertion point caret's someplace, I do not think that is possible.

That leaves either zooming the screen (using lower dpi settings on display) or setting a larger font size.

So no luck with any of that.

Last edited by KevinH; 04-10-2024 at 05:04 PM.
KevinH is offline   Reply With Quote
Old 04-10-2024, 06:34 PM   #27
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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
Kept looking and there is a setCursorWidth() routine in QPlainTextEdit which is what CodeView is made from.

If we can change both the caret-color and double the width, that should help. I will give that a try tomorrow.
KevinH is offline   Reply With Quote
Old 04-10-2024, 06:47 PM   #28
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,594
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@KevinH - Thanks for checking all that.

For me at least, an EnvVar for drawing a coloured border around the control that has focus is sufficient. If you make it a Preference setting someone is bound to ask for a shortcut, an on/off toggle in a menu, and a toolbar button

As for the Text cursor issues (to me a caret is a ^), I'm happy to leave it be.

I don't understand why so many applications respect the Windows text cursor width setting in single line text boxes - where I think it's least needed, but disregard it in multi-line text text boxes - where I think it's most needed. It's not a Qt specific thing.

Back when 'expert systems' were the go, I had something that had width and colour settings for its text cursor - would have been on OS/2 or Apple Lisa.

BR

Last edited by BetterRed; 04-10-2024 at 06:50 PM.
BetterRed is offline   Reply With Quote
Old 04-10-2024, 06:59 PM   #29
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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
That Focus Highlight setting will only be checked once at startup. So changing it will require you to restart Sigil. I doubt there will be any need for shortcuts! .

It has to be done that way to allow user qt_styles.css to come after it.
KevinH is offline   Reply With Quote
Old 04-11-2024, 09:39 AM   #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,669
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by KevinH View Post
Kept looking and there is a setCursorWidth() routine in QPlainTextEdit which is what CodeView is made from.

If we can change both the caret-color and double the width, that should help. I will give that a try tomorrow.
Well that was a dead end. Under macOS using setCursorWidth in CodeView had absolutely no impact on either the blinking insertion point or the cursor itself.

So it appears the blinking insertion point is not controllable at all under Qt6 using setCursorWidth no matter what the docs say.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Icon Redesign for future 1.0 Release of Sigil shorshe Sigil 38 06-06-2016 11:29 PM
Kindle Software Preview Release and calibre 'Fetch News' items tomsem Devices 25 07-20-2011 08:02 AM
Will amazon release another cheaper version of DX in the near future CalvinL Amazon Kindle 6 07-31-2010 05:01 PM
Suggestion For Future Release Of Calibre clambert Calibre 5 07-10-2010 01:45 PM
dotReader alpha release next month with future iLiad support possible Alexander Turcic News 7 09-28-2006 12:24 PM


All times are GMT -4. The time now is 11:05 PM.


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