Line spacing and focused text

Posted on May 19, 2012, under FocusWriter

Yesterday I added the single most requested feature to FocusWriter: users can now set the line spacing per theme (and paragraph spacing, and indent the first line of each paragraph). However, there is one caveat: because I couldn’t find any way to override or merge QTextBlockFormats without modifying documents users will need to reload their files to get the different spacings for each theme. I spent a good deal of time looking around in the source code of Qt trying to find a way to do it, but please let me know if there is something I’ve overlooked! I figured out to directly change the QTextBlockFormats without modifying the documents, so now the different spacings take effect immediately.

I also added another popular request, the ability to choose what text is “focused”. Users can now choose between having one line focused, three lines focused, the current paragraph focused, or (the default) all of the text focused. It was actually quite a bit easier to add than I was expecting it to be because I was able to make use of QTextEdit’s “extra selections” (designed primarily for things like highlighting the current line in a text editor) to set the focused text to opaque, and leave the unfocused text translucent.

FocusWriter narrow focus

FocusWriter broad focus

FocusWriter paragraph focus

FocusWriter all focus

6 comments

Todd Lucas says:

May 21, 2012 at 12:39 am

Sweet! Now are you a titanic tease 😜

Oh, and welcome back from your break.

Graeme says:

May 21, 2012 at 10:39 am

Isn’t the point of development blogs to be a tease of things to come? 🙂

Thanks, it’s good to be back!

serpicojam says:

May 29, 2012 at 1:39 am

Any chance someday also of headers, footers, page #s, and footnotes/endnotes? (Couldn’t help but ask!) Love FocusWriter!

Graeme says:

May 29, 2012 at 1:22 pm

Sorry, but no. Those are page layout features and outside the scope of FocusWriter. I also don’t know if QTextEdit supports them. Still, I will be sure to blog about it if I change my mind!

Peter says:

July 20, 2012 at 11:54 am

“users can now set the line spacing per theme (and paragraph spacing, and indent the first line of each paragraph). ”
Sounds good, but unfortunately I can not find the settings anywhere 😦

Graeme says:

July 20, 2012 at 12:45 pm

The spacings are set on the last tab of the modify theme dialog in the development version.

Categories