Here's a script to reverse the effects of the change body script.

On Tuesday, March 28, 2023 at 12:01:18 PM UTC-4 Edward K. Ream wrote:

> On Tue, Mar 28, 2023 at 9:56 AM Thomas Passin <tbp1...@gmail.com> wrote:
>
>> It would be easy to have a companion script that eliminates the 
>> font-changing behavior.  If people say they want it, I'll work one up and 
>> post it.
>>
>
> I'd like to try both scripts.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/4dc1824e-0a7d-4547-b34b-bc71b69d6f90n%40googlegroups.com.
@language python
"""Stop Changing the body font of a node.

Reverses the effect of the "change body font" script so that the body
font no longer changes when focus moves to a text/rest/md/etc node.
"""

NOSTYLE = 'LeoQTextBrowser {}'

def set_alt_body_font(tag, keys):
    """Set body font back to the theme's font.
    
    Expected to be called by a hook procedure.
    """
    c = keys['c']
    css = NOSTYLE
    editor = c.frame.body.wrapper.widget
    editor.setStyleSheet(css)

ud = g.user_dict
g.unregisterHandler('select3', ud['alt_body_font_proc'])

ud['alt_body_font_proc'] = set_alt_body_font
g.registerHandler('select3', ud['alt_body_font_proc'])



Reply via email to