-
Notifications
You must be signed in to change notification settings - Fork 236
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
fixed -fx-highlight-fill and -fx-caret-blink-rate (issue #303) #398
fixed -fx-highlight-fill and -fx-caret-blink-rate (issue #303) #398
Conversation
What is this supposed to do? |
@JordanMartinez Fixing issue #303 ? |
@JFormDesigner & @kuc Thanks for the clarification. At the same time, how does this fix that issue? Because my original reply to that issue showed that it was a coding issue and I don't see how creating a list of CSS Metadata helps. (I'm not as familiar with CSS as I should be.) |
@JordanMartinez |
BTW this PR does not fix |
@JFormDesigner Ah! Ok. I was confused because I felt like the code you implemented would only do something if |
c882a36
to
e58dcaa
Compare
updated (and tested) to current master branch |
@JFormDesigner Could you post the code you used to test this? I checked on my side and the background color of the selection did not change to After updating .styled-text-area .virtual-flow {
-fx-cursor: text;
-fx-highlight-fill: red;
-fx-blink-caret-rate: 100ms;
-fx-font-size: 32pt;
} and fixing the import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.fxmisc.flowless.VirtualizedScrollPane;
import org.fxmisc.richtext.StyleClassedTextArea;
import org.fxmisc.richtext.StyledTextArea;
import java.util.Collection;
import java.util.Collections;
public class CssTest extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
StyledTextArea<String, Collection<String>> area = new StyledTextArea<String, Collection<String>>("", (a, b) -> {},
Collections.emptyList(), (a, b) -> a.getStyleClass().addAll(b));
area.replaceText("Some text in the area");
VirtualizedScrollPane<StyledTextArea<String, Collection<String>>> vsPane = new VirtualizedScrollPane<>(area);
Scene scene = new Scene(vsPane, 500, 500);
primaryStage.setScene(scene);
primaryStage.show();
}
} System:
|
e58dcaa
to
f110534
Compare
@JordanMartinez it works without .styled-text-area {
-fx-highlight-fill: red;
-fx-caret-blink-rate: 100ms;
} BTW I've rebased the PR to current master; this PR also fixes #426 |
In Markdown Writer FX I use a brighter color, which makes selected text better readable but still identifiable as selection: .styled-text-area {
-fx-highlight-fill: derive(#1E90FF, 50%);
} Maybe you could consider adding this to The optimal solution would be changing selected text color ( |
Ah, ok! Could you also add a commit that updates the I'm not sure if there would need to be another area later in that file that writes something like... .virtual-flow {
-fx-cursor: text;
} |
Sure. Done. |
Great! Thanks for your work and patience. |
@JFormDesigner I didn't say beforehand, but I like the default color you use when selecting a text as you mentioned in your above comment. What if you submitted a PR that updates that in the css file and then update #428 to revert that fix, so that when the JDK bug is fixed, it'll be back to what it was before? |
No description provided.