Improve reaction selector position.
This commit is contained in:
parent
d4ba01bad0
commit
a43a5ce6c5
|
@ -686,6 +686,8 @@ void Reactions::Panel::create() {
|
||||||
_controller->layoutValue(),
|
_controller->layoutValue(),
|
||||||
_shownValue.value()
|
_shownValue.value()
|
||||||
) | rpl::start_with_next([=](const Layout &layout, float64 shown) {
|
) | 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()
|
const auto width = margins.left()
|
||||||
+ _selector->countAppearedWidth(shown)
|
+ _selector->countAppearedWidth(shown)
|
||||||
+ margins.right();
|
+ margins.right();
|
||||||
|
@ -693,6 +695,8 @@ void Reactions::Panel::create() {
|
||||||
const auto shift = (width / 2);
|
const auto shift = (width / 2);
|
||||||
const auto right = (mode == Mode::Message)
|
const auto right = (mode == Mode::Message)
|
||||||
? (layout.reactions.x() + layout.reactions.width() / 2 + shift)
|
? (layout.reactions.x() + layout.reactions.width() / 2 + shift)
|
||||||
|
: viewsReactionsMode
|
||||||
|
? (layout.content.x() + layout.content.width())
|
||||||
: (layout.controlsBottomPosition.x()
|
: (layout.controlsBottomPosition.x()
|
||||||
+ layout.controlsWidth
|
+ layout.controlsWidth
|
||||||
- st::storiesLikeReactionsPosition.x());
|
- st::storiesLikeReactionsPosition.x());
|
||||||
|
|
|
@ -286,7 +286,11 @@ void RecentViews::setupViewsReactions() {
|
||||||
|
|
||||||
_controller->layoutValue(
|
_controller->layoutValue(
|
||||||
) | rpl::start_with_next([=](const Layout &layout) {
|
) | 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();
|
updateViewsReactionsGeometry();
|
||||||
}, _likeWrap->lifetime());
|
}, _likeWrap->lifetime());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user