Now shows tooltip on hover

This commit is contained in:
Tristan B. Kildaire 2020-10-18 18:01:03 +02:00
parent a6bcf811f1
commit dd043623ef
1 changed files with 43 additions and 1 deletions

View File

@ -139,11 +139,53 @@ public final class Channel
foreach(string member; memberList)
{
users.add(new Label(member));
Label bruh = new Label(member);
bruh.setHasTooltip(true);
// import gtk.Window;
// Window k = new Window(GtkWindowType.POPUP);
// bruh.setTooltipWindow(k);
bruh.addOnQueryTooltip(&kak);
users.add(bruh);
usersString~=member;
}
}
import gtk.Tooltip;
import gtk.Widget;
private bool kak(int,int,bool, Tooltip d, Widget poes)
{
import std.stdio;
writeln("ttoltip activatd");
/* The username hovered over */
string userHover = (cast(Label)poes).getText();
/* Fetch the status message */
string statusMessage = client.getMotd();
d.setText(userHover~"\n"~statusMessage);
// /* The notification box */
// Box notificationBox = new Box(GtkOrientation.VERTICAL, 1);
// Label title = new Label((cast(Label)poes).getText());
// Label status = new Label("status goes here");
// notificationBox.add(title);
// notificationBox.add(status);
// import gtk.Style;
// // title.setStyle(new Style());
// d.setCustom(notificationBox);
return 1;
}
public void channelJoin(string username)
{
/* Add join message to message log */