Skip to content

Visual fixes for Linux #1006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions app/src/main/resources/processing/app/laf/FlatLaf.properties
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions app/src/processing/app/platform/LinuxPlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import processing.app.Preferences;
import processing.core.PApplet;

import javax.swing.*;


public class LinuxPlatform extends DefaultPlatform {
String homeDir;
Expand All @@ -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
Expand Down
10 changes: 4 additions & 6 deletions app/src/processing/app/ui/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down