Use the delegate as intended

This commit is contained in:
Tristan B. Kildaire 2021-01-28 13:35:22 +02:00
parent 4c687b06eb
commit 21f60747a6
1 changed files with 2 additions and 20 deletions

View File

@ -26,26 +26,8 @@ public final class UserNode
initBox();
}
private final class UserButton : Button
private void userButtonClick(Button)
{
private string username;
this(string username)
{
this.username = username;
}
public string getUsername()
{
return username;
}
}
private void userButtonClick(Button e)
{
/* The Button will only ever be a UserButton */
UserButton button = cast(UserButton)e;
/* Create a new ProfileWindow */
ProfileWindow profileWindow = new ProfileWindow(connection, username);
}
@ -56,7 +38,7 @@ public final class UserNode
box = new Box(GtkOrientation.HORIZONTAL, 10);
/* Layout [Button (Prescence Icon)] - Label <username> - [Button (Reply Icon)]*/
UserButton userButton = new UserButton(username);
Button userButton = new Button();
Image userButtonImg = new Image("user-available", GtkIconSize.BUTTON);
userButton.setImage(userButtonImg);