mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Slightly improved position of button for QR of username.
This commit is contained in:
parent
a8f492a027
commit
9c185a30e0
2 changed files with 14 additions and 13 deletions
|
@ -441,19 +441,16 @@ infoProfileSeparatorPadding: margins(
|
|||
infoProfileSkip,
|
||||
0px,
|
||||
infoProfileSkip);
|
||||
infoProfileLabeledButtonCopy: IconButton(defaultIconButton) {
|
||||
infoProfileLabeledButtonQr: IconButton(defaultIconButton) {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
icon: icon {{ "menu/copy", windowBgActive }};
|
||||
iconOver: icon {{ "menu/copy", windowBgActive }};
|
||||
icon: icon {{ "menu/qr_code", windowActiveTextFg }};
|
||||
iconOver: icon {{ "menu/qr_code", windowActiveTextFg }};
|
||||
rippleAreaPosition: point(0px, 0px);
|
||||
rippleAreaSize: 34px;
|
||||
ripple: defaultRippleAnimation;
|
||||
}
|
||||
infoProfileLabeledButtonQr: IconButton(infoProfileLabeledButtonCopy) {
|
||||
icon: icon {{ "menu/qr_code", windowBgActive }};
|
||||
iconOver: icon {{ "menu/qr_code", windowBgActive }};
|
||||
}
|
||||
infoProfileLabeledButtonQrRightSkip: 10px;
|
||||
|
||||
infoIconInformation: icon {{ "info/info_information", infoIconFg }};
|
||||
infoIconAddMember: icon {{ "info/info_add_member", infoIconFg }};
|
||||
|
|
|
@ -1062,7 +1062,8 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
};
|
||||
const auto fitLabelToButton = [&](
|
||||
not_null<Ui::RpWidget*> button,
|
||||
not_null<Ui::FlatLabel*> label) {
|
||||
not_null<Ui::FlatLabel*> label,
|
||||
int rightSkip) {
|
||||
const auto parent = label->parentWidget();
|
||||
rpl::combine(
|
||||
label->geometryValue(),
|
||||
|
@ -1070,10 +1071,11 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
) | rpl::start_with_next([=](const QRect &, const QSize &buttonSize) {
|
||||
const auto s = parent->size();
|
||||
button->moveToRight(
|
||||
0,
|
||||
rightSkip,
|
||||
(s.height() - buttonSize.height()) / 2);
|
||||
label->resizeToWidth(
|
||||
s.width()
|
||||
- rightSkip
|
||||
- label->geometry().left()
|
||||
- st::lineWidth * 2
|
||||
- buttonSize.width());
|
||||
|
@ -1195,8 +1197,9 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
const auto qrButton = Ui::CreateChild<Ui::IconButton>(
|
||||
usernameLine.text->parentWidget(),
|
||||
st::infoProfileLabeledButtonQr);
|
||||
fitLabelToButton(qrButton, usernameLine.text);
|
||||
fitLabelToButton(qrButton, usernameLine.subtext);
|
||||
const auto rightSkip = st::infoProfileLabeledButtonQrRightSkip;
|
||||
fitLabelToButton(qrButton, usernameLine.text, rightSkip);
|
||||
fitLabelToButton(qrButton, usernameLine.subtext, rightSkip);
|
||||
qrButton->setClickedCallback([=] {
|
||||
controller->show(
|
||||
Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr));
|
||||
|
@ -1272,8 +1275,9 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
const auto qr = Ui::CreateChild<Ui::IconButton>(
|
||||
linkLine.text->parentWidget(),
|
||||
st::infoProfileLabeledButtonQr);
|
||||
fitLabelToButton(qr, linkLine.text);
|
||||
fitLabelToButton(qr, linkLine.subtext);
|
||||
const auto rightSkip = st::infoProfileLabeledButtonQrRightSkip;
|
||||
fitLabelToButton(qr, linkLine.text, rightSkip);
|
||||
fitLabelToButton(qr, linkLine.subtext, rightSkip);
|
||||
qr->setClickedCallback([=, peer = _peer] {
|
||||
controller->show(
|
||||
Box(Ui::FillPeerQrBox, peer, std::nullopt, nullptr));
|
||||
|
|
Loading…
Add table
Reference in a new issue