Skip to content

Commit 1da8760

Browse files
authored
Merge pull request #844 from Jugen/fix_highlight_fill
Fixed highlight fill
2 parents 8a81524 + 15f9122 commit 1da8760

3 files changed

Lines changed: 3 additions & 16 deletions

File tree

richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,6 @@ public class GenericStyledArea<PS, SEG, S> extends Region
313313
* *
314314
* ********************************************************************** */
315315

316-
/**
317-
* Background fill for highlighted text.
318-
*/
319-
private final StyleableObjectProperty<Paint> highlightFill
320-
= new CustomStyleableProperty<>(Color.DODGERBLUE, "highlightFill", this, HIGHLIGHT_FILL);
321-
322316
/**
323317
* Text color for highlighted text.
324318
*/
@@ -1571,10 +1565,6 @@ private void suspendVisibleParsWhile(Runnable runnable) {
15711565
* *
15721566
* ********************************************************************** */
15731567

1574-
private static final CssMetaData<GenericStyledArea<?, ?, ?>, Paint> HIGHLIGHT_FILL = new CustomCssMetaData<>(
1575-
"-fx-highlight-fill", StyleConverter.getPaintConverter(), Color.DODGERBLUE, s -> s.highlightFill
1576-
);
1577-
15781568
private static final CssMetaData<GenericStyledArea<?, ?, ?>, Paint> HIGHLIGHT_TEXT_FILL = new CustomCssMetaData<>(
15791569
"-fx-highlight-text-fill", StyleConverter.getPaintConverter(), Color.WHITE, s -> s.highlightTextFill
15801570
);
@@ -1584,7 +1574,6 @@ private void suspendVisibleParsWhile(Runnable runnable) {
15841574
static {
15851575
List<CssMetaData<? extends Styleable, ?>> styleables = new ArrayList<>(Region.getClassCssMetaData());
15861576

1587-
styleables.add(HIGHLIGHT_FILL);
15881577
styleables.add(HIGHLIGHT_TEXT_FILL);
15891578

15901579
CSS_META_DATA_LIST = Collections.unmodifiableList(styleables);

richtextfx/src/main/java/org/fxmisc/richtext/SelectionPath.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public class SelectionPath extends Path {
3737
SelectionPath(Val<IndexRange> range) {
3838
setManaged(false);
3939
this.range = range;
40+
highlightFill.addListener( (ob,ov,nv) -> setFill( nv ) );
41+
setFill( getHighlightFill() );
42+
setStrokeWidth( 0.0 );
4043
}
4144

4245
@Override

richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@
1010
-rtfx-blink-rate: 500ms;
1111
-fx-stroke-width: 1.0;
1212
}
13-
14-
.styled-text-area .selection {
15-
-fx-fill: dodgerblue;
16-
-fx-stroke-width: 0;
17-
}

0 commit comments

Comments
 (0)