Skip to content

Commit

Permalink
Replace supported languages string with an icon
Browse files Browse the repository at this point in the history
  • Loading branch information
axpoems committed Jun 4, 2024
1 parent 61188e6 commit 3a78236
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import bisq.chat.bisqeasy.offerbook.BisqEasyOfferbookMessage;
import bisq.desktop.common.Icons;
import bisq.desktop.common.utils.ClipboardUtil;
import bisq.desktop.common.utils.ImageUtil;
import bisq.desktop.components.controls.BisqTooltip;
import bisq.desktop.main.content.chat.message_container.list.ChatMessageListItem;
import bisq.desktop.main.content.chat.message_container.list.ChatMessagesListController;
Expand Down Expand Up @@ -157,8 +158,8 @@ public void cleanup() {
private Label createAndGetSupportedLanguagesLabel() {
Label label = new Label();
if (item.isBisqEasyPublicChatMessageWithOffer()) {
label.setGraphic(ImageUtil.getImageViewById("language-grey"));
BisqEasyOfferbookMessage chatMessage = (BisqEasyOfferbookMessage) item.getChatMessage();
label.setText(item.getSupportedLanguageCodes(chatMessage));
label.setTooltip(new BisqTooltip(item.getSupportedLanguageCodesForTooltip(chatMessage)));
}
return label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public MyOfferMessageBox(ChatMessageListItem<? extends ChatMessage, ? extends Ch
messageBgHBox.setMaxWidth(Control.USE_PREF_SIZE);

// Reactions
HBox.setMargin(supportedLanguages, new Insets(5, 0, -5, 0));
HBox.setMargin(copyIcon, new Insets(4, 10, -4, 0));
reactionsHBox.getChildren().setAll(Spacer.fillHBox(), supportedLanguages, copyIcon);

contentVBox.setAlignment(Pos.CENTER_RIGHT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ protected void setUpReactions() {
editIcon = getIconWithToolTip(AwesomeIcon.EDIT, Res.get("action.edit"));
copyIcon = getIconWithToolTip(AwesomeIcon.COPY, Res.get("action.copyToClipboard"));
deleteIcon = getIconWithToolTip(AwesomeIcon.REMOVE_SIGN, Res.get("action.delete"));
HBox.setMargin(editIcon, new Insets(1, 0, 0, 0));
HBox.setMargin(editIcon, new Insets(1, 0, -1, 0));
HBox.setMargin(copyIcon, new Insets(1, 0, -1, 0));
HBox.setMargin(deleteIcon, new Insets(1, 0, -1, 0));
reactionsHBox.setVisible(false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public PeerOfferMessageBox(ChatMessageListItem<? extends ChatMessage, ? extends
ChatMessagesListController controller, ChatMessagesListModel model) {
super(item, list, controller, model);

reactionsHBox.getChildren().setAll(replyIcon, pmIcon, moreOptionsIcon, supportedLanguages, Spacer.fillHBox());
HBox.setMargin(supportedLanguages, new Insets(5, 0, -5, 0));
reactionsHBox.getChildren().setAll(replyIcon, pmIcon, supportedLanguages, moreOptionsIcon, Spacer.fillHBox());

VBox.setMargin(userNameAndDateHBox, new Insets(-5, 0, 5, 10));
contentVBox.getChildren().setAll(userNameAndDateHBox, messageBgHBox, reactionsHBox);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ protected void setUpReactions() {
pmIcon = getIconWithToolTip(AwesomeIcon.COMMENT_ALT, Res.get("chat.message.privateMessage"));
moreOptionsIcon = getIconWithToolTip(AwesomeIcon.ELLIPSIS_HORIZONTAL, Res.get("chat.message.moreOptions"));
HBox.setMargin(replyIcon, new Insets(4, 0, -4, 10));
HBox.setMargin(pmIcon, new Insets(4, 0, -4, 0));
HBox.setMargin(moreOptionsIcon, new Insets(6, 0, -6, 0));
HBox.setMargin(pmIcon, new Insets(3, 0, -3, 0));
HBox.setMargin(moreOptionsIcon, new Insets(5, 0, -5, 0));
reactionsHBox.setVisible(false);
}

Expand Down

0 comments on commit 3a78236

Please sign in to comment.