Skip to content

Commit b534c26

Browse files
committed
Merge branch 'main' into runner
2 parents d6cb3ee + 2222331 commit b534c26

File tree

7 files changed

+72
-13
lines changed

7 files changed

+72
-13
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ Most activity on Processing’s GitHub happens in _issues_. Issues are GitHub po
1818

1919
To file a new issue, visit the [Issues](https://github.com/processing/processing4/issues) tab on the repository and click `New issue` then select the most appropriate template and follow the included instructions. These templates help maintainers understand and respond to issues faster.
2020

21-
>[!NOTE]
22-
> Before opening a new issue, check our [troubleshooting](https://github.com/processing/processing/wiki/Troubleshooting) page. The answer may already be there.
23-
2421
## Working on the Processing codebase
2522

2623
### Prerequisites
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# The default is 8, which creates tiny nubby scroll bars
2+
ScrollBar.width = 16
3+
4+
TitlePane.inactiveForeground = #000000
5+
6+
7+
# Better matched for macOS dark mode (but using everywhere)
8+
# https://github.com/JFormDesigner/FlatLaf/issues/497
9+
10+
[dark]@background = #1e1e1e
11+
[dark]@foreground = #e0e0e0
12+
[dark]@accentColor = #107aff
13+
[dark]@accentFocusColor = #176896
14+
15+
[dark]Component.arrowType = chevron
16+
17+
[dark]CheckBox.icon.style = filled
18+
[dark]CheckBox.icon[filled].selectedBorderColor = @accentColor
19+
[dark]CheckBox.icon[filled].selectedBackground = @accentColor
20+
[dark]CheckBox.icon[filled].checkmarkColor = @foreground
21+
22+
[dark]RadioButton.icon.style = filled
23+
[dark]RadioButton.icon[filled].centerDiameter = 6

app/src/processing/app/platform/LinuxPlatform.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import processing.app.Preferences;
3232
import processing.core.PApplet;
3333

34+
import javax.swing.*;
35+
3436

3537
public class LinuxPlatform extends DefaultPlatform {
3638
String homeDir;
@@ -39,6 +41,9 @@ public class LinuxPlatform extends DefaultPlatform {
3941
public void initBase(Base base) {
4042
super.initBase(base);
4143

44+
JFrame.setDefaultLookAndFeelDecorated(true);
45+
System.setProperty("flatlaf.menuBarEmbedded", "true");
46+
4247
// Set X11 WM_CLASS property which is used as the application
4348
// name by Gnome 3 and other window managers.
4449
// https://github.com/processing/processing/issues/2534

app/src/processing/app/ui/Editor.java

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ public void actionPerformed(ActionEvent e) {
377377
}
378378
});
379379
}
380+
380381
}
381382

382383

@@ -626,12 +627,10 @@ public void updateTheme() {
626627
toolTipWarningColor = Theme.get("errors.selection.warning.bgcolor");
627628
toolTipErrorColor = Theme.get("errors.selection.error.bgcolor");
628629

629-
if(Platform.isWindows()) {
630-
UIManager.put("RootPane.background", color);
631-
UIManager.put("TitlePane.embeddedForeground", Theme.getColor("editor.fgcolor"));
632-
getRootPane().updateUI();
633-
UIManager.put("RootPane.background", null);
634-
}
630+
UIManager.put("RootPane.background", color);
631+
UIManager.put("TitlePane.embeddedForeground", Theme.getColor("editor.fgcolor"));
632+
getRootPane().updateUI();
633+
UIManager.put("RootPane.background", null);
635634

636635
JPopupMenu popup = modePopup.getPopupMenu();
637636
// Cannot use instanceof because com.formdev.flatlaf.ui.FlatPopupMenuBorder
@@ -822,6 +821,18 @@ protected JMenu buildEditMenu() {
822821
item.addActionListener(e -> handleIndentOutdent(false));
823822
menu.add(item);
824823

824+
item = Toolkit.newJMenuItemExt("menu.edit.increase_font");
825+
item.addActionListener(e -> {
826+
modifyFontSize(true);
827+
});
828+
menu.add(item);
829+
830+
item = Toolkit.newJMenuItemExt("menu.edit.decrease_font");
831+
item.addActionListener(e -> {
832+
modifyFontSize(false);
833+
});
834+
menu.add(item);
835+
825836
menu.addSeparator();
826837

827838
item = Toolkit.newJMenuItem(Language.text("menu.edit.find"), 'F');
@@ -879,6 +890,16 @@ public void menuSelected(MenuEvent e) {
879890
return menu;
880891
}
881892

893+
protected void modifyFontSize(boolean increase){
894+
var fontSize = Preferences.getInteger("editor.font.size");
895+
fontSize += increase ? 1 : -1;
896+
fontSize = Math.max(5, Math.min(72, fontSize));
897+
Preferences.setInteger("editor.font.size", fontSize);
898+
for (Editor editor : base.getEditors()) {
899+
editor.applyPreferences();
900+
}
901+
Preferences.save();
902+
}
882903

883904
abstract public JMenu buildSketchMenu();
884905

app/src/processing/app/ui/EditorFooter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public EditorFooter(Editor eddie) {
111111
tabBar.add(controller);
112112

113113
version = new JLabel(Base.getVersionName());
114-
version.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, MARGIN));
114+
version.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, Editor.RIGHT_GUTTER));
115115
version.addMouseListener(new MouseAdapter() {
116116
public void mousePressed(MouseEvent e) {
117117
if(e.getClickCount() == 5){

app/src/processing/app/ui/ExamplesFrame.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import java.awt.event.MouseEvent;
3434
import java.io.File;
3535
import java.io.IOException;
36+
import java.util.ArrayList;
37+
import java.util.Comparator;
3638
import java.util.Enumeration;
3739

3840
import javax.swing.Box;
@@ -57,6 +59,7 @@
5759
import processing.app.Platform;
5860
import processing.app.Preferences;
5961
import processing.app.SketchReference;
62+
import processing.app.contrib.Contribution;
6063
import processing.app.contrib.ContributionManager;
6164
import processing.app.contrib.ContributionType;
6265
import processing.app.contrib.ExamplesContribution;
@@ -313,9 +316,11 @@ protected DefaultMutableTreeNode buildTree() {
313316
}
314317

315318
// Get examples for third party libraries
316-
DefaultMutableTreeNode contributedLibExamples = new
317-
DefaultMutableTreeNode(Language.text("examples.libraries"));
318-
for (Library lib : mode.contribLibraries) {
319+
DefaultMutableTreeNode contributedLibExamples = new DefaultMutableTreeNode(Language.text("examples.libraries"));
320+
var sortedContribLibs = new ArrayList<>(mode.contribLibraries);
321+
// Sort the libraries by actual name (not the name of the folder)
322+
sortedContribLibs.sort(Comparator.comparing(Contribution::getName));
323+
for (Library lib : sortedContribLibs) {
319324
if (lib.hasExamples()) {
320325
DefaultMutableTreeNode libNode =
321326
new DefaultMutableTreeNode(lib.getName());

build/shared/lib/languages/PDE.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ menu.edit.decrease_indent = ← Decrease Indent
5959
menu.edit.decrease_indent.keystroke.macos = meta pressed OPEN_BRACKET
6060
menu.edit.decrease_indent.keystroke.windows = ctrl pressed OPEN_BRACKET
6161
menu.edit.decrease_indent.keystroke.linux = ctrl pressed OPEN_BRACKET
62+
menu.edit.increase_font = Increase Font Size
63+
menu.edit.increase_font.keystroke.macos = meta pressed EQUALS
64+
menu.edit.increase_font.keystroke.windows = ctrl pressed EQUALS
65+
menu.edit.increase_font.keystroke.linux = ctrl pressed EQUALS
66+
menu.edit.decrease_font = Decrease Font Size
67+
menu.edit.decrease_font.keystroke.macos = meta pressed MINUS
68+
menu.edit.decrease_font.keystroke.windows = ctrl pressed MINUS
69+
menu.edit.decrease_font.keystroke.linux = ctrl pressed MINUS
6270
menu.edit.find = Find...
6371
menu.edit.find_next = Find Next
6472
menu.edit.find_previous = Find Previous

0 commit comments

Comments
 (0)