Skip to content

Commit

Permalink
Merge pull request #844 from Jugen/fix_highlight_fill
Browse files Browse the repository at this point in the history
Fixed highlight fill
  • Loading branch information
Jugen authored Aug 21, 2019
2 parents 8a81524 + 15f9122 commit 1da8760
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,6 @@ public class GenericStyledArea<PS, SEG, S> extends Region
* *
* ********************************************************************** */

/**
* Background fill for highlighted text.
*/
private final StyleableObjectProperty<Paint> highlightFill
= new CustomStyleableProperty<>(Color.DODGERBLUE, "highlightFill", this, HIGHLIGHT_FILL);

/**
* Text color for highlighted text.
*/
Expand Down Expand Up @@ -1571,10 +1565,6 @@ private void suspendVisibleParsWhile(Runnable runnable) {
* *
* ********************************************************************** */

private static final CssMetaData<GenericStyledArea<?, ?, ?>, Paint> HIGHLIGHT_FILL = new CustomCssMetaData<>(
"-fx-highlight-fill", StyleConverter.getPaintConverter(), Color.DODGERBLUE, s -> s.highlightFill
);

private static final CssMetaData<GenericStyledArea<?, ?, ?>, Paint> HIGHLIGHT_TEXT_FILL = new CustomCssMetaData<>(
"-fx-highlight-text-fill", StyleConverter.getPaintConverter(), Color.WHITE, s -> s.highlightTextFill
);
Expand All @@ -1584,7 +1574,6 @@ private void suspendVisibleParsWhile(Runnable runnable) {
static {
List<CssMetaData<? extends Styleable, ?>> styleables = new ArrayList<>(Region.getClassCssMetaData());

styleables.add(HIGHLIGHT_FILL);
styleables.add(HIGHLIGHT_TEXT_FILL);

CSS_META_DATA_LIST = Collections.unmodifiableList(styleables);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public class SelectionPath extends Path {
SelectionPath(Val<IndexRange> range) {
setManaged(false);
this.range = range;
highlightFill.addListener( (ob,ov,nv) -> setFill( nv ) );
setFill( getHighlightFill() );
setStrokeWidth( 0.0 );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@
-rtfx-blink-rate: 500ms;
-fx-stroke-width: 1.0;
}

.styled-text-area .selection {
-fx-fill: dodgerblue;
-fx-stroke-width: 0;
}

0 comments on commit 1da8760

Please sign in to comment.