Unset the transient parent on separate chat windows

relates to #1168
gst-experiments
Nicolas Werner 2 years ago
parent 130e1b43fb
commit 01fd5e6b61
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 8
      resources/qml/RoomList.qml
  2. 7
      src/ui/NhekoGlobalObject.cpp
  3. 2
      src/ui/NhekoGlobalObject.h

@ -74,7 +74,10 @@ Page {
property var room: null
property var roomPreview: null
Component.onCompleted: MainWindow.addPerRoomWindow(room.roomId || roomPreview.roomid, roomWindowW)
Component.onCompleted: {
MainWindow.addPerRoomWindow(room.roomId || roomPreview.roomid, roomWindowW);
Nheko.setTransientParent(roomWindowW, null);
}
Component.onDestruction: MainWindow.removePerRoomWindow(room.roomId || roomPreview.roomid, roomWindowW)
height: 650
@ -84,8 +87,7 @@ Page {
palette: Nheko.colors
color: Nheko.colors.window
title: room.plainRoomName
modality: Qt.NonModal
flags: Qt.Window | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
//flags: Qt.Window | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
Shortcut {
sequence: StandardKey.Cancel

@ -128,6 +128,13 @@ Nheko::logout() const
ChatPage::instance()->initiateLogout();
}
void
Nheko::setTransientParent(QWindow *window, QWindow *parentWindow) const
{
if (window)
window->setTransientParent(parentWindow);
}
void
Nheko::createRoom(QString name, QString topic, QString aliasLocalpart, bool isEncrypted, int preset)
{

@ -8,6 +8,7 @@
#include <QFontDatabase>
#include <QObject>
#include <QPalette>
#include <QWindow>
#include "AliasEditModel.h"
#include "PowerlevelsEditModels.h"
@ -65,6 +66,7 @@ public:
{
return new AliasEditingModel(room_id_.toStdString());
}
Q_INVOKABLE void setTransientParent(QWindow *window, QWindow *parentWindow) const;
public slots:
void updateUserProfile();

Loading…
Cancel
Save