Skip to content

Commit a861b43

Browse files
Disable swing dialogs on Mac.
1 parent 99d5e8a commit a861b43

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

source/phasereditor/phasereditor.canvas.ui/src/phasereditor/canvas/ui/editors/grid/editors/RGBCellEditor.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,23 @@ protected Object openDialogBox(Control cellEditorWindow) {
6464
rgb = (RGB) value;
6565
}
6666

67-
if (PhaserEditorUI.get_pref_Dialog_Color_Java()) {
68-
Color color = null;
67+
// TODO: we should find the way this work on Mac!
68+
if (!PhaserEditorUI.isMacPlatform()) {
69+
if (PhaserEditorUI.get_pref_Dialog_Color_Java()) {
6970

70-
if (rgb != null) {
71-
color = new Color(rgb.red, rgb.green, rgb.blue);
72-
}
71+
Color color = null;
7372

74-
color = JColorChooser.showDialog(null, "Color Dialog", color);
73+
if (rgb != null) {
74+
color = new Color(rgb.red, rgb.green, rgb.blue);
75+
}
7576

76-
if (color != null) {
77-
rgb = new RGB(color.getRed(), color.getGreen(), color.getBlue());
78-
}
77+
color = JColorChooser.showDialog(null, "Color Dialog", color);
78+
if (color != null) {
79+
rgb = new RGB(color.getRed(), color.getGreen(), color.getBlue());
80+
}
7981

80-
return rgb;
82+
return rgb;
83+
}
8184
}
8285

8386
ColorDialog dlg = new ColorDialog(cellEditorWindow.getShell());

source/phasereditor/phasereditor.ide/src/phasereditor/ide/intro/PhaserIDE2.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2222
package phasereditor.ide.intro;
2323

24-
import javax.swing.UIManager;
25-
import javax.swing.plaf.nimbus.NimbusLookAndFeel;
24+
import static java.lang.System.out;
2625

2726
import org.eclipse.equinox.app.IApplicationContext;
2827
import org.eclipse.ui.internal.ide.application.IDEApplication;
@@ -39,17 +38,14 @@ public class PhaserIDE2 extends IDEApplication {
3938
@Override
4039
public Object start(IApplicationContext appContext) throws Exception {
4140

42-
javafx.application.Platform.setImplicitExit(false);
41+
out.println("Starting Phaser IDE application " + LicCore.PRODUCT_VERSION);
4342

44-
try {
45-
// UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
46-
UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName());
47-
} catch (Exception e) {
48-
e.printStackTrace();
49-
}
43+
javafx.application.Platform.setImplicitExit(false);
5044

45+
out.println("Starting license monitor");
5146
LicCore.startMonitor();
5247

48+
out.println("Starting Eclipse application");
5349
Object res = super.start(appContext);
5450

5551
try {

source/phasereditor/phasereditor.ui/src/phasereditor/ui/prefs/DialogsPreferencesPage.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public DialogsPreferencesPage() {
1717
@Override
1818
public void init(IWorkbench workbench) {
1919
setPreferenceStore(PhaserEditorUI.getPreferenceStore());
20-
// setDescription("Configure default dialogs.");
20+
// setDescription("Configure default dialogs.");
2121
}
2222

2323
@Override
@@ -33,6 +33,11 @@ protected void createFieldEditors() {
3333

3434
}, parent, true);
3535
addField(editor);
36+
37+
if (PhaserEditorUI.isMacPlatform()) {
38+
editor.setEnabled(false, parent);
39+
}
40+
3641
}
3742
}
3843

0 commit comments

Comments
 (0)