History

Initial work on rendering in main window, currently broken

ksuprynowicz committed 1 year ago

Commit 1415e2b1 parent 1c1a47a22 files · +535 −63Browse files

Showing the changes to interface/src/Application_UI.cpp (1 of 22 files). Show all

Unified · Split

interface/src/Application_UI.cpp+12−6
@@ -118,16 +118,22 @@ void Application::showDisplayPluginsTools(bool show) { · 117 unmodified lines
118118 DependencyManager::get<DialogsManager>()->hmdTools(show);
119119 }
120120
121+#ifdef USE_GL
121122 GLWidget* Application::getPrimaryWidget() {
122123 return _glWidget;
123124 }
125+#else
126+VKWidget* Application::getPrimaryWidget() {
127+ return _primaryWidget;
128+}
129+#endif
124130
125131 MainWindow* Application::getPrimaryWindow() {
126132 return getWindow();
127133 }
128134
129135 QOpenGLContext* Application::getPrimaryContext() {
130− return _glWidget->qglContext();
136+ return _primaryWidget->qglContext();
131137 }
132138
133139 bool Application::isForeground() const {
@@ -487,7 +493,7 @@ void Application::showDialog(const QUrl& widgetUrl, const QUrl& tabletUrl, const · 353 unmodified lines
487493 }
488494
489495 void Application::loadDialog() {
490− ModalDialogListener* dlg = OffscreenUi::getOpenFileNameAsync(_glWidget, tr("Open Script"),
496+ ModalDialogListener* dlg = OffscreenUi::getOpenFileNameAsync(_primaryWidget, tr("Open Script"),
491497 getPreviousScriptLocation(),
492498 tr("JavaScript Files (*.js)"));
493499 connect(dlg, &ModalDialogListener::response, this, [=, this] (QVariant answer) {
@@ -697,10 +703,10 @@ void Application::updateSystemTabletMode() { · 203 unmodified lines
697703 void Application::captureMouseChanged(bool captureMouse) {
698704 _captureMouse = captureMouse;
699705 if (_captureMouse) {
700− _glWidget->setCursor(QCursor(Qt::BlankCursor));
706+ _primaryWidget->setCursor(QCursor(Qt::BlankCursor));
701707 } else {
702708 _mouseCaptureTarget = QPointF(NAN, NAN);
703− _glWidget->unsetCursor();
709+ _primaryWidget->unsetCursor();
704710 }
705711 }
706712
@@ -1335,7 +1341,7 @@ void Application::toggleTabletUI(bool shouldOpen) const { · 628 unmodified lines
13351341 }
13361342
13371343 bool Application::shouldCaptureMouse() const {
1338− return _captureMouse && _glWidget->isActiveWindow() && !ui::Menu::isSomeSubmenuShown();
1344+ return _captureMouse && _primaryWidget->isActiveWindow() && !ui::Menu::isSomeSubmenuShown();
13391345 }
13401346
13411347 void Application::checkChangeCursor() {
@@ -1346,7 +1352,7 @@ void Application::checkChangeCursor() { · 4 unmodified lines
13461352 #else
13471353 // On windows and linux, hiding the top level cursor also means it's invisible when hovering over the
13481354 // window menu, which is a pain, so only hide it for the GL surface
1349− auto cursorTarget = _glWidget;
1355+ auto cursorTarget = _primaryWidget;
13501356 #endif
13511357 cursorTarget->setCursor(_desiredCursor);
13521358

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t