Improve reaction selector position.

This commit is contained in:
John Preston 2023-09-14 19:56:01 +04:00
parent d4ba01bad0
commit a43a5ce6c5
2 changed files with 9 additions and 1 deletions

View File

@ -686,6 +686,8 @@ void Reactions::Panel::create() {
_controller->layoutValue(),
_shownValue.value()
) | rpl::start_with_next([=](const Layout &layout, float64 shown) {
const auto story = _controller->story();
const auto viewsReactionsMode = story && story->peer()->isChannel();
const auto width = margins.left()
+ _selector->countAppearedWidth(shown)
+ margins.right();
@ -693,6 +695,8 @@ void Reactions::Panel::create() {
const auto shift = (width / 2);
const auto right = (mode == Mode::Message)
? (layout.reactions.x() + layout.reactions.width() / 2 + shift)
: viewsReactionsMode
? (layout.content.x() + layout.content.width())
: (layout.controlsBottomPosition.x()
+ layout.controlsWidth
- st::storiesLikeReactionsPosition.x());

View File

@ -286,7 +286,11 @@ void RecentViews::setupViewsReactions() {
_controller->layoutValue(
) | rpl::start_with_next([=](const Layout &layout) {
_outer = layout.views;
_outer = QRect(
layout.content.x(),
layout.views.y(),
layout.content.width(),
layout.views.height());
updateViewsReactionsGeometry();
}, _likeWrap->lifetime());