Line spacing and focused text

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 focusFocusWriter broad focusFocusWriter paragraph focusFocusWriter all focus


6 Responses to Line spacing and focused text

  1. Todd Lucas says:

    Sweet! Now are you a titanic tease ;-p

    Oh, and welcome back from your break.

  2. Graeme says:

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

    Thanks, it’s good to be back!

  3. serpicojam says:

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

  4. Graeme says:

    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!

  5. Peter says:

    “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 😦

  6. Graeme says:

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