diff options
author | Kaj Grönholm <kaj.gronholm@qt.io> | 2018-03-02 12:43:39 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-03-02 12:53:29 +0000 |
commit | b22771e6953c7f0d25decaae4dabeff9a520ecd9 (patch) | |
tree | 169d45327924450de3f40b49e91c54b2f6ee6622 | |
parent | 5749e7af1f0ce7aefb842ea348aebc83897250da (diff) |
Slide view highlight to follow active slide #2
When fixing QT3DS-1195 didn't know this affects also undo.
So highlight to follow all the time, not just during playback.
Task-number: QT3DS-684
Change-Id: I186b07cac20332dc38ccb362b800e8a3f5a4a683
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/Authoring/Studio/Palettes/Slide/SlideModel.cpp | 3 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/Slide/SlideView.cpp | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideModel.cpp b/src/Authoring/Studio/Palettes/Slide/SlideModel.cpp index 308af8a1..75d5a266 100644 --- a/src/Authoring/Studio/Palettes/Slide/SlideModel.cpp +++ b/src/Authoring/Studio/Palettes/Slide/SlideModel.cpp @@ -384,7 +384,8 @@ void SlideModel::refreshSlideLabel(qt3dsdm::Qt3DSDMInstanceHandle instanceHandle // Set selected slide highlight on UI void SlideModel::setSelectedSlideIndex(const QModelIndex &index) { - if (!hasIndex(index.row(), index.column(), index.parent())) + if (m_selectedRow == index.row() || + !hasIndex(index.row(), index.column(), index.parent())) return; m_selectedRow = index.row(); diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp index 5ffea440..12f88643 100644 --- a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp +++ b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp @@ -227,12 +227,10 @@ void SlideView::OnActiveSlide(const qt3dsdm::Qt3DSDMSlideHandle &inMaster, int i setShowMasterSlide(currentSlideIndex == 0); setActiveSlide(inSlide); - // During playback update slide highlight - if (GetDoc()->IsPlaying()) { - // -1 because first slide is masterslide - auto index = m_SlidesModel->index(currentSlideIndex - 1, 0); - m_SlidesModel->setSelectedSlideIndex(index); - } + // Update slide highlight to match active slide + // -1 because first slide is masterslide + auto index = m_SlidesModel->index(currentSlideIndex - 1, 0); + m_SlidesModel->setSelectedSlideIndex(index); } |