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

Background on a text #295

Closed
WinXaito opened this issue Apr 23, 2016 · 4 comments
Closed

Background on a text #295

WinXaito opened this issue Apr 23, 2016 · 4 comments

Comments

@WinXaito
Copy link

Hello,

I managed to shed fat and add a color on a piece of text in my StyleClassedTextArea, but I would love to put a background, but it does not work. Is it possible to do this?

Thank you !

@TomasMikula
Copy link
Member

Yes, it is possible:

.foo {
    -fx-background-fill: #efefef;
}

It is named -fx-background-fill instead of -fx-background-color because of this bug: JDK-8133685.

@WinXaito
Copy link
Author

Thanks ;)

@swpalmer
Copy link

swpalmer commented May 9, 2016

Is it possible to set the background colour for the entire line - such that the colour extends all the way to the edge of the view, even if the text doesn't?
I.e. so we don't get ragged edges on the background for areas of the text like this:
short line<--- background colour ends here
a much longer line<--- background colour ends here

I want to mark the entire line with a different background colour to highlight special cases, like lines with errors, or sections of file that were inserted or removed , commented out sections etc.

@TomasMikula
Copy link
Member

It is possible with the snapshot release, where, in addition to setting style for a range of text, you can set style for the whole paragraph (setParagraphStyle).

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