Prevent some accidental story closing.
This commit is contained in:
parent
aa2cf2f6ca
commit
aff094f278
|
@ -505,6 +505,15 @@ ContentLayout Controller::contentLayout() const {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Controller::closeByClickAt(QPoint position) const {
|
||||||
|
const auto ¤t = _layout.current();
|
||||||
|
Assert(current.has_value());
|
||||||
|
|
||||||
|
return (position.x() < current->content.x() - st::storiesControlSize)
|
||||||
|
|| (position.x() > current->content.x() + current->content.width()
|
||||||
|
+ st::storiesControlSize);
|
||||||
|
}
|
||||||
|
|
||||||
Data::FileOrigin Controller::fileOrigin() const {
|
Data::FileOrigin Controller::fileOrigin() const {
|
||||||
return Data::FileOriginStory(_shown.peer, _shown.story);
|
return Data::FileOriginStory(_shown.peer, _shown.story);
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ public:
|
||||||
[[nodiscard]] Layout layout() const;
|
[[nodiscard]] Layout layout() const;
|
||||||
[[nodiscard]] rpl::producer<Layout> layoutValue() const;
|
[[nodiscard]] rpl::producer<Layout> layoutValue() const;
|
||||||
[[nodiscard]] ContentLayout contentLayout() const;
|
[[nodiscard]] ContentLayout contentLayout() const;
|
||||||
|
[[nodiscard]] bool closeByClickAt(QPoint position) const;
|
||||||
[[nodiscard]] Data::FileOrigin fileOrigin() const;
|
[[nodiscard]] Data::FileOrigin fileOrigin() const;
|
||||||
[[nodiscard]] TextWithEntities captionText() const;
|
[[nodiscard]] TextWithEntities captionText() const;
|
||||||
void showFullCaption();
|
void showFullCaption();
|
||||||
|
|
|
@ -51,6 +51,10 @@ ContentLayout View::contentLayout() const {
|
||||||
return _controller->contentLayout();
|
return _controller->contentLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool View::closeByClickAt(QPoint position) const {
|
||||||
|
return _controller->closeByClickAt(position);
|
||||||
|
}
|
||||||
|
|
||||||
void View::updatePlayback(const Player::TrackState &state) {
|
void View::updatePlayback(const Player::TrackState &state) {
|
||||||
_controller->updateVideoPlayback(state);
|
_controller->updateVideoPlayback(state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
[[nodiscard]] QRect finalShownGeometry() const;
|
[[nodiscard]] QRect finalShownGeometry() const;
|
||||||
[[nodiscard]] rpl::producer<QRect> finalShownGeometryValue() const;
|
[[nodiscard]] rpl::producer<QRect> finalShownGeometryValue() const;
|
||||||
[[nodiscard]] ContentLayout contentLayout() const;
|
[[nodiscard]] ContentLayout contentLayout() const;
|
||||||
|
[[nodiscard]] bool closeByClickAt(QPoint position) const;
|
||||||
[[nodiscard]] SiblingView sibling(SiblingType type) const;
|
[[nodiscard]] SiblingView sibling(SiblingType type) const;
|
||||||
[[nodiscard]] Data::FileOrigin fileOrigin() const;
|
[[nodiscard]] Data::FileOrigin fileOrigin() const;
|
||||||
[[nodiscard]] TextWithEntities captionText() const;
|
[[nodiscard]] TextWithEntities captionText() const;
|
||||||
|
|
|
@ -5576,7 +5576,9 @@ void OverlayWidget::handleMouseRelease(
|
||||||
|| documentContentShown()
|
|| documentContentShown()
|
||||||
|| !documentBubbleShown()
|
|| !documentBubbleShown()
|
||||||
|| !_docRect.contains(position)) {
|
|| !_docRect.contains(position)) {
|
||||||
close();
|
if (!_stories || _stories->closeByClickAt(position)) {
|
||||||
|
close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_pressed = false;
|
_pressed = false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user