incorporate Mode fix from Joel (issue #2615)

This commit is contained in:
Ben Fry
2014-07-26 10:25:10 -04:00
parent aef416d36f
commit d20a9de361
3 changed files with 13 additions and 2 deletions

View File

@@ -389,8 +389,13 @@ public abstract class Editor extends JFrame implements RunnerListener {
JRadioButtonMenuItem item = new JRadioButtonMenuItem(m.getTitle());
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
base.changeMode(m);
if (sketch.isModified()) {
if (!sketch.isModified()) {
base.changeMode(m);
} else {
// Re-select the old checkbox, because it was automatically
// updated by Java, even though the Mode could not be changed.
// https://github.com/processing/processing/issues/2615
for (Component c : modeMenu.getPopupMenu().getComponents()) {
if (c instanceof JRadioButtonMenuItem) {
if (((JRadioButtonMenuItem)c).getText() == mode.getTitle()) {

View File

@@ -63,6 +63,10 @@ in-progress Google Summer of Code projects and others:
+ Add preference to set the present color
https://github.com/processing/processing/pull/2568
+ Fix a problem where mode menu selection would change even if
the change was canceled due to the sketch being modified
https://github.com/processing/processing/issues/2615
[ more bug fixes ]

View File

@@ -20,6 +20,8 @@ X contrib properties files ignored in favor of contributions.txt from p5.org
X https://github.com/processing/processing/issues/2572
X tweak mode integrated
X https://github.com/processing/processing/pull/2624
X wrong mode selected if sketch is modified (checkbox changes)
X https://github.com/processing/processing/issues/2615
pulls
X Implementation of a list of open sketches in the Sketch menu