drag and drop UI
This commit is contained in:
22
TimeSlot.cs
22
TimeSlot.cs
@@ -2,6 +2,8 @@ using Godot;
|
||||
|
||||
public partial class TimeSlot : PanelContainer
|
||||
{
|
||||
public MeetingControl MeetingControl { get; set; }
|
||||
|
||||
public override bool _CanDropData(Vector2 atPosition, Variant data)
|
||||
{
|
||||
GD.Print("DRAGGED OVERR!!!");
|
||||
@@ -11,6 +13,24 @@ public partial class TimeSlot : PanelContainer
|
||||
|
||||
public override void _DropData(Vector2 atPosition, Variant data)
|
||||
{
|
||||
GD.Print("DROP");
|
||||
var meetingData = (MeetingControlDragData)data;
|
||||
|
||||
MeetingControl = meetingData.MeetingControl;
|
||||
meetingData.MeetingControl.InSlot = true;
|
||||
MeetingControl.Reparent(this, false);
|
||||
MeetingControl.Visible = true;
|
||||
}
|
||||
|
||||
public override void _Notification(int what)
|
||||
{
|
||||
if (what == NotificationDragBegin)
|
||||
{
|
||||
MouseFilter = MouseFilterEnum.Pass;
|
||||
}
|
||||
|
||||
if (what == NotificationDragEnd)
|
||||
{
|
||||
MouseFilter = MouseFilterEnum.Ignore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user