Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
7fecf27
Remove ContributionManager and ContributionPane UI files
Stefterv Oct 14, 2025
838ea14
Enhance Preferences reactivity and test coverage
Stefterv Oct 14, 2025
d459fd8
Merge branch 'clean-contributions-prototype' into preferenceskt-update
Stefterv Oct 14, 2025
e1e1e3a
Small bugfix for removed function
Stefterv Oct 14, 2025
20fa9be
Add compose ui test to the deps
Stefterv Oct 14, 2025
4546a38
Refactor Locale class and add LocaleProvider test
Stefterv Oct 15, 2025
643ec03
Make setLocale parameter nullable in Locale class
Stefterv Oct 15, 2025
06e3094
Add compose ui test to the deps
Stefterv Oct 14, 2025
d42fb2f
Update locale change method in test
Stefterv Oct 15, 2025
58c746b
Add PDE window utilities for Compose and Swing
Stefterv Oct 15, 2025
db69773
Refactor beta welcome window handling
Stefterv Oct 15, 2025
d3681f3
Remove ContributionManager and ContributionPane UI files (#1276)
Stefterv Oct 16, 2025
bf4d163
Refactor Locale class and add LocaleProvider test (#1283)
Stefterv Oct 17, 2025
77eba30
Theming (#1298)
Stefterv Oct 22, 2025
4686345
Merge branch 'welcome-screen' into compose-windows
Stefterv Oct 22, 2025
3e04faa
Merge pull request #1284 from Stefterv/compose-windows
Stefterv Oct 22, 2025
830ecea
Switch from ProcessingTheme to PDETheme in window UI
Stefterv Oct 22, 2025
1c26bab
Refactor preferences to Jetpack Compose UI
Stefterv Oct 23, 2025
8fe0585
Remove obsolete TODO for onClose callback
Stefterv Oct 23, 2025
5ae8b84
Refactor theme system to Material 3 color schemes
Stefterv Oct 23, 2025
ca29800
Add PDEWelcome Composable UI screen
Stefterv Oct 23, 2025
5a6f7fa
Clean up handlePrefs method by removing comments
Stefterv Oct 24, 2025
7965931
Merge pull request #1304 from Stefterv/preferences-screen
Stefterv Oct 24, 2025
3fd4ea9
Merge branch 'welcome-screen' into preferenceskt-update
Stefterv Oct 27, 2025
40a1188
Merge branch 'preferenceskt-update' into colors
Stefterv Oct 27, 2025
2fc5682
Initial layout
Stefterv Oct 27, 2025
6037275
Revamp welcome screen UI and add social icons
Stefterv Oct 27, 2025
33ad602
Add example previews to welcome screen
Stefterv Oct 27, 2025
20aac81
Add hover-activated play button to example previews
Stefterv Oct 27, 2025
e036cdf
Localize welcome screen UI strings
Stefterv Oct 27, 2025
e9b381b
Composable Preferences rewrite (#1277)
Stefterv Oct 28, 2025
d8f9d75
Add language selector and UI improvements to welcome screen
Stefterv Oct 28, 2025
97ab23e
Refactor example listing and randomize welcome sketches
Stefterv Oct 28, 2025
0ee8929
Refactor example handling to use Sketch objects
Stefterv Oct 28, 2025
8e32abf
Add vertical scrollbar to welcome screen examples
Stefterv Oct 28, 2025
2769a07
Add rounded corners to buttons in PDEWelcome
Stefterv Oct 28, 2025
3b5ea1d
Refactor PDEWelcome UI and add Sketch card composable
Stefterv Oct 28, 2025
bef00f9
Add unique window handling to prevent duplicates
Stefterv Oct 28, 2025
07e05be
Refactor dialog handling and improve AlertDialog UI
Stefterv Oct 28, 2025
3bdd00e
Set application window icon using Toolkit.setIcon
Stefterv Oct 28, 2025
65173d4
Simplify imports and update scrollbar colors in Theme.kt
Stefterv Oct 29, 2025
0ce1687
Preferences screen
Stefterv Nov 3, 2025
f0b408a
Replace Row with Column in sketch naming options
Stefterv Nov 5, 2025
373321e
Enhance preferences UI and add memory options
Stefterv Nov 6, 2025
891aa80
Fixed a color issue
Stefterv Nov 6, 2025
6ee6817
Improve preferences UI layout and window size
Stefterv Nov 6, 2025
af4228a
Add theme selection and UI improvements to preferences
Stefterv Nov 6, 2025
15afdf0
Added the ability to undo the changes + icon/language changes
Stefterv Nov 10, 2025
5e91e4e
Update animation spec for slideInVertically
Stefterv Nov 10, 2025
e1fcdb1
Welcome screen implementation (#1307)
Stefterv Nov 26, 2025
33f45b5
Merge branch 'main' into welcome-screen
Stefterv Dec 8, 2025
9f588bd
Merge branch 'main' into welcome-screen
Stefterv Dec 8, 2025
4b39a23
Replace ProcessingTheme with PDETheme in WelcomeSurvey
Stefterv Dec 8, 2025
243789b
Add Material Theme Builder file headers
Stefterv Dec 8, 2025
8883c02
Fix preferences file override and update test property
Stefterv Dec 8, 2025
5981e3e
Merge branch 'welcome-screen' into preferences-impl
Stefterv Dec 8, 2025
91cf11b
Update Theme.kt
Stefterv Dec 8, 2025
ba82cfd
Merge branch 'main' into preferences-impl
Stefterv Dec 9, 2025
3524622
Normalize backward slashes in preferences file
Stefterv Dec 9, 2025
c53c7da
Add support for preferences file override and path normalization
Stefterv Dec 9, 2025
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
70 changes: 61 additions & 9 deletions app/src/main/resources/languages/PDE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -205,39 +205,91 @@ close.unsaved_changes = Save changes to %s?

# Preferences (Frame)
preferences = Preferences
preferences.description=Change how Processing works on your computer. These settings affect all Processing windows and stay the same even after you restart.
preferences.pane.general=General
preferences.pane.interface=Appearance
preferences.pane.editor=Code
preferences.pane.sketches=Sketches
preferences.pane.other=Advanced
preferences.new=New
preferences.reset=Reset to Defaults
preferences.reset_changes=Reset
preferences.unconfirmed_changes=You have unsaved changes!
preferences.apply_changes=Confirm Changes
preferences.experimental=Experimental
preferences.no_results=No results found
preferences.sync_folder_and_filename=Folder name matches sketch name
preferences.sync_folder_and_filename.tip=When enabled, renaming a sketch will also rename its folder to match the sketch name. [Learn more](https://discourse.processing.org/t/sketch-folder-and-sketch-name-syncing/15345)
preferences.show_welcome_screen=Show welcome screen at startup
preferences.diagnostics=Generate diagnostic report for support
preferences.diagnostics.tip=Copies information about your installation into your clipboard, useful for troubleshooting issues.
preferences.diagnostics.button=Generate Report
preferences.diagnostics.button.copied=Report copied to clipboard
preferences.button.width = 80
preferences.restart_required = Restart Processing to apply changes
preferences.sketchbook_location = Sketchbook folder
preferences.sketchbook_location.popup = Sketchbook folder
preferences.sketch_naming = Sketch name
preferences.language = Language:
preferences.editor_and_console_font = Editor and Console font:
preferences.editor_and_console_font.tip = Select the font used in the Editor and the Console.<br>Only monospaced (fixed-width) fonts may be used,<br>though the list may be imperfect.
preferences.editor_font_size = Editor font size:
preferences.console_font_size = Console font size:
preferences.interface_scale = Interface scale:
preferences.sketch_naming.tip=Choose how new sketches are named and numbered.
preferences.language=Language
preferences.editor_and_console_font=Editor and Console font
preferences.editor_and_console_font.tip=Installed Monospaced fonts will be displayed as options.
preferences.editor_font_size=Editor font size
preferences.console_font_size=Console font size
preferences.editor.theme=Theme
preferences.editor.theme.tip=Choose a color theme for windows except for the editor.
preferences.editor.theme.system=System
preferences.editor.theme.light=Light
preferences.editor.theme.dark=Dark
preferences.interface_theme=Interface theme
preferences.interface_scale=Interface scale
preferences.interface_scale.tip=Adjust the size of interface elements.
preferences.interface_scale.auto = Automatic
preferences.background_color = Background color when Presenting:
preferences.background_color.tip = Select the background color used when using Present.<br>Present is used to present a sketch in full-screen,<br>accessible from the Sketch menu.
preferences.background_color.tip=Select the background color used when using Present. Present is used to present a sketch in full-screen, accessible from the Sketch menu.
preferences.use_smooth_text = Use smooth text in editor window
preferences.enable_complex_text = Enable complex text input
preferences.enable_complex_text.tip = Using languages such as Chinese, Japanese, and Arabic<br>in the Editor window require additional features to be enabled.
preferences.enable_complex_text.tip=Using languages such as Chinese, Japanese, and Arabic in the Editor window require additional features to be enabled.
preferences.continuously_check = Continuously check for errors
preferences.show_warnings = Show warnings
preferences.code_completion = Code completion with
preferences.trigger_with = Trigger with
preferences.cmd_space = space
preferences.suggest_imports = Suggest import statements
preferences.increase_memory=Increase maximum available memory
preferences.increase_max_memory = Increase maximum available memory to
# preferences.delete_previous_folder_on_export = Delete previous folder on export
preferences.check_for_updates_on_startup = Allow update checking (see FAQ for information shared)
preferences.update_check=Check for updates on startup
preferences.update_check.tip=No personal information is sent during this process. See the [FAQ](https://github.com/processing/processing4/wiki/FAQ#checking-for-updates)
preferences.run_sketches_on_display = Run sketches on display
preferences.run_sketches_on_display.tip = Sets the display where sketches are initially placed.<br>As usual, if the sketch window is moved, it will re-open<br>at the same location, however when running in present<br>(full screen) mode, this display will always be used.
preferences.run_sketches_on_display.tip=Sets the display where sketches are initially placed. As usual, if the sketch window is moved, it will re-open at the same location, however when running in present (full screen) mode, this display will always be used.
preferences.automatically_associate_pde_files = Automatically associate .pde files with Processing
preferences.launch_programs_in = Launch programs in
preferences.launch_programs_in.mode = mode
preferences.file = More preferences can be edited directly in the file:
preferences.file.hint = (Edit only when Processing is not running.)
preferences.other=Show experimental settings
preferences.other.tip=These settings are contained in the preferences.txt file and are not officially supported. They may be removed or changed without notice in future versions of Processing.
# Preferences (Experimental Pane)
# Keys from the comments of defaults.txt (Nov 2025)
preferences.contribution.backup.on_remove=Backup contributions when "Remove" button is pressed
preferences.contribution.backup.on_remove.tip=When enabled, a backup copy of the contribution will be created in your sketchbook "tools", "modes", "libraries", or "examples" folder when you remove it via the Contribution Manager.
preferences.contribution.backup.on_install=Backup contributions when installing a newer version
preferences.contribution.backup.on_install.tip=When enabled, a backup copy of the contribution will be created in your sketchbook "tools", "modes", "libraries", or "examples" folder when you install a newer version via the Contribution Manager.
preferences.recent.count=Number of recent sketches to show
preferences.chooser.files.native=Use native file chooser dialogs
preferences.theme.gradient.method=Gradient method for themes
preferences.theme.gradient.method.tip=Set to 'lab' to interpolate theme gradients using L*a*b* color space
preferences.platform.auto_file_type_associations=Automatically set file type associations (Windows only)
preferences.platform.auto_file_type_associations.tip=When enabled, Processing will attempt to set itself as the default application for .pde files on Windows systems.
preferences.editor.window.width.default=Default editor window width
preferences.editor.window.height.default=Default editor window height
preferences.editor.window.width.min=Minimum editor window width
preferences.editor.window.height.min=Minimum editor window height
preferences.editor.smooth=Enable antialiasing in the code editor
preferences.editor.caret.blink=Blink the caret
preferences.editor.caret.block=Use block caret

# Sketchbook Location (Frame)
sketchbook_location = Select new sketchbook folder
Expand Down
5 changes: 1 addition & 4 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -2174,10 +2174,7 @@ static private Mode findSketchMode(File folder, List<Mode> modeList) {
* Show the Preferences window.
*/
public void handlePrefs() {
if (preferencesFrame == null) {
preferencesFrame = new PreferencesFrame(this);
}
preferencesFrame.showFrame();
PDEPreferencesKt.show();
}


Expand Down
66 changes: 62 additions & 4 deletions app/src/processing/app/Messages.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import com.formdev.flatlaf.FlatLightLaf
import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.awt.ComposeDialog
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalDensity
import processing.app.ui.Toolkit
import processing.app.ui.theme.PDETheme
import java.awt.EventQueue
import java.awt.Dimension
import java.awt.Frame
import java.io.PrintWriter
import java.io.StringWriter
Expand Down Expand Up @@ -284,14 +290,65 @@ class Messages {
}
}
}
fun main(){

@OptIn(ExperimentalComposeUiApi::class)
fun showDialog(title: String, content: @Composable (modifier: Modifier, dismiss: () -> Unit) -> Unit) {
ComposeDialog().apply {
isModal = true
setTitle(title)
size = Dimension(400, 400)
rootPane.putClientProperty("apple.awt.fullWindowContent", true)
rootPane.putClientProperty("apple.awt.transparentTitleBar", true)
rootPane.putClientProperty("apple.awt.windowTitleVisible", false);


setContent {
PDETheme {
val density = LocalDensity.current
content(Modifier.onSizeChanged {
size = Dimension((it.width / density.density).toInt(), (it.height / density.density).toInt())
setLocationRelativeTo(null)
}, ::dispose)
}
}
setLocationRelativeTo(null)
isVisible = true
}
}

fun main() {
val types = mapOf(
"message" to { Messages.showMessage("Test Title", "This is a test message.") },
"warning" to { Messages.showWarning("Test Warning", "This is a test warning.", Exception("dfdsfjk")) },
"trace" to { Messages.showTrace("Test Trace", "This is a test trace.", Exception("Test Exception"), false) },
"tiered_warning" to { Messages.showWarningTiered("Test Tiered Warning", "Primary message", "Secondary message", null) },
"yes_no" to { Messages.showYesNoQuestion(null, "Test Yes/No", "Do you want to continue?", "Choose yes or no.") },
"custom_question" to { Messages.showCustomQuestion(null, "Test Custom Question", "Choose an option:", "Select one of the options below.", 1, "Option 1", "Option 2", "Option 3") },
"tiered_warning" to {
Messages.showWarningTiered(
"Test Tiered Warning",
"Primary message",
"Secondary message",
null
)
},
"yes_no" to {
Messages.showYesNoQuestion(
null,
"Test Yes/No",
"Do you want to continue?",
"Choose yes or no."
)
},
"custom_question" to {
Messages.showCustomQuestion(
null,
"Test Custom Question",
"Choose an option:",
"Select one of the options below.",
1,
"Option 1",
"Option 2",
"Option 3"
)
},
"error" to { Messages.showError("Test Error", "This is a test error.", null) },
)
Platform.init()
Expand Down Expand Up @@ -322,6 +379,7 @@ fun String.formatClassName() = this
.replace(".", "/")
.padEnd(40)
.colorizePathParts()

fun String.colorizePathParts() = split("/").joinToString("/") { part ->
"\u001B[${31 + (part.hashCode() and 0x7).rem(6)}m$part\u001B[0m"
}
9 changes: 8 additions & 1 deletion app/src/processing/app/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ static public void init() {
setBoolean("editor.input_method_support", true);
}


// next load user preferences file
preferencesFile = Base.getSettingsFile(PREFS_FILE);
var preferencesFileOverride = System.getProperty("processing.app.preferences.file");
if (preferencesFileOverride != null && !preferencesFileOverride.isEmpty()) {
preferencesFile = new File(preferencesFileOverride);
}
boolean firstRun = !preferencesFile.exists();
if (!firstRun) {
try {
Expand Down Expand Up @@ -179,9 +184,11 @@ static public void load(InputStream input) throws IOException {

String[] lines = PApplet.loadStrings(input); // Reads as UTF-8
for (String line : lines) {
if ((line.length() == 0) ||
if ((line.isEmpty()) ||
(line.charAt(0) == '#')) continue;

line = line.replace("\\", "/"); // normalize slashes in paths

// this won't properly handle = signs being in the text
int equals = line.indexOf('=');
if (equals != -1) {
Expand Down
8 changes: 8 additions & 0 deletions app/src/processing/app/Preferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ fun PreferencesProvider(content: @Composable () -> Unit) {
preferencesFile.createNewFile()
}

remember {
// check if the file has backward slashes
if (preferencesFile.readText().contains("\\")) {
val correctedText = preferencesFile.readText().replace("\\", "/")
preferencesFile.writeText(correctedText)
}
}

val update = watchFile(preferencesFile)


Expand Down
51 changes: 24 additions & 27 deletions app/src/processing/app/ui/EditorFooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@

package processing.app.ui;

import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.datatransfer.Clipboard;
import processing.app.Base;
import processing.app.Mode;
import processing.app.Sketch;
import processing.app.contrib.ContributionManager;
import processing.data.StringDict;

import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.StringSelection;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
Expand All @@ -39,14 +38,6 @@
import java.util.ArrayList;
import java.util.List;

import javax.swing.*;

import processing.app.Base;
import processing.app.Mode;
import processing.app.Sketch;
import processing.app.contrib.ContributionManager;
import processing.data.StringDict;


/**
* Console/error/whatever tabs at the bottom of the editor window.
Expand Down Expand Up @@ -118,6 +109,18 @@ public void mousePressed(MouseEvent e) {
Base.DEBUG = !Base.DEBUG;
editor.updateDevelopMenu();
}
copyDebugInformationToClipboard();
}
});

tabBar.add(version);

add(tabBar);

updateTheme();
}

public static void copyDebugInformationToClipboard() {
var debugInformation = String.join("\n",
"Version: " + Base.getVersionName(),
"Revision: " + Base.getRevision(),
Expand All @@ -127,18 +130,12 @@ public void mousePressed(MouseEvent e) {
var stringSelection = new StringSelection(debugInformation);
var clipboard = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, null);
}
});

tabBar.add(version);

add(tabBar);

updateTheme();
}
}


/** Add a panel with no icon. */
/**
* Add a panel with no icon.
*/
public void addPanel(Component comp, String name) {
addPanel(comp, name, null);
}
Expand Down
Loading