Line spacing and focused text
May 19, 2012 6 Comments
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.