mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed update of width for username label in profile section.
This commit is contained in:
parent
44aa2aec5d
commit
73b63aa414
1 changed files with 9 additions and 6 deletions
|
@ -1064,16 +1064,19 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
not_null<Ui::RpWidget*> button,
|
not_null<Ui::RpWidget*> button,
|
||||||
not_null<Ui::FlatLabel*> label) {
|
not_null<Ui::FlatLabel*> label) {
|
||||||
const auto parent = label->parentWidget();
|
const auto parent = label->parentWidget();
|
||||||
result->sizeValue() | rpl::start_with_next([=] {
|
rpl::combine(
|
||||||
|
label->geometryValue(),
|
||||||
|
button->sizeValue()
|
||||||
|
) | rpl::start_with_next([=](const QRect &, const QSize &buttonSize) {
|
||||||
const auto s = parent->size();
|
const auto s = parent->size();
|
||||||
button->moveToRight(
|
button->moveToRight(
|
||||||
0,
|
0,
|
||||||
(s.height() - button->height()) / 2);
|
(s.height() - buttonSize.height()) / 2);
|
||||||
label->resizeToWidth(
|
label->resizeToWidth(
|
||||||
s.width()
|
s.width()
|
||||||
- label->geometry().left()
|
- label->geometry().left()
|
||||||
- st::lineWidth * 2
|
- st::lineWidth * 2
|
||||||
- button->width());
|
- buttonSize.width());
|
||||||
}, button->lifetime());
|
}, button->lifetime());
|
||||||
};
|
};
|
||||||
const auto controller = _controller->parentController();
|
const auto controller = _controller->parentController();
|
||||||
|
@ -1177,11 +1180,11 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
usernameLine.text->setContextMenuHook(lnkHook);
|
usernameLine.text->setContextMenuHook(lnkHook);
|
||||||
usernameLine.subtext->setContextMenuHook(lnkHook);
|
usernameLine.subtext->setContextMenuHook(lnkHook);
|
||||||
|
|
||||||
const auto copyUsername = Ui::CreateChild<Ui::IconButton>(
|
const auto qrButton = Ui::CreateChild<Ui::IconButton>(
|
||||||
usernameLine.text->parentWidget(),
|
usernameLine.text->parentWidget(),
|
||||||
st::infoProfileLabeledButtonQr);
|
st::infoProfileLabeledButtonQr);
|
||||||
fitLabelToButton(copyUsername, usernameLine.text);
|
fitLabelToButton(qrButton, usernameLine.text);
|
||||||
copyUsername->setClickedCallback([=] {
|
qrButton->setClickedCallback([=] {
|
||||||
controller->show(
|
controller->show(
|
||||||
Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr));
|
Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr));
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue