Re: NB 8.2 Issues
Steven Yi <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <CANtcCs7Rin=bAoTMkk38JNtFYMQ+_wVLWUX5cSjC-qZOX59jZw@mail.gmail.com> |
Hi All, I have determined the root cause for my issues. It goes like this: 1. With dark themes, using "nb.dark.theme" = true in the UIManager flags ImageUtilities to attempt to load "image_dark.ext" before loading "image.ext". This behavior did not change with commit 121baf524946. 2. With commit 121baf524946, what did change was that new dark versions of images were added (frame_dark.gif, frame32_dark.gif, frame48_dark.gif, spash_dark.gif). Prior to the commit, if you had just the normal versions of these images in your branding, it would override the versions provided by Netbeans. After the commit, the Netbeans dark versions now have precedence in loading. This means that end users using dark themes are now *required* to rename their branding images as _dark. 3. For the splash screen, two different images are used. First is a static image that is cached from a previous run (splash1) that is displayed using AWT splashscreen. Second is the Splash.java code (splash2). The reason I saw two images --- the Netbeans one and my own --- is that the splash1 is generated and cached. The generation of that image was done at a later time in the loading process once my LAF code set "nb.dark.theme". That would load "splash_dark.gif". However, for splash2, that gets called earlier in the loading process, prior to when "nb.dark.theme" was set. splash2 would then attempt to load "splash.gif", which would use my own splash and not the Netbeans splash.gif. To work around these issues, I did the following: 1. Renamed my frame branding images to use the _dark suffix to fix the setting of the icon for my application. 2. For the splash screen, I now have to have duplicates of the splash image, one as splash.gif and the other as splash_dark.gif. This ensured that both splash1 and splash2 present the same image content. A few questions/comments: 1. Is there a way to set nb.dark.theme in UIManager early enough such that I don't have to package duplicates of the splash image? 2. It seems that any time now a dark version of an image is added to Netbeans platform, end users may will need to update their images to override it if they were previously relying on overriding the non-dark version. It might be nice if image additions could be advertised as part of the ChangeLog as a heads-up. 3. The branding dialog within Netbeans does not account for _dark images for frame icons or splash, and only presents users the non-dark versions (or defaults). This dialog should probably be updated to work with dark themes. Until then, users should manually deal with dark versions of images within branding/core/core.jar/org/netbeans/core/startup. (At least, for ant-based projects; I am not sure if anything is necessary for maven-based projects.) That took a while to sort out, but I think it explains the situation and things are now working here as I expected. Thanks! steven On Wed, Oct 5, 2016 at 9:29 AM, Steven Yi <[email protected]> wrote: > Hi Benno, > > My apologies, I *do* set nb.dark.theme to true. (UGH) The breakpoint > for isDarkLaf() didn't hit during the initial splash though as my LAF > doesn't seem to get to set the value before that shows. It did hit > once I went to show the About screen. I need to run but I will try > out creating image_dark_branding.gif for the frame icons and splash. > I'll report back results shortly. > > Thanks! > steven > > On Wed, Oct 5, 2016 at 9:04 AM, Steven Yi <[email protected]> wrote: >> Hi Benno, >> >> Thanks for the reply. My images are named the same as they have >> always been and for which they worked in previous platforms. If >> something changed that requires new image names I'd consider this a >> regression. >> >> However, my theme, while dark in nature, does not come up as a dark >> look and feel (I don't set "nb.dark.theme"). Setting breakpoints in >> Splash and ImageUtilities confirms that those code paths for dark >> image loading are not used. >> >> An interesting point is that the image I am seeing for the splash and >> about screen is precisely the one shown in that wiki link. >> >> It would be simpler if the problem was that I only saw one image (the >> dev one), but what I'm seeing is the dev one first appear, then my own >> image, on startup. For the about screen, I only see the dev image. >> >> I do see something interesting: in org.netbeans.core.startup.Splash, there is: >> >> if (!s.exists("splash.png")) { >> s.scheduleSave(this, "splash.png", false); >> } >> >> Looking in my test user directory, in the cache is indeed a splash.png >> with the dev image. >> >> I looked through the commit >> (http://hg.netbeans.org/main-silver/rev/121baf524946) but nothing >> there seems like it would cause this behavior. >> >> I also checked that the contents of the core_{BRANDING}.jar contains >> my images and it does, which hints to me that the build process is >> working alright. >> >> >> On Wed, Oct 5, 2016 at 2:11 AM, benno.markiewicz >> <[email protected]> wrote: >>> Steven, check http://wiki.netbeans.org/DevFaqImagesForDarkLaf >>> >>> 1)I contributed a change regarding image loading for dark lafs in 8.2. Perhaps your icons are not properly named... >>> 2) Check the sources of NB. There won't be so much splashscreen images. In worst case, brand the unwanted one also. Den 5 okt. 2016 1:19 fm skrev Steven Yi <[email protected]>: >>>> >>>> Hi All, >>>> >>>> I updated to NB 8.2 just now and gave my Ant-based platform >>>> application a try on it. I'm seeing two issues at the moment: >>>> >>>> 1. The icons for my application (visible in Branding dialog, also >>>> located within branding folder) do not seem to get applied in the >>>> build. (Cleaning and rebuilding with 8.1 does work fine.) >>>> >>>> 2. When I go to run the application within the IDE, for the splash >>>> screen, I first see a Netbeans IDE image that says "Netbeans Platform >>>> Development Version" appear, then as the progress occurs on load, my >>>> own splash screen image appears with the progress bar. >>>> >>>> Both issues exhibit themselves when I generate a release build and >>>> execute the release version of the application. >>>> >>>> Are others seeing these behaviors too? >>>> >>>> steven