User-configurable colors for plugin toolwindow

Answered

Hi, guys,

I have a plugin with tool window, and I want user to have ability to change colors of it. In other words, I want to add section with colors under "Settings / Editor / Color Scheme" so user may change it.

I've have read Platform SDK about themes https://jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_intro.html - doesn't help

I've created test plugin like here https://github.com/JetBrains/intellij-sdk-docs/tree/master/code_samples/theme_basics - it doesn't have configurable colors either (only hardcoded)

Please, show me some directions :)

 

2 comments
Comment actions Permalink

If you want user to be able to customize colors via Theme plugin, then your plugin must expose metadata for your specific keys: https://jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_metadata.html

 

To expose colors directly in UI for customization by user, use com.intellij.openapi.options.colors.ColorAndFontDescriptorsProvider / com.intellij.openapi.options.colors.ColorSettingsPage. Please note, that settings in "Settings / Editor / Color Scheme" should be used for text/output-related customization only, not for customizing UI elements (use Theme keys from above). See com.intellij.openapi.vcs.actions.VcsColorsPageFactory from Preferences | Editor | Color Scheme | VCS for a "custom" settings page that is not bound to "real" editor.

1
Comment actions Permalink

Thanks a lot,

It seems to be a right example

0

Please sign in to leave a comment.