mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 20:34:07 +02:00
commit
1992f624ad
3 changed files with 15 additions and 1 deletions
|
@ -1293,6 +1293,7 @@ void Menu::showChat() {
|
|||
if (_chatWindow->isHidden()) {
|
||||
_chatWindow->show();
|
||||
}
|
||||
_chatWindow->activateWindow();
|
||||
} else {
|
||||
Application::getInstance()->getTrayIcon()->showMessage("Interface", "You need to login to be able to chat with others on this domain.");
|
||||
}
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
|
||||
const int NUM_MESSAGES_TO_TIME_STAMP = 20;
|
||||
|
||||
const float OPACITY_ACTIVE = 1.0;
|
||||
const float OPACITY_INACTIVE = 0.8;
|
||||
|
||||
const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)");
|
||||
const QRegularExpression regexHifiLinks("([#@]\\S+)");
|
||||
const QString mentionSoundsPath("/mention-sounds/");
|
||||
|
@ -108,7 +111,7 @@ ChatWindow::~ChatWindow() {
|
|||
|
||||
void ChatWindow::keyPressEvent(QKeyEvent* event) {
|
||||
if (event->key() == Qt::Key_Escape) {
|
||||
hide();
|
||||
Application::getInstance()->getWindow()->activateWindow();
|
||||
} else {
|
||||
FramelessDialog::keyPressEvent(event);
|
||||
}
|
||||
|
@ -383,3 +386,12 @@ void ChatWindow::scrollToBottom() {
|
|||
QScrollBar* verticalScrollBar = ui->messagesScrollArea->verticalScrollBar();
|
||||
verticalScrollBar->setValue(verticalScrollBar->maximum());
|
||||
}
|
||||
|
||||
bool ChatWindow::event(QEvent* event) {
|
||||
if (event->type() == QEvent::WindowActivate) {
|
||||
setWindowOpacity(OPACITY_ACTIVE);
|
||||
} else if (event->type() == QEvent::WindowDeactivate) {
|
||||
setWindowOpacity(OPACITY_INACTIVE);
|
||||
}
|
||||
return FramelessDialog::event(event);
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ protected:
|
|||
|
||||
virtual void keyPressEvent(QKeyEvent *event);
|
||||
virtual void showEvent(QShowEvent* event);
|
||||
virtual bool event(QEvent* event);
|
||||
|
||||
private:
|
||||
#ifdef HAVE_QXMPP
|
||||
|
|
Loading…
Reference in a new issue