From 21f60747a674570c00795e6737a52e8e34eb8597 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Thu, 28 Jan 2021 13:35:22 +0200 Subject: [PATCH] Use the delegate as intended --- source/UserNode.d | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/source/UserNode.d b/source/UserNode.d index b9bc082..44d8eca 100644 --- a/source/UserNode.d +++ b/source/UserNode.d @@ -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 - [Button (Reply Icon)]*/ - UserButton userButton = new UserButton(username); + Button userButton = new Button(); Image userButtonImg = new Image("user-available", GtkIconSize.BUTTON); userButton.setImage(userButtonImg);