Skip to content

Commit 9e044a7

Browse files
committed
fixed settings dialog, added stop render on lost focus option, implemented handling external changes of opened files.
1 parent d18fd46 commit 9e044a7

File tree

19 files changed

+339
-63
lines changed

19 files changed

+339
-63
lines changed

.idea/jme3-spaceshift-editor.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Editor.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/messages/messages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ SingleColorTextureFileCreatorDescription=New single color texture
9292

9393
SettingsDialogTitle=Settings
9494
SettingsDialogFXAA=Enable FXAA
95+
SettingsDialogStopRenderOnLostFocus=Stop render on lost focus
9596
SettingsDialogFrameRate=Frame rate
9697
SettingsDialogGammaCorrection=Gamma correction
9798
SettingsDialogToneMapFilter=Exposure filter

resources/messages/messages_de.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ SingleColorTextureFileCreatorDescription=Neue einfarbige Textur
9292

9393
SettingsDialogTitle=Einstellungen
9494
SettingsDialogFXAA=FXAA einschalten
95+
SettingsDialogStopRenderOnLostFocus=Stop render on lost focus
9596
SettingsDialogFrameRate=Framerate
9697
SettingsDialogGammaCorrection=Gammakorrektur
9798
SettingsDialogToneMapFilter=Belichtungsfilter

resources/messages/messages_ru.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ SingleColorTextureFileCreatorDescription=Новая моноцветная те
9393

9494
SettingsDialogTitle=Настройки
9595
SettingsDialogFXAA=Включить FXAA
96+
SettingsDialogStopRenderOnLostFocus=Отключать рендер при потере фокуса
9697
SettingsDialogFrameRate=Кол-во кадров
9798
SettingsDialogGammaCorrection=Коррекция гаммы
9899
SettingsDialogToneMapFilter=Фильтр экспозиции
-128 Bytes
Binary file not shown.

resources/ui/css/custom_classes.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,12 +564,15 @@
564564
}
565565

566566
.settings-dialog > .dialog-content-root > .tab-pane {
567-
-fx-max-height: 260px;
567+
-fx-max-height: 300px;
568+
-fx-min-height: -fx-max-height;
568569
}
569570

570571
.settings-dialog > .dialog-content-root > .tab-pane > .tab-content-area > .vbox {
571572
-fx-spacing: 2px;
572-
-fx-padding: 6px 15px 0px 0px;
573+
-fx-padding: 6px 0px 0px 0px;
574+
-fx-max-width: 585px;
575+
-fx-min-height: 300px;
573576
}
574577

575578
.settings-dialog-label {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.ss.editor.test;
2+
3+
import javafx.application.Application;
4+
import javafx.scene.Group;
5+
import javafx.scene.Scene;
6+
import javafx.scene.control.Button;
7+
import javafx.stage.DirectoryChooser;
8+
import javafx.stage.Stage;
9+
import javafx.stage.StageStyle;
10+
11+
import java.io.File;
12+
13+
/**
14+
* Created by Alex on 16.07.17.
15+
*/
16+
public class TestChooser extends Application {
17+
@Override
18+
public void start(final Stage stage) throws Exception {
19+
20+
Button button = new Button("Click");
21+
22+
Group root = new Group(button);
23+
Scene scene = new Scene(root);
24+
25+
stage.initStyle(StageStyle.DECORATED);
26+
stage.setMinHeight(600);
27+
stage.setMinWidth(800);
28+
stage.setWidth(500);
29+
stage.setHeight(500);
30+
stage.setMaximized(false);
31+
stage.setTitle("Some title");
32+
stage.setScene(scene);
33+
stage.show();
34+
35+
button.setOnAction(event -> {
36+
DirectoryChooser chooser = new DirectoryChooser();
37+
chooser.setTitle("Some title");
38+
chooser.setInitialDirectory(new File(System.getProperty("user.home")));
39+
File folder = chooser.showDialog(stage);
40+
System.out.println(folder);
41+
});
42+
}
43+
}

src/com/ss/editor/JFXApplication.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,10 @@ private void createSceneProcessor(@NotNull final EditorFXScene scene, @NotNull f
282282
this.sceneProcessor = sceneProcessor;
283283

284284
final Stage stage = notNull(getStage());
285-
stage.focusedProperty().addListener((observable, oldValue, newValue) -> editor.setPaused(!newValue));
285+
stage.focusedProperty().addListener((observable, oldValue, newValue) -> {
286+
final EditorConfig editorConfig = EditorConfig.getInstance();
287+
editor.setPaused(editorConfig.isStopRenderOnLostFocus() && !newValue);
288+
});
286289

287290
Platform.runLater(scene::notifyFinishBuild);
288291
}

src/com/ss/editor/Messages.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ public class Messages {
341341
* The constant SETTINGS_DIALOG_FXAA.
342342
*/
343343
public static final String SETTINGS_DIALOG_FXAA;
344+
/**
345+
* The constant SETTINGS_DIALOG_STOP_RENDER_ON_LOST_FOCUS.
346+
*/
347+
public static final String SETTINGS_DIALOG_STOP_RENDER_ON_LOST_FOCUS;
344348
/**
345349
* The constant SETTINGS_DIALOG_FRAME_RATE.
346350
*/
@@ -2393,6 +2397,7 @@ public class Messages {
23932397

23942398
SETTINGS_DIALOG_TITLE = bundle.getString("SettingsDialogTitle");
23952399
SETTINGS_DIALOG_FXAA = bundle.getString("SettingsDialogFXAA");
2400+
SETTINGS_DIALOG_STOP_RENDER_ON_LOST_FOCUS = bundle.getString("SettingsDialogStopRenderOnLostFocus");
23962401
SETTINGS_DIALOG_FRAME_RATE = bundle.getString("SettingsDialogFrameRate");
23972402
SETTINGS_DIALOG_GAMMA_CORRECTION = bundle.getString("SettingsDialogGammaCorrection");
23982403
SETTINGS_DIALOG_TONEMAP_FILTER = bundle.getString("SettingsDialogToneMapFilter");

0 commit comments

Comments
 (0)