Cleaned up

This commit is contained in:
Tristan B. Kildaire 2020-10-20 08:04:49 +02:00
parent 168a7c7e12
commit 65eb2d2518
1 changed files with 43 additions and 43 deletions

View File

@ -150,53 +150,12 @@ public final class Channel
userLabel.setHasTooltip(true);
/* Set the handler to run on hover */
userLabel.addOnQueryTooltip(&kak);
userLabel.addOnQueryTooltip(&userLabelHoverHandler);
return userLabel;
}
public void populateUsersList()
{
string[] memberList = client.getMembers(channelName);
foreach(string member; memberList)
{
Label bruh = getUserLabel(member);
users.add(bruh);
usersString~=member;
}
}
private static string statusToGtkIcon(string status)
{
/* The GTK icon */
string gtkIcon = "image-missing";
if(cmp(status, "available") == 0)
{
gtkIcon = "user-available";
}
else if(cmp(status, "away") == 0)
{
gtkIcon = "user-away";
}
else if(cmp(status, "busy") == 0)
{
gtkIcon = "user-busy";
}
/* TODO: This doesn't make sense */
else if(cmp(status, "offline") == 0)
{
gtkIcon = "user-offline";
}
return gtkIcon;
}
private bool kak(int,int,bool, Tooltip d, Widget poes)
private bool userLabelHoverHandler(int,int,bool, Tooltip d, Widget poes)
{
import std.stdio;
writeln("ttoltip activatd");
@ -240,6 +199,47 @@ public final class Channel
return 1;
}
public void populateUsersList()
{
string[] memberList = client.getMembers(channelName);
foreach(string member; memberList)
{
Label bruh = getUserLabel(member);
users.add(bruh);
usersString~=member;
}
}
private static string statusToGtkIcon(string status)
{
/* The GTK icon */
string gtkIcon = "image-missing";
if(cmp(status, "available") == 0)
{
gtkIcon = "user-available";
}
else if(cmp(status, "away") == 0)
{
gtkIcon = "user-away";
}
else if(cmp(status, "busy") == 0)
{
gtkIcon = "user-busy";
}
/* TODO: This doesn't make sense */
else if(cmp(status, "offline") == 0)
{
gtkIcon = "user-offline";
}
return gtkIcon;
}
public void channelJoin(string username)
{
/* The label to add */