public RosterItemGroup(AvatarGrid <T> grid, string groupName) { m_Grid = grid; m_GroupName = groupName; m_MoveAnimationTimeLine = new QTimeLine(500); m_MoveAnimation = new QGraphicsItemAnimation(); m_MoveAnimation.SetItem(this); m_MoveAnimation.SetTimeLine(m_MoveAnimationTimeLine); m_FadeAnimationTimeLine = new QTimeLine(500); m_FadeAnimation = new FadeInOutAnimation(); m_FadeAnimation.SetItem(this); m_FadeAnimation.SetTimeLine(m_FadeAnimationTimeLine); m_Font = new QFont(m_Grid.Font); m_Font.SetPointSize(8); // FIXME: Set to m_Grid.HeaderHeight. m_Font.SetBold(true); m_Metrics = new QFontMetrics(m_Font); m_Rect = new QRectF(m_Grid.IconPadding, 0, 0, 0); base.SetHandlesChildEvents(false); base.SetAcceptHoverEvents(true); base.SetAcceptDrops(true); }
public void Remove() { m_FadeAnimationTimeLine.Stop(); m_MoveAnimationTimeLine.Stop(); m_FadeAnimation = null; m_FadeAnimationTimeLine = null; m_MoveAnimation = null; m_MoveAnimationTimeLine = null; lock (m_Grid.m_Groups) { m_Grid.m_Groups.Remove(this.Name); } foreach (var child in base.Children()) { if (child is RosterItem <T> ) { ((RosterItem <T>)child).Remove(false); } } m_Grid.Scene().DestroyItemGroup(this); m_Grid.ResizeAndRepositionGroups(); }
public void Remove(bool resizeAndReposition) { m_FadeAnimationTimeLine.Stop(); m_MoveAnimationTimeLine.Stop(); m_FadeAnimation = null; m_FadeAnimationTimeLine = null; m_MoveAnimation = null; m_MoveAnimationTimeLine = null; var group = (RosterItemGroup)base.ParentItem(); group.RemoveFromGroup(this); m_Grid.Scene().RemoveItem(this); lock (m_Grid.m_Items) { m_Grid.m_Items[this.Item].Remove(group.Name); if (m_Grid.m_Items[this.Item].Count == 0) { m_Grid.m_Items.Remove(this.Item); } } if (resizeAndReposition) { m_Grid.ResizeAndRepositionGroups(); } }
public RosterItem(AvatarGrid <T> grid, T item, double width, double height, QGraphicsItem parent) : base(parent) { m_Grid = grid; m_Item = item; m_Rect = new QRectF(0, 0, 0, 0); m_MoveAnimationTimeLine = new QTimeLine(500); m_MoveAnimation = new QGraphicsItemAnimation(); m_MoveAnimation.SetItem(this); m_MoveAnimation.SetTimeLine(m_MoveAnimationTimeLine); m_FadeAnimationTimeLine = new QTimeLine(500); m_FadeAnimation = new FadeInOutAnimation(); m_FadeAnimation.SetItem(this); m_FadeAnimation.SetTimeLine(m_FadeAnimationTimeLine); // FIXME: This causes all sorts of problems. // this.SetCacheMode(QGraphicsItem.CacheMode.DeviceCoordinateCache); base.SetAcceptHoverEvents(true); }