mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Screen grabber: Fix flying-flyout bug when resizing window while open
This commit is contained in:
parent
f982938919
commit
f14c399297
2
qtox.pro
2
qtox.pro
|
@ -432,7 +432,7 @@ SOURCES += \
|
|||
src/core/corefile.cpp \
|
||||
src/core/corestructs.cpp \
|
||||
src/profilelocker.cpp \
|
||||
src/avatarbroadcaster.cpp
|
||||
src/avatarbroadcaster.cpp \
|
||||
src/widget/tool/screenshotgrabber.cpp \
|
||||
src/widget/tool/screengrabberchooserrectitem.cpp \
|
||||
src/widget/tool/screengrabberoverlayitem.cpp \
|
||||
|
|
|
@ -79,7 +79,6 @@ public slots:
|
|||
void onVolMuteToggle();
|
||||
void onAvatarChange(uint32_t FriendId, const QPixmap& pic);
|
||||
void onAvatarRemoved(uint32_t FriendId);
|
||||
void onAttachContext(const QPoint &pos);
|
||||
|
||||
private slots:
|
||||
void onSendTriggered();
|
||||
|
|
|
@ -192,12 +192,17 @@ GenericChatForm::GenericChatForm(QWidget *parent)
|
|||
fileFlyout->installEventFilter(this);
|
||||
}
|
||||
|
||||
void GenericChatForm::adjustFileMenuPosition()
|
||||
{
|
||||
QPoint pos = fileButton->pos();
|
||||
QSize size = fileFlyout->size();
|
||||
fileFlyout->move(pos.x() - size.width(), pos.y());
|
||||
}
|
||||
|
||||
void GenericChatForm::showFileMenu()
|
||||
{
|
||||
if (!fileFlyout->isShown() && !fileFlyout->isBeingShown()) {
|
||||
QPoint pos = fileButton->pos();
|
||||
QSize size = fileFlyout->size();
|
||||
fileFlyout->move(pos.x() - size.width(), pos.y());
|
||||
adjustFileMenuPosition();
|
||||
}
|
||||
|
||||
fileFlyout->animateShow();
|
||||
|
@ -416,6 +421,12 @@ void GenericChatForm::hideEvent(QHideEvent* event)
|
|||
QWidget::hideEvent(event);
|
||||
}
|
||||
|
||||
void GenericChatForm::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
adjustFileMenuPosition();
|
||||
QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
bool GenericChatForm::eventFilter(QObject* object, QEvent* event)
|
||||
{
|
||||
if (object != this->fileButton && object != this->fileFlyout)
|
||||
|
|
|
@ -85,6 +85,8 @@ protected:
|
|||
QString resolveToxID(const ToxID &id);
|
||||
void insertChatMessage(ChatMessage::Ptr msg);
|
||||
void hideEvent(QHideEvent* event);
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void adjustFileMenuPosition();
|
||||
|
||||
ToxID previousId;
|
||||
QDateTime prevMsgDateTime;
|
||||
|
|
Loading…
Reference in New Issue
Block a user