Print at Dec 15, 2025, 5:19:10 PM

Posted by byDMA at Jun 14, 2024, 9:52:19 PM
Re: Dark Mode | name of the components
Hi Keet,
Thank you for your interest! I like to share the files. First for testing. Small corrections are still necessary and I hope that someone will test it and make suggestions for improvement.
There are 3 files in this compressed file:

https://disk.yandex.ru/d/n85Oi_gPPyITgQ

1. SweetHome3D-7.4.jar
-> the Icons for the Dark theme are inside

2. plugins_dark.zip
-> all available plugins with the NEW icons, matching the design

3. flatlaf-3.4.1.jar -> swing-engine, with property files, the settings for the Dark theme are also already in this library.


You are an advanced user, so I don't have to explain everything in detail. Nevertheless, I have to make a few hints.
Before you start, you should consider which environment and which monitors you have, because that is necessary for the correct configuration of the interface.
I describe how I did it and then we can see how you have to adjust it when it's not working.

My situation:
- Linux (open SuSE) with KDE, java -> Oracle (21,22 both ok)
- 2 Monitors with the Resolution 2560x1440
- Fonts (very important!) Droid Sans
- this is what my startup script looks like on Linux:

#!/bin/sh

# source the jpackage helpers
VERBOSE=1
. /usr/share/java-utils/java-functions

# set JAVA_* environment variables
set_javacmd
check_java_env
set_jvm_dirs
set_options "--add-opens=java.desktop/sun.awt=ALL-UNNAMED" "-Djava.library.path=/usr/lib64:/usr/lib" "-Dcom.eteks.sweethome3d.resolutionScale=2" "-Dswing.defaultlaf=com.formdev.flatlaf.FlatDarkLaf" "-Dflatlaf.updateUIOn­SystemFontChange = false" "-Dflatlaf.uiScale.allowScaleDown=true" "-Dcom.eteks.sweethome3d.j3d.PhotoRenderer.highQuality.shininessShader=glossy" "-Dcom.eteks.sweethome3d.singleInstance=false"

#"-Dflatlaf.uiScale.allowScaleDown=true" "-Dflatlaf.uiScale=0.8"
#"-Dcom.eteks.sweethome3d.resolutionScale=2"

CLASSPATH=`build-classpath SweetHome3D java-3d`
MAIN_CLASS="com.eteks.sweethome3d.SweetHome3D"

# add some extra catalogs if they exist
mkdir -p $HOME/.eteks/sweethome3d/furniture
for model in `find "/usr/share/SweetHome3D" -type f -name "*.sh3f"`; do
ln -sf ${model} $HOME/.eteks/sweethome3d/furniture
done

mkdir -p $HOME/.eteks/sweethome3d/textures
for texture in `find "/usr/share/SweetHome3D" -type f -name "*.sh3t"`; do
ln -sf ${texture} $HOME/.eteks/sweethome3d/textures
done

run



As you can see, I start in the scaling mode (factor 2x), because the plugin Icons in the toolbar were not scaled (must be clear why). SO the icons are now displayed correctly. All in the resolution 32x32 pixels, as in the files *@2x.png.
With the 2x scaling, ALL components are scaled in the swing, including the font sizes.
And that was the biggest problem now. It was necessary to adjust the font sizes of ALL components. I have already configured the colors for another application earlier.
It is important to understand that the font size setting in FlatLaf depends on the operating system (Mac, Linux, WIndows), the size and resolution of the monitor and, last but not least, on personal preferences.
Unfortunately, you can't do this via the program's interface, but you can manually adjust the properties file in the Flatlaf library.
You must edit and repack FlatDarkLaf.properties.

Important configuration:

#---- typography / fonts ----

defaultFont = 11 "Droid Sans", "Open Sans", "Noto Sans", Roboto, Arial

# SH3D scaling 2x -> we make the fonts smaller after scaling

@scaledFont = 7
@scaledFontPlus = 8
@scaledFontMinus = 6


Try it with your system and let me know how it looks, then I'll give you recommendations on how to adjust the font scaling.