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);
            }
Esempio n. 2
0
            public AvatarGridScene(AvatarGrid <T> grid) : base(grid)
            {
                m_Grid = grid;

                m_GroupDropIndicatorItem = new QGraphicsLineItem(null, this);
                m_GroupDropIndicatorItem.SetPen(new QPen(new QBrush(Qt.GlobalColor.red), 1));
                m_GroupDropIndicatorItem.SetVisible(false);
                m_GroupDropIndicatorItem.SetZValue(500);
            }
Esempio n. 3
0
            public InfoPopup(AvatarGrid <T> grid)
            {
                m_Grid           = grid;
                base.WindowFlags = (uint)Qt.WindowType.FramelessWindowHint | (uint)Qt.WindowType.ToolTip;
                base.SetMinimumSize(260, 95);
                base.SetStyleSheet("background: black; color: white");

                m_GraphicsView            = new MyGraphicsView(this);
                m_GraphicsView.FrameShape = QFrame.Shape.NoFrame;
                m_GraphicsView.HorizontalScrollBarPolicy = Qt.ScrollBarPolicy.ScrollBarAlwaysOff;
                m_GraphicsView.VerticalScrollBarPolicy   = Qt.ScrollBarPolicy.ScrollBarAlwaysOff;
                m_GraphicsView.SetMaximumSize(60, 60);
                m_GraphicsView.SetMinimumSize(60, 60);

                m_Scene = new QGraphicsScene(m_GraphicsView);

                m_PixmapItem = new ResizableGraphicsPixmapItem();
                m_Scene.AddItem(m_PixmapItem);

                m_GraphicsView.SetScene(m_Scene);

                m_Label            = new QLabel(this);
                m_Label.Alignment  = (uint)Qt.AlignmentFlag.AlignTop | (uint)Qt.AlignmentFlag.AlignLeft;
                m_Label.TextFormat = Qt.TextFormat.RichText;
                m_Label.WordWrap   = true;
                m_Label.SizePolicy = new QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding);

                var leftLayout = new QVBoxLayout();

                leftLayout.AddWidget(m_GraphicsView);
                leftLayout.AddStretch();

                var layout = new QHBoxLayout(this);

                layout.Margin  = 6;
                layout.Spacing = 6;
                layout.AddLayout(leftLayout);
                layout.AddWidget(m_Label);

                this.InstallEventFilter(this);
            }
Esempio n. 4
0
            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);
            }
Esempio n. 5
0
 void HandleItemActivated(AvatarGrid <RosterItem> grid, RosterItem item)
 {
     Gui.TabbedChatsWindow.StartChat(item.Account, item.Item.JID);
 }