Skip to content

Commit

Permalink
Fix custom fold CSS not being applied (#1000)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen committed Jan 27, 2021
1 parent b813861 commit 4cc49c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import javafx.scene.paint.Paint;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;

import org.reactfx.collection.LiveList;
import org.reactfx.value.Val;
Expand All @@ -29,10 +30,9 @@ public class LineNumberFactory<PS> implements IntFunction<Node> {

private static final Insets DEFAULT_INSETS = new Insets(0.0, 5.0, 0.0, 5.0);
private static final Paint DEFAULT_TEXT_FILL = Color.web("#666");
private static final Font DEFAULT_FONT =
Font.font("monospace", FontPosture.ITALIC, 13);
private static final Background DEFAULT_BACKGROUND =
new Background(new BackgroundFill(Color.web("#ddd"), null, null));
private static final Font DEFAULT_FONT = Font.font("monospace", FontPosture.ITALIC, 13);
private static final Font DEFAULT_FOLD_FONT = Font.font("monospace", FontWeight.BOLD, 13);
private static final Background DEFAULT_BACKGROUND = new Background(new BackgroundFill(Color.web("#ddd"), null, null));

public static IntFunction<Node> get(GenericStyledArea<?, ?, ?> area) {
return get(area, digits -> "%1$" + digits + "s");
Expand Down Expand Up @@ -113,7 +113,8 @@ public Node apply(int idx) {
if ( isFoldedCheck != null )
{
Label foldIndicator = new Label( " " );
foldIndicator.setTextFill( DEFAULT_TEXT_FILL ); // Prevents CSS errors
foldIndicator.setTextFill( Color.BLUE ); // Prevents CSS errors
foldIndicator.setFont( DEFAULT_FOLD_FONT );

lineNo.setContentDisplay( ContentDisplay.RIGHT );
lineNo.setGraphic( foldIndicator );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,3 @@

/* For folding/hiding paragraphs. It's applied to TextFlow. */
.collapse { visibility: collapse; }

/* For LineNumberFactory, it's applied to Label. */
.fold-indicator {
-fx-font-weight: bold;
-fx-text-fill: blue;
}

0 comments on commit 4cc49c3

Please sign in to comment.