Re: [Graymail] Re: [Graymail] Re: Dark L&F and Notifications
Tim Boudreau <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <CA+qecRPOxgZibfQF_k7RduTRVD3A6BxEARScUaWmXuTu8gL6pw@mail.gmail.com> |
FWIW, yet another dark look and feel theme - a fork of my own old code in contrib/tanui - it loads Metal L&F, munges the contents of UIDefaults, installs and selects dark editor themes and a few other things. http://timboudreau.com/files/com-timboudreau-strangeflavorchicken.nbm Used in combination with these netbeans.conf settings, it does well with high-dpi displays: -J-Dsun.java2d.dpiaware=true -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd -J-Dorg.netbeans.editor.aa.extra.hints=true It expects the following fonts to be installed (I've tried embedding them, but the results were disastrous - referencing embedded fonts indirectly by name fails in nasty ways): http://www.dafont.com/monofur.font http://www.dafont.com/b20-sans.font Happy to share the code if anyone's interested. Screen shot: https://timboudreau.com/files/screen/212ae7c4-fb38-41b6-85ac-1591fac5b523.png -Tim On Tue, Feb 2, 2016 at 12:29 PM, Ingleby, Graeme <[email protected]> wrote: > Sorry my first test used a null action and I noticed it did support html > tags but you are correct the API does state they get escaped when there is > an Action. > > > > If you can’t modify the default HTMLEditorKit colors the only other > solution is to have NotificationImpl.java changed. > > > > Have you seen this? https://netbeans.org/bugzilla/show_bug.cgi?id=246199 > > > > Looks like there is already a proposed patch available on main-silver. > > > > -Graeme > > > > > > > > *From:* Peter Hansson [mailto:[email protected]] > *Sent:* Tuesday, February 02, 2016 11:17 AM > *To:* [email protected] > *Subject:* [Graymail] [platform-dev] Re: [Graymail] Re: Dark L&F and > Notifications > > > > Graeme, yep, that is spot on. > I already thought of that solution but as you point it it will affect much > more than just Notifications. > > As for wrapping the text in html tags: Yes, wouldn't that be nice if it > was possible, but unfortunately any type of html tags in the text will be > escaped. This is also documented in the official Javadoc for > NotificationDisplayer. > > > > On Tue, Feb 2, 2016 at 4:57 PM, Ingleby, Graeme <[email protected]> > wrote: > > The text displayed isn’t impacted by the “btn.setForeground(Color.blue); > “ because the notification text is wrapped by <html><u></u></html>. > > > > It’s using the default HTML editor colors. > > > > You could install a module with a ModuleInstaller that changes the default > colors. > > > > public class Installer extends ModuleInstall { > > > > @Override > > public void restored() { > > HTMLEditorKit kit = new HTMLEditorKit(); > > StyleSheet styleSheet = kit.getStyleSheet(); > > styleSheet.addRule("u {color:#ff0000;}"); > > > > } > > } > > > > This makes all my notifications appear in red! > > > > Note however you are changing the default colors for HTMLEditorKit so this > could impact other HTML content and not just the Notification Balloon! > > Also – if notification text is wrapped in HTML tags with custom > styles/colors set they will display in the style/color requested they won’t > be impacted by this mod. > > > > > > > > *From:* Peter Hansson [mailto:[email protected]] > *Sent:* Tuesday, February 02, 2016 10:13 AM > *To:* [email protected]; [email protected] > *Subject:* [Graymail] [platform-dev] Re: Dark L&F and Notifications > > > > Well, can we get back to the original problem, please, in case someone > knows the answer or has a suggestion. > > To prove that the problem ALSO exist in Darcula I've attached a screenshot > of a minimal RCP application, using Darcula L&F, which does nothing more > than display a notification. > > But again, my question isn't about Darcula per se, but about dark'ish L&Fs > in general. However it was kinda nice to verify that Darcula hasn't solved > the problem either. > > Peter > > > > > > On Tue, Feb 2, 2016 at 3:38 PM, geertjan wielenga < > [email protected]> wrote: > > > Nope, it's on 8.1, has just been released in the past day or so again in > version 1.4. > > Any questions, you can direct them not here but to its author Hamit: > [email protected] > > You can right again here, though it won't help -- write to the author of > the plugin. > > Thanks, > > Gj > > > > On 2-2-2016 15:08, Peter Hansson wrote: > > I've just tried Darcula on my application and it has (as expected) exactly > the same challenge. The blue text on a dark background is more or less > impossible to read. > > BTW: Darcula plugin for Netbeans is still on NB80, not NB81. This doesn't > mean that it will not work in a NB IDE 8.1 but it isn't a smooth sail. I'm > trying to upgrade it to NB 8.1. > > Using the plugin with an RCP application as opposed =o the IDE isn't as > simple as I hoped. The reason is some dependencies on Editor Color (for the > use of Themes I suppose) and this is just not available to normal RCP app. > > > > On Tue, Feb 2, 2016 at 1:55 PM, geertjan wielenga < > [email protected]> wrote: > > > On 2-2-2016 13:40, Peter Hansson wrote: > > > In my RCP application I'm working with a dark L&F. Seems so popular these > days. > > > I advise you to try the Darcula look and feel instead: > > http://plugins.netbeans.org/plugin/62424/darcula-laf-for-netbeans > > Gj > > > > > The problem I have is with the standard Notifications, the little things > in the lower right hand of the main frame that comes up as a balloon > notification: The clickable text is just too hard (if not impossible) to > read on a dark background because it is hardcoded to Color.BLUE. > > I'm thinking that all implementers of a dark'ish L&F must have come across > this. > > The problem is with NotificationImpl in core.ui. If you look into the > source you'll see that the clickable text isn't actually a link but is > simply some underlined text (<html><u>) inside a JButton and then the > implementation does : > > btn.setForeground(Color.blue); > > Ouch! > > So the color is hardcoded. > > How to solve ? > > Thanks > > Peter > > > > > > > > > > > -- http://timboudreau.com