diff --git a/src/main/java/envoy/client/ui/controller/ChatScene.java b/src/main/java/envoy/client/ui/controller/ChatScene.java
index 992895c..31c2431 100644
--- a/src/main/java/envoy/client/ui/controller/ChatScene.java
+++ b/src/main/java/envoy/client/ui/controller/ChatScene.java
@@ -1,5 +1,7 @@
package envoy.client.ui.controller;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -310,4 +312,22 @@ public final class ChatScene {
* @since Envoy Client v0.1-beta
*/
private void scrollToMessageListEnd() { messageList.scrollTo(messageList.getItems().size() - 1); }
+
+ // =========== contextMenu actions ========== //
+
+ @FXML
+ private void copyMessage() {
+ Toolkit.getDefaultToolkit()
+ .getSystemClipboard()
+ .setContents(new StringSelection(messageList.getSelectionModel().getSelectedItem().getText()), null);
+ }
+
+ @FXML
+ private void deleteMessage() {}
+
+ @FXML
+ private void forwardMessage() {}
+
+ @FXML
+ private void quoteMessage() {}
}
diff --git a/src/main/resources/css/base.css b/src/main/resources/css/base.css
index ff81b44..35094f4 100644
--- a/src/main/resources/css/base.css
+++ b/src/main/resources/css/base.css
@@ -1,5 +1,15 @@
.button, .list-cell {
- -fx-background-radius: 5em;
+ -fx-background-radius: 5.0em;
+}
+
+.context-menu, .context-menu > * {
+ -fx-background-radius: 15px;
+ /*TODO: solution below does not work */
+ -fx-background-color: transparent;
+}
+
+.menu-item {
+ -fx-background-radius: 15.0px;
}
.button:hover {
@@ -34,12 +44,12 @@
.received-message {
-fx-alignment: center-left;
- -fx-background-radius: 4em;
+ -fx-background-radius: 4.0em;
-fx-text-alignment: right;
}
.own-message {
-fx-alignment: center-right;
- -fx-background-radius: 4em;
+ -fx-background-radius: 4.0em;
-fx-text-alignment: left;
}
diff --git a/src/main/resources/css/dark.css b/src/main/resources/css/dark.css
index becc265..75e3bc0 100644
--- a/src/main/resources/css/dark.css
+++ b/src/main/resources/css/dark.css
@@ -18,11 +18,11 @@
-fx-background-color: lightgray;
}
-.list-view, .list-cell, .text-area .content, .text-field, .password-field, .tooltip, .pane, .pane .content, .vbox, .titled-pane > .title, .titled-pane > *.content {
+.list-view, .list-cell, .text-area .content, .text-field, .password-field, .tooltip, .pane, .pane .content, .vbox, .titled-pane > .title, .titled-pane > *.content, .context-menu, .menu-item {
-fx-background-color: dimgray;
}
-.list-cell:selected, .list-cell:selected > * {
+.list-cell:selected, .list-cell:selected > *, .menu-item:hover {
-fx-background-color: darkviolet;
}
diff --git a/src/main/resources/css/light.css b/src/main/resources/css/light.css
index 3362540..96942fd 100644
--- a/src/main/resources/css/light.css
+++ b/src/main/resources/css/light.css
@@ -11,6 +11,6 @@
-fx-background-color: lightgreen;
}
-.own-message {
+.own-message , .menu-item {
-fx-background-color: lightgray;
}
diff --git a/src/main/resources/fxml/ChatScene.fxml b/src/main/resources/fxml/ChatScene.fxml
index 9d95fba..4d7d4f6 100644
--- a/src/main/resources/fxml/ChatScene.fxml
+++ b/src/main/resources/fxml/ChatScene.fxml
@@ -2,8 +2,10 @@
+
+
@@ -50,7 +52,17 @@
-
+
+
+
+
+
+
+
+
+
+
+