Showing the changes to interface/src/ui/ChatWindow.cpp (1 of 28 files). Show all
Unified · Split
| @@ -30,6 +30,9 @@ · 29 unmodified lines | |||
| 30 | 30 | ||
| 31 | const int NUM_MESSAGES_TO_TIME_STAMP = 20; | 31 | const int NUM_MESSAGES_TO_TIME_STAMP = 20; |
| 32 | 32 | ||
| 33 | const float OPACITY_ACTIVE = 1.0; | ||
| 34 | const float OPACITY_INACTIVE = 0.8; | ||
| 35 | |||
| 33 | const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)"); | 36 | const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)"); |
| 34 | const QRegularExpression regexHifiLinks("([#@]\\S+)"); | 37 | const QRegularExpression regexHifiLinks("([#@]\\S+)"); |
| 35 | const QString mentionSoundsPath("/mention-sounds/"); | 38 | const QString mentionSoundsPath("/mention-sounds/"); |
| @@ -108,7 +111,7 @@ ChatWindow::~ChatWindow() { · 72 unmodified lines | |||
| 108 | 111 | ||
| 109 | void ChatWindow::keyPressEvent(QKeyEvent* event) { | 112 | void ChatWindow::keyPressEvent(QKeyEvent* event) { |
| 110 | if (event->key() == Qt::Key_Escape) { | 113 | if (event->key() == Qt::Key_Escape) { |
| 111 | hide(); | 114 | Application::getInstance()->getWindow()->activateWindow(); |
| 112 | } else { | 115 | } else { |
| 113 | FramelessDialog::keyPressEvent(event); | 116 | FramelessDialog::keyPressEvent(event); |
| 114 | } | 117 | } |
| @@ -383,3 +386,12 @@ void ChatWindow::scrollToBottom() { · 268 unmodified lines | |||
| 383 | QScrollBar* verticalScrollBar = ui->messagesScrollArea->verticalScrollBar(); | 386 | QScrollBar* verticalScrollBar = ui->messagesScrollArea->verticalScrollBar(); |
| 384 | verticalScrollBar->setValue(verticalScrollBar->maximum()); | 387 | verticalScrollBar->setValue(verticalScrollBar->maximum()); |
| 385 | } | 388 | } |
| 389 | |||
| 390 | bool ChatWindow::event(QEvent* event) { | ||
| 391 | if (event->type() == QEvent::WindowActivate) { | ||
| 392 | setWindowOpacity(OPACITY_ACTIVE); | ||
| 393 | } else if (event->type() == QEvent::WindowDeactivate) { | ||
| 394 | setWindowOpacity(OPACITY_INACTIVE); | ||
| 395 | } | ||
| 396 | return FramelessDialog::event(event); | ||
| 397 | } | ||