From 1e5b2d7c668fe2d415159916508c954c4050a6f7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 21 Jun 2016 20:02:45 +0300 Subject: [PATCH] Fix attempt of photo forward by drag-n-drop: for being able to use press data in drop call ClickHandler::unpressed() after drag->exec(). Members dropdown area made smaller (only the members/online text rect). --- Telegram/SourceFiles/historywidget.cpp | 9 +++------ Telegram/SourceFiles/overviewwidget.cpp | 4 ++-- Telegram/SourceFiles/ui/flatlabel.cpp | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 655465aaa..de143780c 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -907,10 +907,10 @@ void HistoryInner::onDragExec() { mimeData->setData(qsl("application/x-td-forward-selected"), "1"); } drag->setMimeData(mimeData); + drag->exec(Qt::CopyAction); // We don't receive mouseReleaseEvent when drag is finished. ClickHandler::unpressed(); - drag->exec(Qt::CopyAction); if (App::main()) App::main()->updateAfterDrag(); return; } else { @@ -944,10 +944,10 @@ void HistoryInner::onDragExec() { } drag->setMimeData(mimeData); + drag->exec(Qt::CopyAction); // We don't receive mouseReleaseEvent when drag is finished. ClickHandler::unpressed(); - drag->exec(Qt::CopyAction); if (App::main()) App::main()->updateAfterDrag(); return; } @@ -6027,13 +6027,10 @@ void HistoryWidget::paintTopBar(Painter &p, float64 over, int32 decreaseWidth) { QRect HistoryWidget::getMembersShowAreaGeometry() const { int increaseLeft = Adaptive::OneColumn() ? (st::topBarForwardPadding.right() - st::topBarForwardPadding.left()) : 0; int membersTextLeft = st::topBarForwardPadding.left() + increaseLeft; - int membersTextTop = st::topBarHeight - st::topBarForwardPadding.bottom() - st::dialogsTextFont->height - st::topBarForwardPadding.bottom(); + int membersTextTop = st::topBarHeight - st::topBarForwardPadding.bottom() - st::dialogsTextFont->height; int membersTextWidth = _titlePeerTextWidth; int membersTextHeight = st::topBarHeight - membersTextTop; - membersTextLeft -= st::topBarForwardPadding.left(); - membersTextWidth += 2 * st::topBarForwardPadding.left(); - return rtlrect(membersTextLeft, membersTextTop, membersTextWidth, membersTextHeight, width()); } diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 5824086b7..6bda8abf7 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -609,10 +609,10 @@ void OverviewInner::onDragExec() { mimeData->setData(qsl("application/x-td-forward-selected"), "1"); } drag->setMimeData(mimeData); + drag->exec(Qt::CopyAction); // We don't receive mouseReleaseEvent when drag is finished. ClickHandler::unpressed(); - drag->exec(Qt::CopyAction); if (App::main()) App::main()->updateAfterDrag(); return; } else { @@ -640,10 +640,10 @@ void OverviewInner::onDragExec() { } drag->setMimeData(mimeData); + drag->exec(Qt::CopyAction); // We don't receive mouseReleaseEvent when drag is finished. ClickHandler::unpressed(); - drag->exec(Qt::CopyAction); if (App::main()) App::main()->updateAfterDrag(); return; } diff --git a/Telegram/SourceFiles/ui/flatlabel.cpp b/Telegram/SourceFiles/ui/flatlabel.cpp index e8ac1c599..982895d90 100644 --- a/Telegram/SourceFiles/ui/flatlabel.cpp +++ b/Telegram/SourceFiles/ui/flatlabel.cpp @@ -478,10 +478,10 @@ void FlatLabel::onExecuteDrag() { mimeData->setText(selectedText); auto drag = new QDrag(App::wnd()); drag->setMimeData(mimeData); + drag->exec(Qt::CopyAction); // We don't receive mouseReleaseEvent when drag is finished. ClickHandler::unpressed(); - drag->exec(Qt::CopyAction); } }