History

Merge remote-tracking branch 'upstream/master' into 19765

Mohammed Nafees committed 12 years ago

Commit d5d21072 parents 7271f85 c38790d28 files · +882 −153Browse files

Showing the changes to interface/src/ui/ChatWindow.cpp (1 of 28 files). Show all

Unified · Split

interface/src/ui/ChatWindow.cpp+13−1
@@ -30,6 +30,9 @@ · 29 unmodified lines
30 30
31const int NUM_MESSAGES_TO_TIME_STAMP = 20;31const int NUM_MESSAGES_TO_TIME_STAMP = 20;
32 32
33const float OPACITY_ACTIVE = 1.0;
34const float OPACITY_INACTIVE = 0.8;
35
33const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)");36const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)");
34const QRegularExpression regexHifiLinks("([#@]\\S+)");37const QRegularExpression regexHifiLinks("([#@]\\S+)");
35const QString mentionSoundsPath("/mention-sounds/");38const QString mentionSoundsPath("/mention-sounds/");
@@ -108,7 +111,7 @@ ChatWindow::~ChatWindow() { · 72 unmodified lines
108 111
109void ChatWindow::keyPressEvent(QKeyEvent* event) {112void 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
390bool 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}