Make recording indicator clickable

You can now click on the recording / pause indicator to pause or resume
recording in the thubmnail overview tabs
This commit is contained in:
0xb00bface 2020-11-01 19:12:47 +01:00
parent 80ea981644
commit 8df1ff72e7
3 changed files with 26 additions and 11 deletions

View File

@ -1,6 +1,13 @@
3.10.5
========================
* You can now click on the recording / pause indicator to pause or resume
recording in the thubmnail overview tabs
* Some smaller UI tweaks
3.10.4
========================
* Fix: Bongacams login
* Fix: Minimal browser would freeze on windows
* Update minimal browser to Electron 10.1.5
3.10.3

View File

@ -1,18 +1,22 @@
package ctbrec.ui;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.Polygon;
public class PauseIndicator extends HBox {
public class PauseIndicator extends Polygon {
public PauseIndicator(Color c, int size) {
spacingProperty().setValue(size*1/5);
Rectangle left = new Rectangle(size*2/5, size);
left.setFill(c);
Rectangle right = new Rectangle(size*2/5, size);
right.setFill(c);
getChildren().add(left);
getChildren().add(right);
public PauseIndicator(Color color, int size) {
super(
0, size,
0, 0,
(size * 2.0 / 5.0), 0,
(size * 2.0 / 5.0), size,
(size * 3.0 / 5.0), size,
(size * 3.0 / 5.0), 0,
size, 0,
size, size
);
setFill(color);
}
}

View File

@ -177,12 +177,16 @@ public class ThumbCell extends StackPane {
recordingIndicator = new Circle(8);
recordingIndicator.setFill(colorRecording);
recordingIndicator.setCursor(Cursor.HAND);
recordingIndicator.setOnMouseClicked(e -> pauseResumeAction(true));
StackPane.setMargin(recordingIndicator, new Insets(3));
StackPane.setAlignment(recordingIndicator, Pos.TOP_LEFT);
getChildren().add(recordingIndicator);
pausedIndicator = new PauseIndicator(colorRecording, 16);
pausedIndicator.setVisible(false);
pausedIndicator.setCursor(Cursor.HAND);
pausedIndicator.setOnMouseClicked(e -> pauseResumeAction(false));
StackPane.setMargin(pausedIndicator, new Insets(3));
StackPane.setAlignment(pausedIndicator, Pos.TOP_LEFT);
getChildren().add(pausedIndicator);