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 | 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 | 36 | const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)"); |
| 34 | 37 | const QRegularExpression regexHifiLinks("([#@]\\S+)"); |
| 35 | 38 | const QString mentionSoundsPath("/mention-sounds/"); |
| @@ -108,7 +111,7 @@ ChatWindow::~ChatWindow() { · 72 unmodified lines | ||
| 108 | 111 | |
| 109 | 112 | void ChatWindow::keyPressEvent(QKeyEvent* event) { |
| 110 | 113 | if (event->key() == Qt::Key_Escape) { |
| 111 | − hide(); | |
| 114 | + Application::getInstance()->getWindow()->activateWindow(); | |
| 112 | 115 | } else { |
| 113 | 116 | FramelessDialog::keyPressEvent(event); |
| 114 | 117 | } |
| @@ -383,3 +386,12 @@ void ChatWindow::scrollToBottom() { · 268 unmodified lines | ||
| 383 | 386 | QScrollBar* verticalScrollBar = ui->messagesScrollArea->verticalScrollBar(); |
| 384 | 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 | +} | |