Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-16-2023, 05:20 PM   #31
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,653
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by KevinH View Post
. . .
I have just now pushed to master the ability to use keyboard shortcuts (that you must assign in Sigil's Keyboard Preferences)


IMO that should be the practice for all newly created keyboard shortcuts… and I'm not just thinking of Sigil.

BR
BetterRed is offline   Reply With Quote
Old 11-17-2023, 02:08 AM   #32
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: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Sure. They are simply helpful, although of course the user usually knows what shortcut they have called up
BeckyEbook is offline   Reply With Quote
Advert
Old 11-18-2023, 01:55 PM   #33
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: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
I have noticed that if sub-windows are merged (e.g. TOC + Book Browser or TOC + Clips) then the focus changes, but the called window is not switched to the foreground.
You can see this clearly in the attached screenshot.
The Book Browser is still visible, despite the change of focus to TOC.
Attached Thumbnails
Click image for larger version

Name:	sigil-focus-merged-windows.png
Views:	28
Size:	9.2 KB
ID:	204793  
BeckyEbook is offline   Reply With Quote
Old 11-18-2023, 03:13 PM   #34
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,595
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Tabbified qdockwidgets have always behaved with a mind of their own.
DiapDealer is offline   Reply With Quote
Old 11-18-2023, 03:20 PM   #35
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,727
Karma: 5444398
Join Date: Nov 2009
Device: many
Yes I am seeing the same thing on macOS. Not sure how to detect if QDockWidget is tabbified and not the front tab.

Will try to see if there is any solution.
KevinH is offline   Reply With Quote
Advert
Old 11-18-2023, 03:41 PM   #36
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: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
I did a trial and raise() seems sufficient.
It doesn't need to be added to the Code View, as no other widgets can be added to this window.

Code:
void MainWindow::FocusOnBookBrowser()
{
    FocusOn(m_BookBrowser);
    m_BookBrowser->FocusOnBookBrowser();
    m_BookBrowser->raise();
    ShowMessageOnStatusBar(tr("Focus changed to BookBrowser window."));
}

void MainWindow::FocusOnPreview()
{
    FocusOn(m_PreviewWindow);
    m_PreviewWindow->SetFocusOnPreview();
    m_PreviewWindow->raise();
    ShowMessageOnStatusBar(tr("Focus changed to Preview window."));
}

void MainWindow::FocusOnTOC()
{
    FocusOn(m_TableOfContents);
    m_TableOfContents->SetFocusOnTOC();
    m_TableOfContents->raise();
    ShowMessageOnStatusBar(tr("Focus changed to Table Of Contents window."));
}

void MainWindow::FocusOnClips()
{
    FocusOn(m_Clips);
    m_Clips->SetFocusOnClips();
    m_Clips->raise();
    ShowMessageOnStatusBar(tr("Focus changed to Clips window."));
}
BeckyEbook is offline   Reply With Quote
Old 11-18-2023, 03:46 PM   #37
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,727
Karma: 5444398
Join Date: Nov 2009
Device: many
Sounds good. I am away from my dev machine. Please create a PR and I will merge it, or I will make that change on Monday when I am back home.
KevinH is offline   Reply With Quote
Old 11-18-2023, 04:15 PM   #38
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,595
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
There's an .isTabified property I think. But if raise() is not going to trigger anything unnecessary, checking the property before doing so is probably overkill.
DiapDealer is offline   Reply With Quote
Old 11-18-2023, 04:57 PM   #39
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: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
I checked via Debug that the widget can be checked for visibility before raise().
When the widget is in the foreground then raise() will not be called.

So an extra test shouldn't hurt, here an example:

Code:
void MainWindow::FocusOnTOC()
{
    FocusOn(m_TableOfContents);
    m_TableOfContents->SetFocusOnTOC();
    DBG qDebug() << "Focus";
    if (m_TableOfContents->visibleRegion().isEmpty()) {
        DBG qDebug() << "Here raise";
        m_TableOfContents->raise();
    }
    ShowMessageOnStatusBar(tr("Focus changed to Table Of Contents window."));
}
BeckyEbook is offline   Reply With Quote
Old 11-19-2023, 06:04 AM   #40
recook
Enthusiast
recook began at the beginning.
 
recook's Avatar
 
Posts: 32
Karma: 10
Join Date: Aug 2018
Device: kobo Nia
Smile just one more thing... (not Columbo 8^)

Hi,

one more niggling detail:
When the Find dialog has found a match and displays it in the Code view, oftentimes i want to focus the match and edit there.

For example, in building an ebook,
i collected a bunch of web pages,
named them s\d+.xhtml (numbered),
and have a list of original URLs as TOC (keeping a copy as Refernce page),
which i then replace (via regex) with s1.xhtml.
Next, i scan for "s1 and want to edit the matches to change the numbers.

It would be nice if a found match would focus there.
But it's no big thing, i can Focus the Code view, and it's just one shortcut more to type.

Last edited by recook; 11-19-2023 at 11:39 AM. Reason: expanded
recook is offline   Reply With Quote
Old 11-19-2023, 07:52 AM   #41
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: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
I don't know if I'm understanding you correctly, but you want to search for something, and after the search the focus is supposed to remain in the Find box?

If so then your request is the opposite of the approach in Sigil.
Find&Replace should not steal focus. [link]

If you want to edit your search then you'd better get used to that extra Ctrl+F though.
BeckyEbook is offline   Reply With Quote
Old 11-20-2023, 06:35 AM   #42
recook
Enthusiast
recook began at the beginning.
 
recook's Avatar
 
Posts: 32
Karma: 10
Join Date: Aug 2018
Device: kobo Nia
Hi,

indeed not, i'm sorry.

Once more, unto the breach:
I type ^F, then (in my example) the three characters "s1 into the find text field, then either click Find or type ^F again to find. When a match is found, i can (with the new Focus shortcuts - thanks @DiapDealer!) type the new shortcut to focus the Codeview to edit the match.
If Find would directly focus Codeview when a match is found, that last focus action wouldn't be necessary.

Actually, i never even got the Idea to
Quote:
After typing what you want in the find field, instead of clicking enter or hitting the Find button click in the main CodeView window once, then hit Find.
from the link you referenced, much less experienced that focus stealing.

Last edited by recook; 11-20-2023 at 06:50 AM. Reason: clarify
recook is offline   Reply With Quote
Old 11-20-2023, 07:02 AM   #43
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: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Wait, wait...
You mean to say that in version 2.0.2, after searching for something, the focus does not jump to Code View and remains in F&R?

Ctrl-F in F&R does not result in a search, Find button should jump to Code View.
BeckyEbook is offline   Reply With Quote
Old 11-20-2023, 09:22 AM   #44
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,727
Karma: 5444398
Join Date: Nov 2009
Device: many
Well it seems with multiple main windows on macOS, the visibleRegion().isEmpty() test failed sometimes and so no raise was done but needed.

I think the safest way to handle this is to use raise() called immediately after FocusOn call and before the specific internal subwidget is given focus. This should not hurt anything and works on macOS as well.

I also added a nullptr check for each to make sure the QDockWidget in question has not been deleted yet for safety in case someone deletes a main Window and shortcut keys or key events are waiting to be flushed out. This is more of a concern on macOS with its multiple main windows but is safer for everyone.

I have pushed this master. If you get a chance please make sure I have not hurt anything on Windows. It should all be okay but just to make sure.

I think with this change, we should consider this new feature as complete.

Glad people find it useful.

KevinH


Quote:
Originally Posted by BeckyEbook View Post
I checked via Debug that the widget can be checked for visibility before raise().
When the widget is in the foreground then raise() will not be called.

So an extra test shouldn't hurt, here an example:

Code:
void MainWindow::FocusOnTOC()
{
    FocusOn(m_TableOfContents);
    m_TableOfContents->SetFocusOnTOC();
    DBG qDebug() << "Focus";
    if (m_TableOfContents->visibleRegion().isEmpty()) {
        DBG qDebug() << "Here raise";
        m_TableOfContents->raise();
    }
    ShowMessageOnStatusBar(tr("Focus changed to Table Of Contents window."));
}
KevinH is offline   Reply With Quote
Old 11-20-2023, 10:22 AM   #45
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: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
I have built a new Sigil, I will check the focus switching during normal use of the application.
In short tests on Windows 10 Pro, everything looks good.
Thank you!
BeckyEbook is offline   Reply With Quote
Reply

Tags
book view, code view, focus, keyboard shortcuts, preview


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Book-details panels and keyboard focus BetterRed Library Management 3 05-12-2023 03:22 AM
Keyboard Shortcuts request David Kudler Sigil 2 08-07-2020 06:09 PM
feature request - Shortcuts for Plugins Camelot Sigil 12 12-28-2015 04:50 AM
keyboard shortcuts vikischeldrup Library Management 4 08-23-2013 04:55 AM
feature request - switch templates kgn Calibre 8 07-23-2010 09:17 AM


All times are GMT -4. The time now is 07:25 AM.


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