mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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());
|
}, _top->lifetime());
|
||||||
|
|
||||||
const auto topic = _thread->asTopic();
|
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>(
|
const auto name = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
_top.get(),
|
_top.get(),
|
||||||
(topic
|
rpl::duplicate(nameValue),
|
||||||
? Info::Profile::TitleValue(topic)
|
|
||||||
: Info::Profile::NameValue(_thread->peer())),
|
|
||||||
st::previewName);
|
st::previewName);
|
||||||
name->setAttribute(Qt::WA_TransparentForMouseEvents);
|
name->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
auto statusFields = StatusValue(
|
auto statusFields = StatusValue(
|
||||||
|
@ -322,12 +324,19 @@ void Item::setupTop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto shadow = Ui::CreateChild<Ui::PlainShadow>(this);
|
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;
|
const auto &st = st::previewTop;
|
||||||
name->resizeToWidth(geometry.width()
|
name->resizeToNaturalWidth(width
|
||||||
- st.namePosition.x()
|
- st.namePosition.x()
|
||||||
- st.photoPosition.x());
|
- st.photoPosition.x());
|
||||||
name->move(st::previewTop.namePosition);
|
name->move(st::previewTop.namePosition);
|
||||||
|
}, name->lifetime());
|
||||||
|
|
||||||
|
_top->geometryValue() | rpl::start_with_next([=](QRect geometry) {
|
||||||
|
const auto &st = st::previewTop;
|
||||||
status->resizeToWidth(geometry.width()
|
status->resizeToWidth(geometry.width()
|
||||||
- st.statusPosition.x()
|
- st.statusPosition.x()
|
||||||
- st.photoPosition.x());
|
- st.photoPosition.x());
|
||||||
|
|
Loading…
Add table
Reference in a new issue