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

Apply a theme to a RTextArea #491

Open
priand opened this issue Feb 13, 2023 · 0 comments
Open

Apply a theme to a RTextArea #491

priand opened this issue Feb 13, 2023 · 0 comments

Comments

@priand
Copy link

priand commented Feb 13, 2023

Describe the solution you'd like
A theme org.fife.ui.rsyntaxtextarea.Theme can be assigned to a RSyntaxTextArea, but not to a RTextArea. We should be able to apply a subset of the Theme to RTextArea, so we keep all the components consistent from a LaF standpoint.

Are there any workarounds?
Did that in my own code:

	private static void apply(Theme t, RTextArea textArea) {
		Color fg = UIManager.getColor("TextArea.foreground");
		textArea.setForeground(fg);
		textArea.setFont(t.baseFont);
		textArea.setBackground(t.bgColor);
		textArea.setCaretColor(t.caretColor);
		textArea.setSelectedTextColor(t.selectionFG);
		textArea.setSelectionColor(t.selectionBG);
		textArea.setRoundedSelectionEdges(t.selectionRoundedEdges);
		textArea.setCurrentLineHighlightColor(t.currentLineHighlight);
		textArea.setFadeCurrentLineHighlight(t.fadeCurrentLineHighlight);
		textArea.setMarginLineColor(t.marginLineColor);
		textArea.setMarkAllHighlightColor(t.markAllHighlightColor);
	}

It works with FlatLaf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant