gustav/source/ProfileWIndow.d

51 lines
1.2 KiB
D
Raw Normal View History

2020-10-21 07:00:33 +00:00
/**
* Profile window
*
* User profile window
*/
import Connection;
import gtk.Window;
import gtk.Label;
import gtk.Image;
import std.conv;
2020-10-26 08:23:35 +00:00
import gtk.Box;
2020-10-21 07:00:33 +00:00
public final class ProfileWindow
{
private Connection connection;
private string username;
this(Connection connection, string username)
{
this.connection = connection;
this.username = username;
showWindow();
}
private void showWindow()
{
2020-10-26 08:23:35 +00:00
/* Create the window with the username as the title */
2020-10-21 07:00:33 +00:00
Window profileWindow = new Window(username);
2020-10-26 08:23:35 +00:00
/* Create a Box for contents */
Box profileBox = new Box(GtkOrientation.VERTICAL, 1);
/* Create the username label */
Label usernameTitle = new Label("");
2020-10-28 06:19:33 +00:00
usernameTitle.setMarkup("<span size=\"20000\">"~username~"</span>");
2020-10-26 08:23:35 +00:00
profileBox.add(usernameTitle);
2020-10-21 07:00:33 +00:00
Image profileImage = new Image("/home/deavmi/Downloads/5207740.jpg");
//profileWindow.add(profileImage);
2020-10-28 06:17:48 +00:00
2020-10-21 07:00:33 +00:00
string[] props = connection.getClient().getProperties(username);
2020-10-26 08:23:35 +00:00
profileBox.add(new Label(to!(string)(props)));
2020-10-21 07:00:33 +00:00
2020-10-26 08:23:35 +00:00
profileWindow.add(profileBox);
2020-10-21 07:00:33 +00:00
profileWindow.showAll();
}
}