mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +02:00
Fix RTL chat names in preview.
This commit is contained in:
parent
2b9e7a6b25
commit
a9a0fe7cf5
1 changed files with 14 additions and 5 deletions
|
@ -275,11 +275,13 @@ void Item::setupTop() {
|
|||
}, _top->lifetime());
|
||||
|
||||
const auto topic = _thread->asTopic();
|
||||
auto nameValue = (topic
|
||||
? Info::Profile::TitleValue(topic)
|
||||
: Info::Profile::NameValue(_thread->peer())
|
||||
) | rpl::start_spawning(_top->lifetime());
|
||||
const auto name = Ui::CreateChild<Ui::FlatLabel>(
|
||||
_top.get(),
|
||||
(topic
|
||||
? Info::Profile::TitleValue(topic)
|
||||
: Info::Profile::NameValue(_thread->peer())),
|
||||
rpl::duplicate(nameValue),
|
||||
st::previewName);
|
||||
name->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
auto statusFields = StatusValue(
|
||||
|
@ -322,12 +324,19 @@ void Item::setupTop() {
|
|||
}
|
||||
|
||||
const auto shadow = Ui::CreateChild<Ui::PlainShadow>(this);
|
||||
_top->geometryValue() | rpl::start_with_next([=](QRect geometry) {
|
||||
rpl::combine(
|
||||
_top->widthValue(),
|
||||
std::move(nameValue)
|
||||
) | rpl::start_with_next([=](int width, const auto &) {
|
||||
const auto &st = st::previewTop;
|
||||
name->resizeToWidth(geometry.width()
|
||||
name->resizeToNaturalWidth(width
|
||||
- st.namePosition.x()
|
||||
- st.photoPosition.x());
|
||||
name->move(st::previewTop.namePosition);
|
||||
}, name->lifetime());
|
||||
|
||||
_top->geometryValue() | rpl::start_with_next([=](QRect geometry) {
|
||||
const auto &st = st::previewTop;
|
||||
status->resizeToWidth(geometry.width()
|
||||
- st.statusPosition.x()
|
||||
- st.photoPosition.x());
|
||||
|
|
Loading…
Add table
Reference in a new issue