Align messages not sent (i.e. received) to the start (left)

This commit is contained in:
Tristan B. Kildaire 2020-10-19 13:44:58 +02:00
parent 860fa3b714
commit 5ab62e5c4a
2 changed files with 13 additions and 2 deletions

View File

@ -234,8 +234,12 @@ public final class Channel
public void channelJoin(string username) public void channelJoin(string username)
{ {
/* The label to add */
Label joinLabel = new Label("--> "~username~" joined the channel");
joinLabel.setHalign(GtkAlign.START);
/* Add join message to message log */ /* Add join message to message log */
textArea.add(new Label("--> "~username~" joined the channel")); textArea.add(joinLabel);
/* Add user to user list */ /* Add user to user list */
users.add(getUserLabel(username)); users.add(getUserLabel(username));
@ -246,8 +250,12 @@ public final class Channel
public void channelLeave(string username) public void channelLeave(string username)
{ {
/* The label to add */
Label leaveLabel = new Label("<-- "~username~" left the channel");
leaveLabel.setHalign(GtkAlign.START);
/* Add leave message to message log */ /* Add leave message to message log */
textArea.add(new Label("<-- "~username~" left the channel")); textArea.add(leaveLabel);
/* TODO: Better way with just removing one dude */ /* TODO: Better way with just removing one dude */
@ -276,6 +284,8 @@ public final class Channel
/* TODO: Do this better */ /* TODO: Do this better */
// foreach(Label label; users.get) // foreach(Label label; users.get)
// users.add(new Label(username)); // users.add(new Label(username));
// users.showAll();
// box.showAll();+
} }

View File

@ -112,6 +112,7 @@ public final class Connection : Thread
notebookSwitcher.showAll(); notebookSwitcher.showAll();
tl(); tl();
//Thread.sleep(dur!("seconds")(2)); //Thread.sleep(dur!("seconds")(2));