Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -51,7 +51,7 @@ WindowScriptingInterface::WindowScriptingInterface() { · 50 unmodified lines | |||
| 51 | } | 51 | } |
| 52 | }); | 52 | }); |
| 53 | 53 | ||
| 54 | connect(qApp->getWindow(), &MainWindow::windowGeometryChanged, this, &WindowScriptingInterface::geometryChanged); | 54 | connect(qApp->getWindow(), &MainWindow::windowGeometryChanged, this, &WindowScriptingInterface::onWindowGeometryChanged); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | WindowScriptingInterface::~WindowScriptingInterface() { | 57 | WindowScriptingInterface::~WindowScriptingInterface() { |
| @@ -397,6 +397,15 @@ int WindowScriptingInterface::getY() { · 339 unmodified lines | |||
| 397 | return qApp->getWindow()->y(); | 397 | return qApp->getWindow()->y(); |
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | void WindowScriptingInterface::onWindowGeometryChanged(const QRect& windowGeometry) { | ||
| 401 | auto geometry = windowGeometry; | ||
| 402 | auto menu = qApp->getPrimaryMenu(); | ||
| 403 | if (menu) { | ||
| 404 | geometry.setHeight(geometry.height() - menu->geometry().height()); | ||
| 405 | } | ||
| 406 | emit geometryChanged(geometry); | ||
| 407 | } | ||
| 408 | |||
| 400 | void WindowScriptingInterface::copyToClipboard(const QString& text) { | 409 | void WindowScriptingInterface::copyToClipboard(const QString& text) { |
| 401 | if (QThread::currentThread() != qApp->thread()) { | 410 | if (QThread::currentThread() != qApp->thread()) { |
| 402 | QMetaObject::invokeMethod(this, "copyToClipboard", Q_ARG(QString, text)); | 411 | QMetaObject::invokeMethod(this, "copyToClipboard", Q_ARG(QString, text)); |