From 8592839156a047619c18a45ff51eca107f04a246 Mon Sep 17 00:00:00 2001 From: DieGurke Date: Thu, 1 Oct 2020 22:29:40 +0200 Subject: [PATCH] Worked on quickMessageList and corresponding control --- .../client/ui/control/QuickSelectControl.java | 31 ++++++++++++++++--- client/src/main/resources/css/dark.css | 8 ++--- .../main/resources/fxml/GroupCreationTab.fxml | 2 +- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/client/src/main/java/envoy/client/ui/control/QuickSelectControl.java b/client/src/main/java/envoy/client/ui/control/QuickSelectControl.java index d7e7bfe..f8b286e 100644 --- a/client/src/main/java/envoy/client/ui/control/QuickSelectControl.java +++ b/client/src/main/java/envoy/client/ui/control/QuickSelectControl.java @@ -1,20 +1,41 @@ package envoy.client.ui.control; +import javafx.geometry.Pos; import javafx.scene.control.Label; +import javafx.scene.image.ImageView; +import javafx.scene.layout.VBox; +import javafx.scene.shape.Rectangle; +import envoy.client.util.IconUtil; import envoy.data.User; /** * @author Maximilian Käfer * @since Envoy Client v0.3-beta */ -public class QuickSelectControl extends Label { +public class QuickSelectControl extends VBox { public QuickSelectControl(User user) { - setPrefSize(35, 35); - setMaxSize(35, 35); - setMinSize(35, 35); - setText(user.getName()); + + // Profile picture + ImageView contactProfilePic = new ImageView(IconUtil.loadIconThemeSensitive("user_icon", 32)); + final var clip = new Rectangle(); + clip.setWidth(32); + clip.setHeight(32); + clip.setArcHeight(32); + clip.setArcWidth(32); + contactProfilePic.setClip(clip); + setAlignment(Pos.TOP_CENTER); + getChildren().add(contactProfilePic); + + Label nameLabel = new Label(); + nameLabel.setPrefSize(35, 20); + nameLabel.setMaxSize(35, 20); + nameLabel.setMinSize(35, 20); + nameLabel.setText(user.getName()); + nameLabel.setAlignment(Pos.TOP_CENTER); + getChildren().add(nameLabel); + getStyleClass().add("quick-select"); } diff --git a/client/src/main/resources/css/dark.css b/client/src/main/resources/css/dark.css index df7527a..eb52eed 100644 --- a/client/src/main/resources/css/dark.css +++ b/client/src/main/resources/css/dark.css @@ -42,7 +42,7 @@ -fx-background-color: #191919; } -#chat-list, #top-bar, #search-panel, #note-background { +#chat-list, #top-bar, #search-panel, #note-background, .quick-select { -fx-background-color: #303030; } @@ -69,7 +69,7 @@ -fx-background-color: transparent; } -.scroll-bar:vertical .increment-arrow, .scroll-bar:vertical .decrement-arrow { +.scroll-bar:vertical .increment-arrow, .scroll-bar:vertical .decrement-arrow, #quick-select-list, .list-cell { -fx-background-color: transparent; } @@ -83,7 +83,3 @@ -fx-text-fill: white; -fx-background-color: transparent; } - -.quick-select { - -fx-background-color: black; -} diff --git a/client/src/main/resources/fxml/GroupCreationTab.fxml b/client/src/main/resources/fxml/GroupCreationTab.fxml index f954324..19699dc 100644 --- a/client/src/main/resources/fxml/GroupCreationTab.fxml +++ b/client/src/main/resources/fxml/GroupCreationTab.fxml @@ -64,7 +64,7 @@ - +