mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-24 17:26:58 +00:00
Fixed width of username label with right button in profile section.
This commit is contained in:
parent
f6b9cc5ce1
commit
fdcbe3cf3a
@ -1102,21 +1102,25 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||
usernameLine.subtext->overrideLinkClickHandler(callback);
|
||||
usernameLine.text->setContextMenuHook(hook);
|
||||
usernameLine.subtext->setContextMenuHook(hook);
|
||||
const auto usernameLabel = usernameLine.text;
|
||||
if (user) {
|
||||
const auto copyUsername = user->isBot()
|
||||
? Ui::CreateChild<Ui::IconButton>(
|
||||
usernameLabel->parentWidget(),
|
||||
st::infoProfileLabeledButtonCopy)
|
||||
: Ui::CreateChild<Ui::IconButton>(
|
||||
usernameLabel->parentWidget(),
|
||||
st::infoProfileLabeledButtonQr);
|
||||
const auto usernameLabel = usernameLine.text;
|
||||
const auto parent = usernameLabel->parentWidget();
|
||||
const auto copyUsername = Ui::CreateChild<Ui::IconButton>(
|
||||
parent,
|
||||
user->isBot()
|
||||
? st::infoProfileLabeledButtonCopy
|
||||
: st::infoProfileLabeledButtonQr);
|
||||
result->sizeValue(
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto s = usernameLabel->parentWidget()->size();
|
||||
const auto s = parent->size();
|
||||
copyUsername->moveToRight(
|
||||
0,
|
||||
(s.height() - copyUsername->height()) / 2);
|
||||
usernameLabel->resizeToWidth(
|
||||
s.width()
|
||||
- usernameLabel->geometry().left()
|
||||
- st::lineWidth * 2
|
||||
- copyUsername->width());
|
||||
}, copyUsername->lifetime());
|
||||
copyUsername->setClickedCallback([=] {
|
||||
if (!user->isBot()) {
|
||||
|
Loading…
Reference in New Issue
Block a user