Quick Select Support for the GroupCreationTab #77

Merged
mpk merged 9 commits from f/quick-group-select into develop 2020-10-04 21:28:57 +02:00
3 changed files with 29 additions and 12 deletions
Showing only changes of commit 8592839156 - Show all commits

View File

@ -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
mpk marked this conversation as resolved Outdated
Outdated
Review
... a {@link User} as ...
``` ... a {@link User} as ... ```
Outdated
Review

We don't use camelCase is Javadoc.

We don't use camelCase is Javadoc.
*/
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));
mpk marked this conversation as resolved Outdated
Outdated
Review

Please make this private.

Please make this `private`.
final var clip = new Rectangle();
clip.setWidth(32);
clip.setHeight(32);
mpk marked this conversation as resolved Outdated
Outdated
Review

As I've already been conditioned by a certain member of the Envoy team (the coffee machine guy) to not use @link in constructors for the own component, I've since swapped to using @code, so maybe you should too.

It might be beneficial to create a convention for such cases from here on.

As I've already been conditioned by a certain member of the Envoy team (the coffee machine guy) to not use `@link` in constructors for the own component, I've since swapped to using `@code`, so maybe you should too. It might be beneficial to create a convention for such cases from here on.
clip.setArcHeight(32);
clip.setArcWidth(32);
contactProfilePic.setClip(clip);
setAlignment(Pos.TOP_CENTER);
getChildren().add(contactProfilePic);
Label nameLabel = new Label();
nameLabel.setPrefSize(35, 20);
mpk marked this conversation as resolved Outdated
Outdated
Review

?

?
Outdated
Review

This centers the component (it is just 1 pixel but very noticable)

This centers the component (it is just 1 pixel but very noticable)
nameLabel.setMaxSize(35, 20);
nameLabel.setMinSize(35, 20);
nameLabel.setText(user.getName());
nameLabel.setAlignment(Pos.TOP_CENTER);
getChildren().add(nameLabel);
getStyleClass().add("quick-select");
}
mpk marked this conversation as resolved Outdated
Outdated
Review

Why exactly are you declaring a VBox inside a VBox?

Why exactly are you declaring a `VBox` inside a `VBox`?
Outdated
Review

It is more about the image view which this inner vBox is holding. An image view doesn't give me the option to add padding, so I had to do it with its parent: the vBox.

It is more about the image view which this inner vBox is holding. An image view doesn't give me the option to add padding, so I had to do it with its parent: the vBox.

View File

@ -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;
}

View File

@ -64,7 +64,7 @@
<Insets bottom="5.0" top="5" />
</VBox.margin>
</Label>
<ListView fx:id="quickSelectList" orientation="HORIZONTAL" prefHeight="80.0" />
<ListView fx:id="quickSelectList" Id="quick-select-list" orientation="HORIZONTAL" prefHeight="60.0" />
<ListView id="chat-list" fx:id="userList" focusTraversable="false" onMouseClicked="#userListClicked" prefWidth="316.0" VBox.vgrow="ALWAYS">
<contextMenu>
<ContextMenu anchorLocation="CONTENT_TOP_LEFT" />