0

If you select text in a Textfield/TextArea/something else, you'll likely find that the color of the text is inverted, and the background colour of the field is changed to sometihng dark/different to what it was.

Is there a region to describe this?

When selecting/highlighting text with the mouse in a Textfield, the following style, applied with the key ".*" applies the style as expected. This leads me to believe that there is a region key for highlighted text only:

   <style id="backingStyle">
    <opaque value="true"/>
    <font name="Arial" size="12"/>
    <state>
      <color value="#333333" type="BACKGROUND"/>
      <color value="WHITE" type="FOREGROUND"/>
    </state>
  </style>
  <bind style="backingStyle" type="region" key=".*"/>

However I'll be damned if I can find it!

Thanks!

8bitjunkie
  • 12,793
  • 9
  • 57
  • 70

1 Answers1

1

Synth L&F can have different properties for different states. So there aren't separate region for selected text. Different states are described in this way:

<state>
  <color value="#333333" type="BACKGROUND"/>
  <color value="WHITE" type="FOREGROUND"/>
</state>
<state value="SELECTED">
  <color value="#000080" type="BACKGROUND"/>
  <color value="BLACK" type="FOREGROUND"/>
</state>
Ha.
  • 3,454
  • 21
  • 24
  • 1
    I should add that I needed to use type="TEXT_BACKGROUND" and type="TEXT_BACKGROUND". I also needed to remove my and tags inside of the tags for "backingStyle" - these tags were previously preventing the styling for "selected" from coming through. Thanks for leading me to the answer! – 8bitjunkie Apr 06 '11 at 13:59
  • One of the problem with Synth is that it has very little documentation. I spent a lot of time in its source code to understand how it works. BTW, you should mark correct answers for you questions. – Ha. Apr 07 '11 at 06:56
  • Sorry Ha - forgot to click the Tick. Done for you! – 8bitjunkie Apr 07 '11 at 16:11