Group UI to reslove #9
This commit is contained in:
parent
f7e557344d
commit
3389495a98
8
Luski/GUI/MainScreen/Interfaces/IChannelPick.cs
Normal file
8
Luski/GUI/MainScreen/Interfaces/IChannelPick.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using Luski.net.JsonTypes;
|
||||
|
||||
namespace Luski.GUI.MainScreen.Interfaces;
|
||||
|
||||
public interface IChannelPick
|
||||
{
|
||||
public SocketTextChannel Channel { get; }
|
||||
}
|
41
Luski/GUI/MainScreen/UI/Group.cs
Normal file
41
Luski/GUI/MainScreen/UI/Group.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using GraphicsManager.Interfaces;
|
||||
using GraphicsManager.Objects;
|
||||
using GraphicsManager.Objects.Core;
|
||||
using Luski.net.JsonTypes;
|
||||
using Luski.GUI.MainScreen.Interfaces;
|
||||
|
||||
namespace Luski.GUI.MainScreen.UI;
|
||||
|
||||
public class Group : UserControl, IChannelPick
|
||||
{
|
||||
public SocketTextChannel Channel { get; set; }
|
||||
private string members = "";
|
||||
private Rectangle r;
|
||||
private Label Username, Status;
|
||||
public Group(SocketGroupChannel chan)
|
||||
{
|
||||
Channel = chan;
|
||||
Size = new(370, 96);
|
||||
BackgroundColor = new(34, 34, 34, 255);
|
||||
Controls.Add( r = new Rectangle(new Texture(chan.GetPicture().Result)) { Location = new(15,17), Size = new(58,58)});
|
||||
Controls.Add(Username = new Label() { Text = chan.Title, Location = new(77,20)});
|
||||
string sl = "Online";
|
||||
if (chan.Id != 0)
|
||||
{
|
||||
sl = chan.Members.Count + " Memmbers";
|
||||
}
|
||||
Controls.Add(Status = new Label() { Text = sl, Location = new(77,48)});
|
||||
//r.Clicked += AllOnClicked;
|
||||
//Username.Clicked += AllOnClicked;
|
||||
//Status.Clicked += AllOnClicked;
|
||||
this.Clicked += AllOnClicked;
|
||||
}
|
||||
|
||||
private Task AllOnClicked(IRenderObject arg)
|
||||
{
|
||||
if (ClickCon is not null) _ = ClickCon.Invoke(this);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public event Func<IChannelPick, Task> ClickCon;
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="GraphicsManager" Version="1.0.0-alpha995" />
|
||||
<PackageReference Include="GraphicsManager" Version="1.0.0-alpha999991" />
|
||||
<PackageReference Include="Luski.net" Version="1.1.0-alpha" />
|
||||
</ItemGroup>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user