From ae1bbad84fa4e69a2577153df20f92b924119d1a Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Mon, 24 Mar 2025 19:34:42 +0100 Subject: [PATCH 1/2] Visual fixes for Linux --- app/src/processing/app/platform/LinuxPlatform.java | 5 +++++ app/src/processing/app/ui/Editor.java | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/processing/app/platform/LinuxPlatform.java b/app/src/processing/app/platform/LinuxPlatform.java index be164d701..3426144ca 100644 --- a/app/src/processing/app/platform/LinuxPlatform.java +++ b/app/src/processing/app/platform/LinuxPlatform.java @@ -31,6 +31,8 @@ import processing.app.Preferences; import processing.core.PApplet; +import javax.swing.*; + public class LinuxPlatform extends DefaultPlatform { String homeDir; @@ -39,6 +41,9 @@ public class LinuxPlatform extends DefaultPlatform { public void initBase(Base base) { super.initBase(base); + JFrame.setDefaultLookAndFeelDecorated(true); + System.setProperty("flatlaf.menuBarEmbedded", "true"); + // Set X11 WM_CLASS property which is used as the application // name by Gnome 3 and other window managers. // https://github.com/processing/processing/issues/2534 diff --git a/app/src/processing/app/ui/Editor.java b/app/src/processing/app/ui/Editor.java index c3dd0202f..d7bbb05c8 100644 --- a/app/src/processing/app/ui/Editor.java +++ b/app/src/processing/app/ui/Editor.java @@ -618,12 +618,10 @@ public void updateTheme() { toolTipWarningColor = Theme.get("errors.selection.warning.bgcolor"); toolTipErrorColor = Theme.get("errors.selection.error.bgcolor"); - if(Platform.isWindows()) { - UIManager.put("RootPane.background", color); - UIManager.put("TitlePane.embeddedForeground", Theme.getColor("editor.fgcolor")); - getRootPane().updateUI(); - UIManager.put("RootPane.background", null); - } + UIManager.put("RootPane.background", color); + UIManager.put("TitlePane.embeddedForeground", Theme.getColor("editor.fgcolor")); + getRootPane().updateUI(); + UIManager.put("RootPane.background", null); JPopupMenu popup = modePopup.getPopupMenu(); // Cannot use instanceof because com.formdev.flatlaf.ui.FlatPopupMenuBorder From 8ee71272260e1b311f7d2c50ae1946037ccb8b9d Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Mon, 24 Mar 2025 23:08:12 +0100 Subject: [PATCH 2/2] Fixed incorrect inactive titlebar color for Windows & Linux --- .../processing/app/laf/FlatLaf.properties | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/src/main/resources/processing/app/laf/FlatLaf.properties diff --git a/app/src/main/resources/processing/app/laf/FlatLaf.properties b/app/src/main/resources/processing/app/laf/FlatLaf.properties new file mode 100644 index 000000000..70e082912 --- /dev/null +++ b/app/src/main/resources/processing/app/laf/FlatLaf.properties @@ -0,0 +1,23 @@ +# The default is 8, which creates tiny nubby scroll bars +ScrollBar.width = 16 + +TitlePane.inactiveForeground = #000000 + + +# Better matched for macOS dark mode (but using everywhere) +# https://github.com/JFormDesigner/FlatLaf/issues/497 + +[dark]@background = #1e1e1e +[dark]@foreground = #e0e0e0 +[dark]@accentColor = #107aff +[dark]@accentFocusColor = #176896 + +[dark]Component.arrowType = chevron + +[dark]CheckBox.icon.style = filled +[dark]CheckBox.icon[filled].selectedBorderColor = @accentColor +[dark]CheckBox.icon[filled].selectedBackground = @accentColor +[dark]CheckBox.icon[filled].checkmarkColor = @foreground + +[dark]RadioButton.icon.style = filled +[dark]RadioButton.icon[filled].centerDiameter = 6