-
Notifications
You must be signed in to change notification settings - Fork 917
Be able to setup FlatLaf styling for code editor toolbar separately from other toolbars in application #8893
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
base: master
Are you sure you want to change the base?
Conversation
…rom other toolbars in application
|
@mbien @steffendietz @khmarbaise @cstamas can I please ask to review this PR? |
|
NB 28 is branched and in the release phase, a change like this would be for NB 29 and there is no hurry for that. I did see this PR, but didn't have the time to take a proper look. Since ideally things like this would have to be registered in the FlatLaf branding module to keep things decoupled. Also please don't ping so many contributors, not all you pinged are even maintainers. |
|
Did someone mentioned Maven? 👀 |
|
|
||
| // Style editor toolbar separately from main toolbar [style].nb-editor-toolbar = background: #FFFFFF | ||
| putClientProperty("FlatLaf.styleClass", "nb-editor-toolbar"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DevCharly could this be put into o.n.swing.laf.flatlaf somehow? e.g FlatLFCustoms or similar?
neilcsmith-net
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the wrong approach in my opinion. The style class idea is interesting, but adds LaF specific "code" into modules. There is already a UI key for the toolbar border. Other keys like background can be added in a similar way.
eg. https://github.com/apache/netbeans/blob/master/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/LFCustoms.java#L329 and https://github.com/apache/netbeans/blob/master/platform/openide.text/src/org/openide/text/CloneableEditorInitializer.java#L550
|
This particular tweak doesn't seem too bad to me; it's just a hook, albeit FlatLAF-specific, that lets an actual styling change be defined elsewhere. (In my mind, tweaks like these are slightly more acceptable with FlatLAF than with other LAFs because because styling changes going forward are likely to be done by tweaking FlatLAF rather than by swapping in entire new LAFs.) But if there's another way to do it, I don't mind that either! |
Be able to setup FlatFal styling for code editor toolbar separately from other toolbars in application.
Main purpose - provide more flexibility in configuring FlatLaf style for NetBeans.
What this change does - it adds FlatLaf styleClass property for code editor toolbar. This allows to set FlatLaf style for this toolbar separately from other toolbars in the application.
Below are screenshots with example usage of this property. By settings
[style].nb-editor-toolbar = background: #FFFFFFin FlatLaf.properties I can make background for code editor toolbar white while keeping other toolbars unchanged. In combination with other FlatLaf properties e.g.At the moment I can style NetBeans like it is displayed on screenshot except of setting style for code editor toolbar. What I want to achieve in this example is to use white color for "light" LAF only for code editor area including code editor toolbar. While keeping all other panels (see screenshots) light grey.

This PR is not about all these changes you see on screenshot. PR does not change any default look and feel of NetBeans. PR is about to let people to apply their own styles in which editor toolbar can be styled differently from other toolbars in the application.