Adjusted message rendering
This commit is contained in:
parent
ebfe603bc7
commit
9e427e1ec3
@ -36,7 +36,7 @@ import envoy.util.EnvoyLog;
|
|||||||
*
|
*
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy Client v0.2-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class MessageControl extends Label {
|
public class MessageControl extends Label {
|
||||||
|
|
||||||
|
@ -30,8 +30,10 @@ public final class MessageListCell extends AbstractListCell<Message, MessageCont
|
|||||||
final var control = new MessageControl(message);
|
final var control = new MessageControl(message);
|
||||||
listView.widthProperty()
|
listView.widthProperty()
|
||||||
.addListener((observable, oldValue, newValue) -> {
|
.addListener((observable, oldValue, newValue) -> {
|
||||||
int padding = Math.min(100, newValue.intValue() / 10);
|
int padding = 0;
|
||||||
setPadding(new Insets(0, padding, 0, padding));
|
if (newValue.intValue() > 1020) padding = (newValue.intValue() - 1000) / 2;
|
||||||
|
else padding = 10;
|
||||||
|
setPadding(new Insets(0, padding, 6, padding));
|
||||||
});
|
});
|
||||||
if (control.isOwnMessage()) setAlignment(Pos.CENTER_RIGHT);
|
if (control.isOwnMessage()) setAlignment(Pos.CENTER_RIGHT);
|
||||||
else setAlignment(Pos.CENTER_LEFT);
|
else setAlignment(Pos.CENTER_LEFT);
|
||||||
|
Reference in New Issue
Block a user