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).
This commit is contained in:
John Preston 2016-06-21 20:02:45 +03:00
parent af4b3ba023
commit 1e5b2d7c66
3 changed files with 6 additions and 9 deletions

View File

@ -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());
}

View File

@ -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;
}

View File

@ -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);
}
}