On Mon, 4 Aug 2014 11:15:45 -0700 (PDT)
"Edward K. Ream" <[email protected]> wrote:

> Ideally, I'd like vim-mode to put a red border around headline or
> body text widgets when in normal mode, and a blue border around the
> widgets when in insert mode.  And maybe another color for visual mode.
> 
> How would you recommend doing with stylesheets?

I'd do this:

    w = widget.to.be.styled()

    # and then one of
    w.setProperty('vim_state', 'vim_visual')
    w.setProperty('vim_state', 'vim_normal')
    w.setProperty('vim_state', 'vim_insert')
    w.setProperty('vim_state', None)  # leaving vim mode

    # and then
    w.style().unpolish(w)
    w.style().polish(w)

and the, in the style sheet:

QTextEdit[vim_state ~= 'vim_normal'] {
  border: solid 3px red;
}
QTextEdit[vim_state ~= 'vim_insert'] {
  border: solid 3px blue;
}

so how vim states are indicated is completely under user control in the
style sheet, either

  @data qt-gui-plugin-style-sheet

or

  @data qt-gui-user-style-sheet

Cheers -Terry


  

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to