Open the player on double-click in the Recording tab

Implements #121
This commit is contained in:
0xboobface 2018-12-16 20:38:58 +01:00
parent d1cf6a681b
commit bfbd6b1782
1 changed files with 9 additions and 0 deletions

View File

@ -58,6 +58,7 @@ import javafx.scene.input.ClipboardContent;
import javafx.scene.input.ContextMenuEvent;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
@ -149,6 +150,14 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
}
event.consume();
});
table.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> {
if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 2) {
JavaFxModel model = table.getSelectionModel().getSelectedItem();
if(model != null) {
new PlayAction(table, model).execute();
}
}
});
table.addEventHandler(MouseEvent.MOUSE_PRESSED, event -> {
if (popup != null) {
popup.hide();