Menu

#57 Opacity setting for Highlight plugin

closed
nobody
None
5
2008-02-07
2008-02-01
No

Problem is that the word under the caret gets shadowed by the highlight color and gets more difficult to read.

The ideal would be to allow the plugin to highlight only the background and not the text itself but this may be tricky to do.

A simple solution would be to allow customization of the opacity of the highlight in the plugin options instead of having it hard coded.

Discussion

  • Manfred Usselmann

    Logged In: YES
    user_id=16314
    Originator: NO

    This annoyed me as well and I'm using a modified version of the plugin. The change was very easy, just one line needed to be changed:

    I changed function initTextArea() in HighlightPlugin.java from

    ...
    painter.addExtension(TextAreaPainter.HIGHEST_LAYER, highlighter);
    ...

    to

    ...
    painter.addExtension(TextAreaPainter.BELOW_SELECTION_LAYER, highlighter);
    ...

    I also added a rectangle around the highlighted area. For that I changed function _highlight() in Highlighter.java :

    from
    ...
    gfx.setColor(oldColor);
    gfx.setComposite(oldComposite);
    }

    to
    ...
    gfx.setComposite(oldComposite);
    gfx.drawRect(startX, y, endX - startX, fm.getHeight());
    gfx.setColor(oldColor);
    }

     
  • Matthieu Casanova

    Logged In: YES
    user_id=285591
    Originator: NO

    Hi, I added some options to choose the layer of the extension and to change the transparency. (for the transparency it is not updated immediately yet, you can force it by splitting the view and unsplit (I'll fix that later).
    Tell me if it works like you want.
    I'll also add the rectangle too

     
  • Jocelyn Turcotte

    Logged In: YES
    user_id=1723575
    Originator: YES

    wow that was fast!

    tried it and the solution fits perfectly my needs, this made a great editor even greater
    thanks to both of you

     
  • Jocelyn Turcotte

    • status: open --> closed
     
  • Manfred Usselmann

    Logged In: YES
    user_id=16314
    Originator: NO

    Could this change please be published on Plugin Central?

     
  • Matthieu Casanova

    Logged In: YES
    user_id=285591
    Originator: NO

    That's right I forgot to submit it, I just sent the plugin submission

     

Log in to post a comment.