public MarkerOverlapIndicator(MarkerTrack track, float pos)
        {
            AddToClassList(k_MultiMarkerStyleClass);
            style.position = Position.Absolute;

            Image img = new Image();

            img.AddToClassList("markerOverlapImage");
            img.pickingMode = PickingMode.Ignore;
            pickingMode     = PickingMode.Ignore;
            Add(img);

            m_Track = track;
            Value   = pos;
        }
示例#2
0
        void CreateBuiltInTracks()
        {
            m_MetricsTrack = new MetricsTrack(this);
            AddGutterTrack(m_MetricsTrack);

            m_AnnotationsTrack = new AnnotationsTrack(this);
            AddTrack(m_AnnotationsTrack);

            m_ScrollViewContainer.AddManipulator(new TagCreationManipulator(this, m_AnnotationsTrack));

            m_BoundaryClipTrack = new BoundaryClipTrack(this);
            AddGutterTrack(m_BoundaryClipTrack);

            m_MarkerTrack = new MarkerTrack(this);
            AddGutterTrack(m_MarkerTrack);
        }
        public MarkerElement(MarkerAnnotation marker, MarkerTrack track) : base(track)
        {
            m_Track     = track;
            this.marker = marker;
            focusable   = true;

            m_Content = new VisualElement();
            m_Content.AddToClassList(k_MarkerStyleClass);
            m_BackgroundColor = AnnotationAttribute.GetColor(marker.payload.Type);
            var background = m_BackgroundColor;

            background.a = k_BackgroundAlpha;
            m_Content.style.backgroundColor = background;
            Add(m_Content);

            SetupManipulators(m_Content);

            m_ManipulateLabel = new Label();
            m_ManipulateLabel.AddToClassList("markerManipulateLabel");
            m_ManipulateLabel.style.visibility = Visibility.Hidden;
            Add(m_ManipulateLabel);

            style.position  = Position.Absolute;
            style.minHeight = 22;
            style.maxWidth  = 1;

            marker.Changed += Reposition;

            if (panel != null)
            {
                SetupTimelineGuideline(panel.visualTree);
            }
            else
            {
                RegisterCallback <AttachToPanelEvent>(OnAttachToPanel);
            }

            RegisterCallback <DetachFromPanelEvent>(OnDetachFromPanel);
        }