From 0dc3ae3950aaff2560ca241e994b319b04a06b41 Mon Sep 17 00:00:00 2001 From: Jurgen Date: Wed, 21 Aug 2019 16:14:10 +0200 Subject: [PATCH 1/3] Removed default selection CSS --- .../main/resources/org/fxmisc/richtext/styled-text-area.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css b/richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css index bfe818f95..ef539c31d 100644 --- a/richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css +++ b/richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css @@ -10,8 +10,3 @@ -rtfx-blink-rate: 500ms; -fx-stroke-width: 1.0; } - -.styled-text-area .selection { - -fx-fill: dodgerblue; - -fx-stroke-width: 0; -} \ No newline at end of file From 3603db74ef6e784c698d89dd8db41d0854a49f2e Mon Sep 17 00:00:00 2001 From: Jurgen Date: Wed, 21 Aug 2019 16:02:11 +0200 Subject: [PATCH 2/3] Removed unused highlightFill Property and CSSMetaData --- .../java/org/fxmisc/richtext/GenericStyledArea.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java index d463571c0..218f1ed37 100644 --- a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java +++ b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java @@ -313,12 +313,6 @@ public class GenericStyledArea extends Region * * * ********************************************************************** */ - /** - * Background fill for highlighted text. - */ - private final StyleableObjectProperty highlightFill - = new CustomStyleableProperty<>(Color.DODGERBLUE, "highlightFill", this, HIGHLIGHT_FILL); - /** * Text color for highlighted text. */ @@ -1571,10 +1565,6 @@ private void suspendVisibleParsWhile(Runnable runnable) { * * * ********************************************************************** */ - private static final CssMetaData, Paint> HIGHLIGHT_FILL = new CustomCssMetaData<>( - "-fx-highlight-fill", StyleConverter.getPaintConverter(), Color.DODGERBLUE, s -> s.highlightFill - ); - private static final CssMetaData, Paint> HIGHLIGHT_TEXT_FILL = new CustomCssMetaData<>( "-fx-highlight-text-fill", StyleConverter.getPaintConverter(), Color.WHITE, s -> s.highlightTextFill ); @@ -1584,7 +1574,6 @@ private void suspendVisibleParsWhile(Runnable runnable) { static { List> styleables = new ArrayList<>(Region.getClassCssMetaData()); - styleables.add(HIGHLIGHT_FILL); styleables.add(HIGHLIGHT_TEXT_FILL); CSS_META_DATA_LIST = Collections.unmodifiableList(styleables); From 15f9122b55d70cead0258bb7f16e607d18a9f09d Mon Sep 17 00:00:00 2001 From: Jurgen Date: Wed, 21 Aug 2019 16:12:35 +0200 Subject: [PATCH 3/3] Added missing CSS highlight linkup in SelectionPath --- .../src/main/java/org/fxmisc/richtext/SelectionPath.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/SelectionPath.java b/richtextfx/src/main/java/org/fxmisc/richtext/SelectionPath.java index b4a05433d..8fe459879 100644 --- a/richtextfx/src/main/java/org/fxmisc/richtext/SelectionPath.java +++ b/richtextfx/src/main/java/org/fxmisc/richtext/SelectionPath.java @@ -37,6 +37,9 @@ public class SelectionPath extends Path { SelectionPath(Val range) { setManaged(false); this.range = range; + highlightFill.addListener( (ob,ov,nv) -> setFill( nv ) ); + setFill( getHighlightFill() ); + setStrokeWidth( 0.0 ); } @Override