File dialogs and modal message boxes in QML
Showing the changes to interface/src/Application.cpp (1 of 59 files). Show all
Unified · Split
| @@ -80,7 +80,6 @@ · 79 unmodified lines | ||
| 80 | 80 | #include <controllers/StateController.h> |
| 81 | 81 | #include <LogHandler.h> |
| 82 | 82 | #include <MainWindow.h> |
| 83 | −#include <MessageDialog.h> | |
| 84 | 83 | #include <MessagesClient.h> |
| 85 | 84 | #include <ModelEntityItem.h> |
| 86 | 85 | #include <NetworkAccessManager.h> |
| @@ -149,7 +148,6 @@ · 62 unmodified lines | ||
| 149 | 148 | #endif |
| 150 | 149 | #include "Stars.h" |
| 151 | 150 | #include "ui/AddressBarDialog.h" |
| 152 | −#include "ui/RecorderDialog.h" | |
| 153 | 151 | #include "ui/AvatarInputs.h" |
| 154 | 152 | #include "ui/AssetUploadDialogFactory.h" |
| 155 | 153 | #include "ui/DataWebDialog.h" |
| @@ -1176,10 +1174,8 @@ void Application::initializeGL() { · 1020 unmodified lines | ||
| 1176 | 1174 | |
| 1177 | 1175 | void Application::initializeUi() { |
| 1178 | 1176 | AddressBarDialog::registerType(); |
| 1179 | − RecorderDialog::registerType(); | |
| 1180 | 1177 | ErrorDialog::registerType(); |
| 1181 | 1178 | LoginDialog::registerType(); |
| 1182 | − MessageDialog::registerType(); | |
| 1183 | 1179 | VrMenu::registerType(); |
| 1184 | 1180 | Tooltip::registerType(); |
| 1185 | 1181 | UpdateDialog::registerType(); |
| @@ -1843,14 +1839,6 @@ void Application::keyPressEvent(QKeyEvent* event) { · 657 unmodified lines | ||
| 1843 | 1839 | } |
| 1844 | 1840 | break; |
| 1845 | 1841 | |
| 1846 | − case Qt::Key_X: | |
| 1847 | − if (isMeta && isShifted) { | |
| 1848 | −// auto offscreenUi = DependencyManager::get<OffscreenUi>(); | |
| 1849 | −// offscreenUi->load("TestControllers.qml"); | |
| 1850 | − RecorderDialog::toggle(); | |
| 1851 | − } | |
| 1852 | − break; | |
| 1853 | − | |
| 1854 | 1842 | case Qt::Key_L: |
| 1855 | 1843 | if (isShifted && isMeta) { |
| 1856 | 1844 | Menu::getInstance()->triggerOption(MenuOption::Log); |
| @@ -2203,6 +2191,11 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 346 unmodified lines | ||
| 2203 | 2191 | _altPressed = false; |
| 2204 | 2192 | |
| 2205 | 2193 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 2194 | + // If we get a mouse press event it means it wasn't consumed by the offscreen UI, | |
| 2195 | + // hence, we should defocus all of the offscreen UI windows, in order to allow | |
| 2196 | + // keyboard shortcuts not to be swallowed by them. In particular, WebEngineViews | |
| 2197 | + // will consume all keyboard events. | |
| 2198 | + offscreenUi->unfocusWindows(); | |
| 2206 | 2199 | QPointF transformedPos = offscreenUi->mapToVirtualScreen(event->localPos(), _glWidget); |
| 2207 | 2200 | QMouseEvent mappedEvent(event->type(), |
| 2208 | 2201 | transformedPos, |
| @@ -4536,7 +4529,7 @@ bool Application::displayAvatarAttachmentConfirmationDialog(const QString& name) · 2327 unmodified lines | ||
| 4536 | 4529 | |
| 4537 | 4530 | void Application::toggleRunningScriptsWidget() { |
| 4538 | 4531 | static const QUrl url("dialogs/RunningScripts.qml"); |
| 4539 | − DependencyManager::get<OffscreenUi>()->toggle(url, "RunningScripts"); | |
| 4532 | + DependencyManager::get<OffscreenUi>()->show(url, "RunningScripts"); | |
| 4540 | 4533 | //if (_runningScriptsWidget->isVisible()) { |
| 4541 | 4534 | // if (_runningScriptsWidget->hasFocus()) { |
| 4542 | 4535 | // _runningScriptsWidget->hide(); |