mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +02:00
Add margin to chat window for titlebar + menu
This commit is contained in:
parent
bbc1bbdf47
commit
51e616d122
2 changed files with 14 additions and 5 deletions
|
@ -1456,7 +1456,9 @@ void Menu::showChat() {
|
|||
if (_chatWindow->isHidden()) {
|
||||
_chatWindow->show();
|
||||
}
|
||||
_chatWindow->raise();
|
||||
_chatWindow->activateWindow();
|
||||
_chatWindow->setFocus();
|
||||
} else {
|
||||
Application::getInstance()->getTrayIcon()->showMessage("Interface", "You need to login to be able to chat with others on this domain.");
|
||||
}
|
||||
|
@ -1468,6 +1470,9 @@ void Menu::toggleChat() {
|
|||
if (!_chatAction->isEnabled() && _chatWindow && AccountManager::getInstance().isLoggedIn()) {
|
||||
if (_chatWindow->isHidden()) {
|
||||
_chatWindow->show();
|
||||
_chatWindow->raise();
|
||||
_chatWindow->activateWindow();
|
||||
_chatWindow->setFocus();
|
||||
} else {
|
||||
_chatWindow->hide();
|
||||
}
|
||||
|
|
|
@ -18,12 +18,13 @@
|
|||
#include <QTimer>
|
||||
|
||||
#include "Application.h"
|
||||
#include "ChatMessageArea.h"
|
||||
#include "FlowLayout.h"
|
||||
#include "qtimespan.h"
|
||||
#include "ui_chatWindow.h"
|
||||
#include "UIUtil.h"
|
||||
#include "XmppClient.h"
|
||||
#include "ChatMessageArea.h"
|
||||
|
||||
#include "ui_chatWindow.h"
|
||||
#include "ChatWindow.h"
|
||||
|
||||
|
||||
|
@ -120,10 +121,13 @@ void ChatWindow::showEvent(QShowEvent* event) {
|
|||
if (!event->spontaneous()) {
|
||||
ui->messagePlainTextEdit->setFocus();
|
||||
}
|
||||
|
||||
const QRect parentGeometry = parentWidget()->geometry();
|
||||
setGeometry(parentGeometry.topRight().x() - size().width(), parentGeometry.topRight().y(),
|
||||
size().width(), parentWidget()->height());
|
||||
int titleBarHeight = UIUtil::getWindowTitleBarHeight(this);
|
||||
int menuBarHeight = Menu::getInstance()->geometry().height();
|
||||
int topMargin = titleBarHeight + menuBarHeight;
|
||||
|
||||
setGeometry(parentGeometry.topRight().x() - size().width() + 1, parentGeometry.topRight().y() + topMargin,
|
||||
size().width(), parentWidget()->height() - topMargin);
|
||||
|
||||
#ifdef HAVE_QXMPP
|
||||
const QXmppClient& xmppClient = XmppClient::getInstance().getXMPPClient();
|
||||
|
|
Loading…
Reference in a new issue