add button hover effect to player gui
continuous-integration/drone/push Build is passing Details

* minor player gui fixes
This commit is contained in:
Jannik 2020-07-26 00:01:35 +02:00
parent 5c4b78436f
commit c323ac957c
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
4 changed files with 47 additions and 15 deletions

View File

@ -69,7 +69,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.31.1</version>
<version>3.32.3.1</version>
</dependency>
<dependency>

View File

@ -228,6 +228,9 @@ public class PlayerController {
player.getStage().setFullScreen(!player.getStage().isFullScreen());
fullscreenIcon.setImage(player.getStage().isFullScreen() ? fullscreenExit : fullscreen);
}
// fix focused button has rippler fill https://github.com/jfoenixadmin/JFoenix/issues/1051
btnBack.setStyle("-jfx-rippler-fill: black;");
}
/**
@ -289,13 +292,15 @@ public class PlayerController {
public void handle(MouseEvent event) {
embeddedMediaPlayer.controls().skipTime(skipTime);
// TODO update time-stamps if video is paused
// currentTime = currentTime + skipTime;
// endTime = endTime - skipTime;
//
// Platform.runLater(() -> {
// updateControls();
// });
// update time-stamps if video is paused
if (!embeddedMediaPlayer.status().isPlaying()) {
Platform.runLater(() -> {
lblEndTime.setText(String.format("%d:%02d:%02d",
TimeUnit.MILLISECONDS.toHours(endTime - skipTime) % 24,
TimeUnit.MILLISECONDS.toMinutes(endTime - skipTime) % 60,
TimeUnit.MILLISECONDS.toSeconds(endTime - skipTime) % 60));
});
}
mousePressed = false;
}
@ -428,12 +433,30 @@ public class PlayerController {
@FXML
void btnReplayAction(ActionEvent event) {
embeddedMediaPlayer.controls().skipTime(-10000);
embeddedMediaPlayer.controls().skipTime(-10000);
if (!embeddedMediaPlayer.status().isPlaying()) {
currentTime = currentTime - 10000;
endTime = endTime + 10000;
Platform.runLater(() -> {
updateControls();
});
}
}
@FXML
void btnForwardAction(ActionEvent event) {
embeddedMediaPlayer.controls().skipTime(10000);
embeddedMediaPlayer.controls().skipTime(10000);
if (!embeddedMediaPlayer.status().isPlaying()) {
currentTime = currentTime + 10000;
endTime = endTime - 10000;
Platform.runLater(() -> {
updateControls();
});
}
}
@FXML
@ -547,7 +570,4 @@ public class PlayerController {
Platform.runLater(() -> videoPixelBuffer.updateBuffer(pb -> null));
}
}
}

View File

@ -76,3 +76,15 @@
.jfx-popup-container {
-fx-background-color: -theme-secondary-dark;
}
/*******************************************************************************
* *
* Button *
* *
******************************************************************************/
.jfx-button:hover {
-fx-scale-x: 1.1;
-fx-scale-y: 1.1;
-fx-scale-z: 1.1;
}

View File

@ -22,7 +22,7 @@
<children>
<JFXButton fx:id="btnBack" contentDisplay="GRAPHIC_ONLY" onAction="#btnBackAction">
<graphic>
<ImageView fitHeight="24.0" pickOnBounds="true" preserveRatio="true">
<ImageView fitHeight="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/baseline_keyboard_backspace_white_48dp.png" />
</image>
@ -31,7 +31,7 @@
</JFXButton>
<Label fx:id="lblTitle" text="Title" textFill="WHITE">
<font>
<Font size="20.0" />
<Font size="22.0" />
</font>
</Label>
</children>