diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2018-02-06 08:45:34 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2018-02-06 09:16:12 +0000 |
commit | c326903a6d7bc3139f85d0013c6ef48260ff37c0 (patch) | |
tree | be9ecd5f0b1085595f66267bad365959044d68a4 /src/Authoring/Studio/Palettes/Slide | |
parent | c22548b09b7c47a0a8831f687628cfa91cb8b281 (diff) |
Make data input choosers act uniformly
Inspector palette had a different look to its data input chooser than
the other two. Also updated the look of the dialog, and now it is shown
next to the data input icon, instead of in the middle of the screen.
Task-number: QT3DS-950
Change-Id: I48e16c3b26066e06dba16c106e93f986e1523558
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/Slide')
-rw-r--r-- | src/Authoring/Studio/Palettes/Slide/SlideView.cpp | 9 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/Slide/SlideView.h | 2 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/Slide/SlideView.qml | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp index 67203acc..fe05ad72 100644 --- a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp +++ b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp @@ -65,6 +65,7 @@ SlideView::~SlideView() { clearSlideList(); g_StudioApp.GetCore()->GetDispatch()->RemovePresentationChangeListener(this); + delete m_dataInputSelector; } bool SlideView::showMasterSlide() const @@ -114,7 +115,7 @@ void SlideView::setShowMasterSlide(bool show) Q_EMIT currentModelChanged(); } -void SlideView::showControllerDialog() +void SlideView::showControllerDialog(const QPoint &point) { QStringList dataInputList; dataInputList.append(tr("[No control]")); @@ -125,7 +126,7 @@ void SlideView::showControllerDialog() QString currCtr = m_currentController.size() ? m_currentController : tr("[No control]"); m_dataInputSelector->setData(dataInputList, currCtr); - m_dataInputSelector->showDialog(); + m_dataInputSelector->showDialog(point); return; } @@ -351,8 +352,8 @@ void SlideView::initialize() connect(m_dataInputSelector, &DataInputSelectDlg::dataInputChanged, this, &SlideView::onDataInputChange); m_dataInputSelector->hide(); - m_dataInputSelector->setWindowModality(Qt::WindowModality::WindowModal); - m_dataInputSelector->setWindowFlags(Qt::Tool | Qt::Dialog); + m_dataInputSelector->setWindowModality(Qt::WindowModality::ApplicationModal); + m_dataInputSelector->setWindowFlags(Qt::Popup); m_dataInputSelector->setWindowTitle(tr("Select slide controller")); } diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.h b/src/Authoring/Studio/Palettes/Slide/SlideView.h index 63b293d2..12594637 100644 --- a/src/Authoring/Studio/Palettes/Slide/SlideView.h +++ b/src/Authoring/Studio/Palettes/Slide/SlideView.h @@ -74,7 +74,7 @@ public: Q_INVOKABLE void moveSlide(int from, int to); Q_INVOKABLE void finishSlideRearrange(bool commit); Q_INVOKABLE void showContextMenu(int x, int y, int row); - Q_INVOKABLE void showControllerDialog(); + Q_INVOKABLE void showControllerDialog(const QPoint &point); // Presentation Change Listener void OnNewPresentation() override; diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.qml b/src/Authoring/Studio/Palettes/Slide/SlideView.qml index 8e593892..12e9c468 100644 --- a/src/Authoring/Studio/Palettes/Slide/SlideView.qml +++ b/src/Authoring/Studio/Palettes/Slide/SlideView.qml @@ -311,7 +311,7 @@ Rectangle { hoverEnabled: true acceptedButtons: Qt.LeftButton onClicked: { - _slideView.showControllerDialog(); + _slideView.showControllerDialog(mapToGlobal(mouse.x, mouse.y)); } } Image { |