mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Hid inline add-option for polls on message selection and swipe gestures.
This commit is contained in:
@@ -498,6 +498,7 @@ HistoryInner::HistoryInner(
|
||||
controller->adaptive().chatWideValue(
|
||||
) | rpl::on_next([=](bool wide) {
|
||||
_isChatWide = wide;
|
||||
_overlayHost->hide();
|
||||
}, lifetime());
|
||||
|
||||
_selectScroll.scrolls(
|
||||
@@ -698,6 +699,7 @@ void HistoryInner::setupSwipeReplyAndBack() {
|
||||
if (!canReply) {
|
||||
return true;
|
||||
}
|
||||
_overlayHost->hide();
|
||||
result.msgBareId = item->fullId().msg.bare;
|
||||
result.callback = [=, itemId = item->fullId()] {
|
||||
const auto still = show->session().data().message(itemId);
|
||||
@@ -3665,6 +3667,9 @@ void HistoryInner::copyContextText(FullMsgId itemId) {
|
||||
}
|
||||
|
||||
void HistoryInner::resizeEvent(QResizeEvent *e) {
|
||||
if (e->oldSize().width() != e->size().width()) {
|
||||
_overlayHost->hide();
|
||||
}
|
||||
mouseActionUpdate();
|
||||
}
|
||||
|
||||
@@ -4260,6 +4265,9 @@ HistoryView::SelectionModeResult HistoryInner::inSelectionMode() const {
|
||||
const auto now = inSelectionMode;
|
||||
if (_lastInSelectionMode != now) {
|
||||
_lastInSelectionMode = now;
|
||||
if (now) {
|
||||
_overlayHost->hide();
|
||||
}
|
||||
if (_inSelectionModeAnimation.animating()) {
|
||||
const auto progress = !now
|
||||
? _inSelectionModeAnimation.value(0.)
|
||||
|
||||
@@ -1054,6 +1054,7 @@ void ChatWidget::setupSwipeReplyAndBack() {
|
||||
return result;
|
||||
}
|
||||
|
||||
_inner->hideElementOverlay();
|
||||
result.msgBareId = view->data()->fullId().msg.bare;
|
||||
result.callback = [=, itemId = view->data()->fullId()] {
|
||||
const auto still = show->session().data().message(itemId);
|
||||
|
||||
@@ -572,6 +572,7 @@ ListWidget::ListWidget(
|
||||
_delegate->listChatWideValue(
|
||||
) | rpl::on_next([=](bool wide) {
|
||||
_isChatWide = wide;
|
||||
_overlayHost->hide();
|
||||
}, lifetime());
|
||||
|
||||
_selectScroll.scrolls(
|
||||
@@ -1317,6 +1318,9 @@ SelectionModeResult ListWidget::inSelectionMode() const {
|
||||
|| (_mouseAction == MouseAction::Selecting && _lastInSelectionMode);
|
||||
if (_lastInSelectionMode != now) {
|
||||
_lastInSelectionMode = now;
|
||||
if (now) {
|
||||
_overlayHost->hide();
|
||||
}
|
||||
if (_inSelectionModeAnimation.animating()) {
|
||||
const auto progress = !now
|
||||
? _inSelectionModeAnimation.value(0.)
|
||||
@@ -1918,6 +1922,10 @@ void ListWidget::elementSubmitAddPollOption(FullMsgId context) {
|
||||
_overlayHost->triggerSubmit(context);
|
||||
}
|
||||
|
||||
void ListWidget::hideElementOverlay() {
|
||||
_overlayHost->hide();
|
||||
}
|
||||
|
||||
void ListWidget::elementOpenPhoto(
|
||||
not_null<PhotoData*> photo,
|
||||
FullMsgId context) {
|
||||
@@ -2061,6 +2069,9 @@ void ListWidget::updateSize() {
|
||||
}
|
||||
|
||||
void ListWidget::resizeToWidth(int newWidth, int minHeight) {
|
||||
if (width() != newWidth) {
|
||||
_overlayHost->hide();
|
||||
}
|
||||
_minHeight = minHeight;
|
||||
RpWidget::resizeToWidth(newWidth);
|
||||
restoreScrollPosition();
|
||||
|
||||
@@ -423,6 +423,7 @@ public:
|
||||
FullMsgId context,
|
||||
QRect optionRect) override;
|
||||
void elementSubmitAddPollOption(FullMsgId context) override;
|
||||
void hideElementOverlay();
|
||||
void elementOpenPhoto(
|
||||
not_null<PhotoData*> photo,
|
||||
FullMsgId context) override;
|
||||
|
||||
Reference in New Issue
Block a user