JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 22.08.2020, 02:16
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default How to get a dark title bar on Mac?

I'm using the "FLATLAF_DARK" theme + customized colors, on macOS 14 Mojave in dark mode. It works ok but the main titlebar of the window is not dark. Is there a way to do that?

In the github page of "JDownloader-2-Dark-Theme" by Vinylwalk3r (**External links are only visible to Support Staff****External links are only visible to Support Staff**), there is a screenshot of JDownloader2 with a dark title bar, exactly what I want, and instructions to run this command to get it:

Code:
defaults write org.jdownloader.launcher NSRequiresAquaSystemAppearance 0
But I can't get that to work, and there's an unanswered bug report there that it doesn't work, since May. I also tried:

Code:
defaults write org.jdownloader.launcher NSRequiresAquaSystemAppearance false
and after reading Apple's developer note here: **External links are only visible to Support Staff****External links are only visible to Support Staff** putting this into the info.plist of the JDownloader2 app bundle:

Code:
<key>NSRequiresAquaSystemAppearance</key>
<false/>
and I also tried doing the whole installation of "JDownloader-2-Dark-Theme". But nothing works.

I did find the "LAFSettings: Window Decoration" setting that gives a custom dark title bar, but that looks very strange on a Mac and is not what I'm looking for.
Reply With Quote
  #2  
Old 11.09.2020, 21:36
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default

Any ideas?
Reply With Quote
  #3  
Old 01.01.2021, 19:27
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default

I tried again adding NSRequiresAquaSystemAppearance false to the info.plist, and this time it worked. Don't know what's different, but I have a nice dark titlebar now!
Reply With Quote
  #4  
Old 04.01.2021, 17:36
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Thanks for the feedback! It should also work fine with manual settings the value via defaults command
I've updated JD to autoset this property with next core update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 09.01.2021, 21:38
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default

I can confirm that the "defaults" command now works, without needing to edit the info.plist file, thanks!

Code:
defaults write org.jdownloader.launcher NSRequiresAquaSystemAppearance 0
Reply With Quote
  #6  
Old 11.01.2021, 17:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Latest JDownloader Update does this automatically for MacOS Mojave and newer
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 24.07.2021, 22:41
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default

Quote:
Originally Posted by sumyungguy View Post
I tried again adding NSRequiresAquaSystemAppearance false to the info.plist, and this time it worked. Don't know what's different, but I have a nice dark titlebar now!
Fyi, now I know what was different: I installed AdoptOpenJDK 8 for something else, and JDownloader started using that. Oracle's JRE/JDK (any version I install) doesn't work, it gives the white titlebar regardless of the setting. Same for Zulu's OpenJDK, it doesn't work either.

On the other hand, I just tried a new install on another machine with Big Sur, and it does get a dark title bar with the bundled JRE. So I don't know what that's about...

Last edited by sumyungguy; 25.07.2021 at 21:39.
Reply With Quote
  #8  
Old 12.03.2023, 14:05
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default

The former solution to use "NSRequiresAquaSystemAppearance 0" is no longer working, and a fresh install of JDownloader again has a white titlebar in macOS dark mode. Another work-around is to add the following in the "VMOptionArray", in the info.plist file of the JDownloader 2 app bundle:

Code:
<string>-Dapple.awt.application.appearance=system</string>
See: [JDK-8235363] [macOS] Dark mode for the desktop is not supported - Java Bug System
**External links are only visible to Support Staff****External links are only visible to Support Staff**

The title bar went back to being white, despite having "NSRequiresAquaSystemAppearance 0", and regardless of whether I use the bundled Java 17, or Temurin/Adpotium Java 19. Not sure when or why that happened, whether there was a change in macOS, JDownloader, or what. This is on the same machine and installation where it was previously dark. I also tried with a freshly-installed JDownloader, which had worked last time (in 2021), but it's no longer working, there is a white title bar only.

Maybe the apple.awt.application.appearance setting could be added to the Info.plist by default, like NSRequiresAquaSystemAppearance 0 was? Or see below for how to do it from within the application's main code. It doesn't work with "defaults write", and editing Info.plist yourself invalidates the code signature of the application, resulting in being asked whether to allow or deny network connections every time JDownloader is started. A work-around for that is to re-sign it yourself. Change directory to whichever folder has the JDownloader2 application (e.g. /Applications/JDownloader 2, depending where you installed it), and do the following:

Code:
sudo codesign --force --sign - --deep JDownloader2.app
Since JDownloader doesn't automatically follow the system light/dark settings for the general theme though, it might possibly cause problems to set apple.awt.application.appearance=system, so that it switches automatically, when people are using JDownloader in its default light theme. Maybe it could be an option in the settings, for people who choose a dark theme? You can also set apple.awt.application.appearance=NSAppearanceNameAqua (light), NSAppearanceNameDarkAqua (dark) or some other options. See:

NSAppearanceNameAqua | Apple Developer Documentation
**External links are only visible to Support Staff****External links are only visible to Support Staff**

The best solution would be for JDownloader to properly support a dark mode theme, and switch automatically according to the macOS system setting. Even now, it's difficult to get a working dark theme, because JDownloader doesn't ship with reasonable default colors for the dark themes, for example by providing JDownloader 2/cfg/laf/FlatDarkLaf.json or other files. Maybe there could be at least one "official" dark theme, with some well-chosen colors? In case it helps anyone, here are the ones I'm using for FlatDarkLaf, not perfect but good enough for me:

Code:
{
  "colorforconfigpaneldescriptiontext" : "#ffcccccc",
  "configlabelenabledtextcolor" : "#ffcccccc",
  "colorforconfigheadertextcolor" : "#ff999999",
  "colorfortablemouseoverrowbackground" : "#8b666666",
  "colorfortablepackagerowbackground" : "#ff2B2B2B",
  "colorfortableselectedrowsbackground" : "#ff666666",
  "colorforscrollbarsnormalstate" : "#ff333333",
  "colorforscrollbarsmouseoverstate" : "#ff999999",
  "colorforspeedmeteraveragetext" : "#ffffffff",
  "colorforpanelbackground" : "#ff1B1B1B",
  "colorforspeedmetertext" : "#ffffffff",
  "colorfortablesortedcolumnview" : "#ff666666",
  "windowdecorationenabled" : false,
  "colorforpanelheaderbackground" : "#ff666666",
  "colorforspeedmeterlimiterbottom" : "#ffffffff",
  "colorforpanelheaderforeground" : "#ff999999"
}

I found a number of bug reports and issues from other places, regarding this. For example:

In the FlatLaf project: **External links are only visible to Support Staff****External links are only visible to Support Staff**

It says you can call this from the main thread of the application:

Code:
System.setProperty( "apple.awt.application.appearance", "system" );
See also:
macos - Java application not using dark title bars even though have implemented NSRequiresAquaSystemAppearance = False - Stack Overflow
**External links are only visible to Support Staff****External links are only visible to Support Staff**

Last edited by sumyungguy; 12.03.2023 at 15:30.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 16:55.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.