-
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
"-fx-highlight-text-fill" CSS doesn't work due to JDK bug #303
Comments
@radicaled Looking at the source code here, that's something else that needs to be fixed :-/ |
I've updated the CSS Guide with a note that highlighting doesn't currently work. |
Thanks for looking into it! I'll... figure something out until this gets fixed. |
The order of styles is already applied in this order:
The "selection style," if you will, overrides only the background and foreground of the text; all other style-related items (font, font size, weight, etc.) are not overridden. So, here's one way we could implement this:
So, given the following example where angle brackets represent the selection: There would be 5 Text objects:
However, you'll notice that in the source code, the Text objects are only created once, not every time |
@radicaled Why not consider fixing the issue? It might save you more time overall anyways. |
My JavaFX skills are pretty poor: I'm coming back to Java (via Kotlin, actually) after a long, long absence -- since before JavaFX was a thing. I actually did have a look at the source code you referenced earlier, but couldn't identify the root problem based on the comment, nor a potential solution. Basically I don't know enough about RichTextFX and JavaFX yet to properly fix it. |
Well, we can't do much about JavaFX, but I hear you about RichTextFX. I've only become more familiar with it due to all the PRs I've submitted in the past couple of months. Before that, it was just code that magically did what I needed 😀 However, I wonder if others have had a similar issue: wanting to contribute, but finding that getting familiar with the project takes too much time. |
A high level overview might be useful, and live longer. For instance, the StyleSpan(s) API feels pretty awkward, but it looks to be that way for performance reasons, so any augmentations or changes to that API would have to be made carefully, I think. Knowing "why" can almost be as helpful as "how" in those circumstances. |
hello, have you any information about this issue ? It doesn't work on 0.7M-2 |
Any updates on that? |
Unfortunately the mentioned pull request #398 does not fix |
@eckig No, #398 it does not fix I tried to fix For Markdown Writer FX I'm going to workaround the problem with the unreadable selected text with a brighter background selection color: .styled-text-area {
-fx-highlight-fill: derive(#1E90FF, 100%);
} |
…FXMisc#303) instead of using Text.selectionFillProperty(), which does not work correctly, this workaround splits segments at selection bounds and uses Text.fillProperty() to assign text color (e.g. white) to selected text
Did this change fixing /* 1 */
.styled-text-area .text { -fx-highlight-fill: #999999; }
/* 2 */
.styled-text-area .selection { -fx-fill: #999999; }
/* 3 */
.styled-text-area { -fx-highlight-fill: #999999; } Other CSS in this file is being applied, so I'm sure it's a re-appearance of this issue. |
The last time this worked was in version |
Fixed highlight fill not working with PR #844 |
Sorry for yet another issue, but...
I'm on 1.0.0-SNAPSHOT and it seems that setting
-fx-highlight-fill
and-fx-highlight-text-fill
aren't working as expected. I'm following the instructions here: https://github.com/TomasMikula/RichTextFX/wiki/Styling-RichTextFX-and-a-CSS-Cheat-Sheet#cheat-sheetThe bottom part of the attached image is from a StyleClassedTextArea. You can see that the text is being styled correctly (it's got a class of "header"), but the highlight CSS isn't.
The text was updated successfully, but these errors were encountered: