Worked on quickMessageList and corresponding control

This commit is contained in:
Maximilian P. Käfer 2020-10-01 22:29:40 +02:00
parent 7fffa0da83
commit 8592839156
Signed by: mpk
GPG Key ID: 035869C949377C5C
3 changed files with 29 additions and 12 deletions

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
*/
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");
}

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" />