mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:48:38 +02:00
Fix window height reported by Window.geometryChanged() signal
This commit is contained in:
parent
9dcef996c5
commit
63603ff97c
2 changed files with 11 additions and 1 deletions
|
@ -51,7 +51,7 @@ WindowScriptingInterface::WindowScriptingInterface() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(qApp->getWindow(), &MainWindow::windowGeometryChanged, this, &WindowScriptingInterface::geometryChanged);
|
connect(qApp->getWindow(), &MainWindow::windowGeometryChanged, this, &WindowScriptingInterface::onWindowGeometryChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowScriptingInterface::~WindowScriptingInterface() {
|
WindowScriptingInterface::~WindowScriptingInterface() {
|
||||||
|
@ -397,6 +397,15 @@ int WindowScriptingInterface::getY() {
|
||||||
return qApp->getWindow()->y();
|
return qApp->getWindow()->y();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowScriptingInterface::onWindowGeometryChanged(const QRect& windowGeometry) {
|
||||||
|
auto geometry = windowGeometry;
|
||||||
|
auto menu = qApp->getPrimaryMenu();
|
||||||
|
if (menu) {
|
||||||
|
geometry.setHeight(geometry.height() - menu->geometry().height());
|
||||||
|
}
|
||||||
|
emit geometryChanged(geometry);
|
||||||
|
}
|
||||||
|
|
||||||
void WindowScriptingInterface::copyToClipboard(const QString& text) {
|
void WindowScriptingInterface::copyToClipboard(const QString& text) {
|
||||||
if (QThread::currentThread() != qApp->thread()) {
|
if (QThread::currentThread() != qApp->thread()) {
|
||||||
QMetaObject::invokeMethod(this, "copyToClipboard", Q_ARG(QString, text));
|
QMetaObject::invokeMethod(this, "copyToClipboard", Q_ARG(QString, text));
|
||||||
|
|
|
@ -522,6 +522,7 @@ public slots:
|
||||||
void closeMessageBox(int id);
|
void closeMessageBox(int id);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void onWindowGeometryChanged(const QRect& geometry);
|
||||||
void onMessageBoxSelected(int button);
|
void onMessageBoxSelected(int button);
|
||||||
void disconnectedFromDomain();
|
void disconnectedFromDomain();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue