Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeArea's caret blink rate is too quick #203

Closed
hwaite opened this issue Nov 2, 2015 · 2 comments
Closed

CodeArea's caret blink rate is too quick #203

hwaite opened this issue Nov 2, 2015 · 2 comments

Comments

@hwaite
Copy link

hwaite commented Nov 2, 2015

CodeArea's default caret blink rate should match standard JavaFX text controls. Probably needs to be slowed down by about 25%.

public class Test extends Application {
    public static void main(String[] args) {launch(args);}

    public void start(Stage pStage) {
        pStage.setTitle("Test");

        final Pane root = new VBox();

        root.getChildren().addAll(
            new CodeArea(), new TextArea(), new TextField()
        );

        pStage.setScene(new Scene(root, 300, 250));
        pStage.show();
    }
}
@TomasMikula
Copy link
Member

Can you find out what the TextArea's frequency is? RichTextFX's is 500ms.

@hwaite
Copy link
Author

hwaite commented Nov 2, 2015

System.out.println((new JTextArea()).getCaret().getBlinkRate()) returns 0.5. Also, TextInputControlSkin.CaretBlinking includes below snippet:

caretTimeline.getKeyFrames().addAll(
    new KeyFrame(Duration.ZERO,
            event -> {
                setBlink(false);
            }
    ),
    new KeyFrame(Duration.seconds(.5),
            event -> {
                setBlink(true);
            }
    ),
    new KeyFrame(Duration.seconds(1)));

Looks like I'm mistaken: 0.5 is the correct rate. Sorry about that; I'll close this bug.

@hwaite hwaite closed this as completed Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants