Esempio n. 1
0
        protected override bool MouseDown(Event evt, WindowState state)
        {
            m_Target = PickerUtils.FirstPickedElementOfType <TrackResizeHandle>();
            if (m_Target == null)
            {
                return(false);
            }

            m_NumberOfContributingTracks = 1;
            var selectedTracks = SelectionManager.SelectedTrackGUI().ToList();

            if (selectedTracks.Any() && selectedTracks.Contains(m_Target.trackGUI)) //resize all selected tracks
            {
                var allTrackGui = state.GetWindow().treeView.allTrackGuis;
                m_TracksToResize              = allTrackGui.OfType <TimelineTrackGUI>().Where(i => SelectionManager.Contains(i.track)).ToList();
                m_NumberOfContributingTracks += m_TracksToResize.IndexOf(m_Target.trackGUI);
            }
            else
            {
                m_TracksToResize = new List <TimelineTrackGUI> {
                    m_Target.trackGUI
                }
            };

            m_Captured = true;
            state.AddCaptured(this);

            return(true);
        }
        public virtual void BeginRowGUI()
        {
            if (m_TreeView.GetTotalRect().width != GetRowRect(0).width)
            {
                CalculateRowRects();
            }

            m_DraggingInsertionMarkerRect.x = -1;

            m_TreeView.SetSelection(SelectionManager.SelectedTrackGUI().Select(t => t.id).ToArray(), false);
        }
Esempio n. 3
0
        bool ShouldShowTrackCurves()
        {
            if (m_TrackGUI == null)
            {
                return(false);
            }

            var isTrackSelected = SelectionManager.SelectedTrackGUI().FirstOrDefault(x => x == m_TrackGUI) != null;

            if (!isTrackSelected)
            {
                return(false);
            }

            return(TrackHasCurvesToShow());
        }
        public static void FrameTrackHeader(TreeViewItem treeItem = null)
        {
            if (TrackHeadActive())
            {
                treeItem = treeItem ?? SelectionManager.SelectedTrackGUI().Last();
            }
            else
            {
                var item = GetVisibleSelectedItems().LastOrDefault();
                treeItem = TimelineWindow.instance.allTracks.FirstOrDefault(
                    x => item != null && x.track == item.parentTrack);
            }

            if (treeItem != null)
            {
                TimelineWindow.instance.treeView.FrameItem(treeItem);
            }
        }