|
|
|
@ -226,7 +226,7 @@ GenericChatForm::~GenericChatForm()
@@ -226,7 +226,7 @@ GenericChatForm::~GenericChatForm()
|
|
|
|
|
|
|
|
|
|
void GenericChatForm::adjustFileMenuPosition() |
|
|
|
|
{ |
|
|
|
|
QPoint pos = fileButton->pos(); |
|
|
|
|
QPoint pos = fileButton->mapTo(bodySplitter, QPoint()); |
|
|
|
|
QSize size = fileFlyout->size(); |
|
|
|
|
fileFlyout->move(pos.x() - size.width(), pos.y()); |
|
|
|
|
} |
|
|
|
@ -244,7 +244,6 @@ void GenericChatForm::hideFileMenu()
@@ -244,7 +244,6 @@ void GenericChatForm::hideFileMenu()
|
|
|
|
|
{ |
|
|
|
|
if(fileFlyout->isShown() || fileFlyout->isBeingShown()) |
|
|
|
|
fileFlyout->animateHide(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool GenericChatForm::isEmpty() |
|
|
|
@ -506,8 +505,8 @@ void GenericChatForm::resizeEvent(QResizeEvent* event)
@@ -506,8 +505,8 @@ void GenericChatForm::resizeEvent(QResizeEvent* event)
|
|
|
|
|
|
|
|
|
|
bool GenericChatForm::eventFilter(QObject* object, QEvent* event) |
|
|
|
|
{ |
|
|
|
|
EmoticonsWidget * ev = qobject_cast<EmoticonsWidget *>(object); |
|
|
|
|
if (( ev) && (event->type() == QEvent::KeyPress) ) |
|
|
|
|
EmoticonsWidget* ev = qobject_cast<EmoticonsWidget*>(object); |
|
|
|
|
if (ev && event->type() == QEvent::KeyPress) |
|
|
|
|
{ |
|
|
|
|
QKeyEvent* key = static_cast<QKeyEvent*>(event); |
|
|
|
|
msgEdit->sendKeyEvent(key); |
|
|
|
@ -527,15 +526,21 @@ bool GenericChatForm::eventFilter(QObject* object, QEvent* event)
@@ -527,15 +526,21 @@ bool GenericChatForm::eventFilter(QObject* object, QEvent* event)
|
|
|
|
|
showFileMenu(); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case QEvent::Leave: { |
|
|
|
|
QPoint pos = mapFromGlobal(QCursor::pos()); |
|
|
|
|
QRect fileRect(fileFlyout->pos(), fileFlyout->size()); |
|
|
|
|
fileRect = fileRect.united(QRect(fileButton->pos(), fileButton->size())); |
|
|
|
|
case QEvent::Leave: |
|
|
|
|
{ |
|
|
|
|
QPoint flyPos = fileFlyout->mapToGlobal(QPoint()); |
|
|
|
|
QSize flySize = fileFlyout->size(); |
|
|
|
|
|
|
|
|
|
QPoint filePos = fileButton->mapToGlobal(QPoint()); |
|
|
|
|
QSize fileSize = fileButton->size(); |
|
|
|
|
|
|
|
|
|
if (!fileRect.contains(pos)) |
|
|
|
|
QRect region = QRect(flyPos, flySize).united(QRect(filePos, fileSize)); |
|
|
|
|
|
|
|
|
|
if (!region.contains(QCursor::pos())) |
|
|
|
|
hideFileMenu(); |
|
|
|
|
|
|
|
|
|
} break; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case QEvent::MouseButtonPress: |
|
|
|
|
hideFileMenu(); |
|
|
|
|