#1
|
|||
|
|||
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 Code:
defaults write org.jdownloader.launcher NSRequiresAquaSystemAppearance false Code:
<key>NSRequiresAquaSystemAppearance</key> <false/> 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. |
#2
|
|||
|
|||
Any ideas?
|
#3
|
|||
|
|||
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!
|
#4
|
||||
|
||||
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 |
#5
|
|||
|
|||
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 |
#6
|
||||
|
||||
Latest JDownloader Update does this automatically for MacOS Mojave and newer
__________________
JD-Dev & Server-Admin |
#7
|
|||
|
|||
Quote:
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. |
#8
|
|||
|
|||
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> **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 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" ); 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. |
Thread Tools | |
Display Modes | |
|
|