Added multiple (recording) icons and change them on recording

This commit is contained in:
delvh 2020-07-06 22:35:06 +02:00
parent 00a9185f81
commit 4f2c1f8a97
7 changed files with 7 additions and 2 deletions

View File

@ -111,6 +111,7 @@ public final class ChatScene implements Restorable {
userList.setCellFactory(ContactListCellFactory::new); userList.setCellFactory(ContactListCellFactory::new);
settingsButton.setGraphic(new ImageView(IconUtil.loadDefault("settings", 16))); settingsButton.setGraphic(new ImageView(IconUtil.loadDefault("settings", 16)));
voiceButton.setGraphic(new ImageView(IconUtil.loadDefaultThemeSensitive("", 24)));
// Listen to received messages // Listen to received messages
eventBus.register(MessageCreationEvent.class, e -> { eventBus.register(MessageCreationEvent.class, e -> {
@ -262,13 +263,17 @@ public final class ChatScene implements Restorable {
try { try {
if (!recording) { if (!recording) {
recording = true; recording = true;
Platform.runLater(() -> voiceButton.setText("Recording...")); Platform.runLater(() -> {
voiceButton.setText("Recording");
voiceButton.setGraphic(new ImageView(IconUtil.loadDefault("microphone_recording", 24)));
});
recorder.start(); recorder.start();
} else { } else {
pendingAttachment = new Attachment(recorder.finish(), AttachmentType.VOICE); pendingAttachment = new Attachment(recorder.finish(), AttachmentType.VOICE);
recording = false; recording = false;
Platform.runLater(() -> { Platform.runLater(() -> {
voiceButton.setText("Record Voice Message"); voiceButton.setGraphic(new ImageView(IconUtil.loadDefaultThemeSensitive("microphone_", 24)));
voiceButton.setText(null);
checkPostConditions(false); checkPostConditions(false);
attachmentView.setImage(IconUtil.loadDefaultThemeSensitive("attachment_present_", 20)); attachmentView.setImage(IconUtil.loadDefaultThemeSensitive("attachment_present_", 20));
attachmentView.setVisible(true); attachmentView.setVisible(true);

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB