Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 20
Posts: 20   Pages: 2   [ Previous Page | 1 2 ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 1835 times and has 19 replies Next Thread
shadowcaster
Newbie



United States
Joined: Jun 5, 2024
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

Hello Daniels,

Thanks for replying. I tried running those commands, but the result is still the same.

This was the initial result:

PS C:\Program Files\Sweet Home 3D\lib> set SH3DINST="C:\Program Files\Sweet Home 3D"
PS C:\Program Files\Sweet Home 3D\lib> "%SH3DINST%\runtime\bin\javaw.exe" -Dswing.defaultlaf=com.formdev.flatlaf.FlatDarkLaf "-Djava.library.path=%SH3DINST%\lib\java3d-1.6\;%SH3DINST%\lib\yafaray;%SH3DINST%\lib\yafaray\yafaray-plugins" -classpath "%SH3DINST%\lib\java3d-1.6\*;%SH3DINST%\lib\*" com.eteks.sweethome3d.SweetHome3D
At line:1 char:36
+ "%SH3DINST%\runtime\bin\javaw.exe" -Dswing.defaultlaf=com.formdev.fla ...
+ ~~~~~~~
Unexpected token '-Dswing' in expression or statement.
At line:1 char:43
+ ... javaw.exe" -Dswing.defaultlaf=com.formdev.flatlaf.FlatDarkLaf "-Djava ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '.defaultlaf=com.formdev.flatlaf.FlatDarkLaf' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken


However, with some chatgpt help I ended up with:

PS C:\Program Files\Sweet Home 3D\lib> $env:SH3DINST="C:\Program Files\Sweet Home 3D"
PS C:\Program Files\Sweet Home 3D\lib> & "$env:SH3DINST\runtime\bin\javaw.exe" -Dswing.defaultlaf=com.formdev.flatlaf.FlatDarkLaf "-Djava.library.path=$env:SH3DINST\lib\java3d-1.6;$env:SH3DINST\lib\yafaray;$env:SH3DINST\lib\yafaray\yafaray-plugins" -classpath "$env:SH3DINST\lib\java3d-1.6\*;$env:SH3DINST\lib\*" com.eteks.sweethome3d.SweetHome3D
PS C:\Program Files\Sweet Home 3D\lib>


I tried running this from both inside the sweet home 3d\lib folder and just from C:\. Either way, the end result was running the java -jar command with -dswing again but still not seeing any changes.


I did come across another post regarding changing resolution that stated to add an ini file with:

-Dcom.eteks.sweethome3d.resolutionScale=1.5
-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel
-Dswing.plaf.metal.controlFont=Dialog-11
-Dswing.plaf.metal.userFont=SansSerif-11
-Dswing.plaf.metal.systemFont=SansSerif-11


and this did work to change the LAF. However, I couldn't figure out how to make flatlaf work in this same way. Note that I did test the above code without this ini file in the sweet home folder to ensure there wasn't a conflict.
[Jun 5, 2024, 11:33:50 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Daniels118
Advanced Member
Member's Avatar

Italy
Joined: Nov 17, 2021
Post Count: 415
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

Please retry my commands from a normal cmd, not powershell.
[Jun 6, 2024, 6:55:43 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9253
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

Maybe you should use quotes also around "-Dswing.defaultlaf=com.formdev.flatlaf.FlatDarkLaf"
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Jun 6, 2024, 8:32:52 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
shadowcaster
Newbie



United States
Joined: Jun 5, 2024
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

Thank you Daniels! I had tried cmd yesterday but got an error. I see now it was because I added quotes around the file path in the set command thinking it wouldn't properly read the spaces.

Thanks so much for the help! My eyes will be forever grateful :)
[Jun 6, 2024, 5:03:48 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
byDMA
Newbie
Member's Avatar

GERMANY | POLAND
Joined: Jun 8, 2024
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

Thank you for the information about the flatlaf. I have now implemented it and adapted many things. It looks like KDE. Really great! But dark-mode is not all you need. You still need icons for the dark interface, otherwise you won't see ANYTHING if the icons are dark. And this is often the case. This is exactly how you need to prepare the icons for plugins. I have done all this and it really looks "round". However, I still have a problem: The icons from the plugins are ALWAYS scaled with 16 pixels in the menus, although I have generated them from vector graphics with 32 pixels. In dialogs of plugins, other icons are displayed correctly and in a large size. Does anyone have any idea what it could be?
If someone wants, I can send the icons and flatlaf properties.

https://disk.yandex.com/d/SVPgWiB7ORwsSQ
[Jun 8, 2024, 9:09:26 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9253
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

Very nice work byDMA! And you even prepared a new icon set! The existing ones in reverse video didn't please you? Anyway, I hope at least that the SVG existing ones helped you to prepare the new set faster.
It could be possible that 32x32 icons in plug-ins are ignored because they are accessed from plug-in class loader, and FlatLaf needs more information to find it (this would probably require some modifications in Sweet Home 3D or FlatLaf source code).
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Jun 9, 2024, 10:22:37 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
byDMA
Newbie
Member's Avatar

GERMANY | POLAND
Joined: Jun 8, 2024
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

Hi Emmanuel, thanks for the quick response and for the praise.

The existing ones in reverse video didn't please you?

Which video do you mean?


I've done some more tests and found out the following:
-This has nothing to do with Flatlaf, this is also the case in the old Steel design
- It ONLY works if scaling factor is 2, between 1 and 2 this does not change
- Scaling is really a bad idea at Latlaf, everything is going to be huge

Latlaf (out-the-box) is actually an ideal interface for SH3D, everything is scaled and designed correctly - except for the icons from the plugins :-)

Take a look at this:
https://disk.yandex.com/d/-qCRHNEioo8tbA

I suspect this is the JFrame in the menu(s) for the plugins in SH3D. It frames the icons up to the scaling factor 2. Only then it gets bigger and the icons are enlarged.

Could you check it out? This should not be a big problem. Then the design would be perfect.
[Jun 9, 2024, 6:51:45 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9253
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

By "reverse video", I meant "opposite colors" : white becomes black and black becomes white. The icons proposed in version 6.6 were designed for this purpose.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Jun 9, 2024, 7:46:20 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
byDMA
Newbie
Member's Avatar

GERMANY | POLAND
Joined: Jun 8, 2024
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

The icons proposed in version 6.6 were designed for this purpose.

Do you mean this?
https://m3.material.io/styles/icons/designing-icons

"De gustibus non est disputandum" :-)
Its GTK 20 years ago, but seriously, the users are coming from mac, windows AND linux, and it should be customizable.

It would be best if you could use the icons as SVG files. I know this from JDownloader. Maybe you can take the code quickly?
https://support.jdownloader.org/de/knowledgebase/article/setup-ide-eclipse


white becomes black and black becomes white.

That's how I did it too. With Flatlaf Dark and Light this works in both directions.

But I am interested in the topic for the plugins-icons and jframe for these icons.
[Jun 9, 2024, 9:05:54 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
byDMA
Newbie
Member's Avatar

GERMANY | POLAND
Joined: Jun 8, 2024
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: Dark Mode

I think this is the place where the icons for menus and the toolbar are scaled compulsorily. Why? I suspect because this is an "unknown" source.

ResourceAction.java

https://sourceforge.net/p/sweethome3d/code/HE.../ResourceAction.java#l130


String smallIcon = getOptionalString(preferences, resourceClass, propertyPrefix + SMALL_ICON, false);
if (smallIcon != null) {
putValue(SMALL_ICON, SwingTools.getScaledImageIcon(resourceClass.getResource(smallIcon)));
}

String toolBarIcon = getOptionalString(preferences, resourceClass, propertyPrefix + TOOL_BAR_ICON, false);
if (toolBarIcon != null) {
putValue(TOOL_BAR_ICON, SwingTools.getScaledImageIcon(resourceClass.getResource(toolBarIcon)));
}

[Jun 9, 2024, 10:21:57 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 20   Pages: 2   [ Previous Page | 1 2 ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved