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

-fx-highlight-fill does not work #192

Closed
jmak35 opened this issue Oct 15, 2015 · 6 comments
Closed

-fx-highlight-fill does not work #192

jmak35 opened this issue Oct 15, 2015 · 6 comments

Comments

@jmak35
Copy link

jmak35 commented Oct 15, 2015

HI Tomas,

There's an issue setting text highlights. If you run your ManualHighlighting.java application and change the "blue" class in manual-highlighting.css to apply "-fx-highlight-text-fill: blue" instead like so:

.blue {
    -fx-highlight-text-fill: blue;
}

I've even tried -fx-highlight-fill, yet you'll notice neither will have any effect on the text when you attempt to apply it. Is this normal behaviour?

Thanks.

@TomasMikula
Copy link
Member

It is not normal behavior, but it is a known problem that -fx-highlight-text-fill does not work, since Text#impl_selectionFillProperty() doesn't work properly for Text inside a TextFlow (and it is not public API anyway).

-fx-highlight-fill should work on the whole text area. I don't know if it makes much sense to try to implement it for individual fragments of text. When I select text with different styles, I prefer the highlight to be one color.

@jmak35
Copy link
Author

jmak35 commented Oct 16, 2015

Thanks for the response Tomas. There's definitely a use case for highlighting individual fragments of text.

If you look at the CTRL-F find mechanism within Chrome, it is exactly the kind of function that requires this sort of highlighting. And it is this functionality I'm trying to incorporate into our application using RichTextFX.

Are you saying that it's not possible at all? Or can there be a workaround to get this feature happening?

Thanks.

@TomasMikula
Copy link
Member

I specifically meant the color of the background of selected text—that's what -fx-highlight-fill is (althought the name might be confusing). I would rather it be one color.

You can use -fx-background-fill to get what you want.

@jmak35
Copy link
Author

jmak35 commented Oct 16, 2015

Oh my goodness, I didn't even know that css property existed. Thanks so much for that Tomas, that's fixed my issue.

@jmak35 jmak35 closed this as completed Oct 16, 2015
@TomasMikula
Copy link
Member

It only exists in RichTextFX.

@JordanMartinez
Copy link
Contributor

I'm creating the CSS cheat sheet and I think renaming highlight-fill would be a smart move.

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

3 participants