mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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,
|
infoProfileSkip,
|
||||||
0px,
|
0px,
|
||||||
infoProfileSkip);
|
infoProfileSkip);
|
||||||
infoProfileLabeledButtonCopy: IconButton(defaultIconButton) {
|
infoProfileLabeledButtonQr: IconButton(defaultIconButton) {
|
||||||
width: 34px;
|
width: 34px;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
icon: icon {{ "menu/copy", windowBgActive }};
|
icon: icon {{ "menu/qr_code", windowActiveTextFg }};
|
||||||
iconOver: icon {{ "menu/copy", windowBgActive }};
|
iconOver: icon {{ "menu/qr_code", windowActiveTextFg }};
|
||||||
rippleAreaPosition: point(0px, 0px);
|
rippleAreaPosition: point(0px, 0px);
|
||||||
rippleAreaSize: 34px;
|
rippleAreaSize: 34px;
|
||||||
ripple: defaultRippleAnimation;
|
ripple: defaultRippleAnimation;
|
||||||
}
|
}
|
||||||
infoProfileLabeledButtonQr: IconButton(infoProfileLabeledButtonCopy) {
|
infoProfileLabeledButtonQrRightSkip: 10px;
|
||||||
icon: icon {{ "menu/qr_code", windowBgActive }};
|
|
||||||
iconOver: icon {{ "menu/qr_code", windowBgActive }};
|
|
||||||
}
|
|
||||||
|
|
||||||
infoIconInformation: icon {{ "info/info_information", infoIconFg }};
|
infoIconInformation: icon {{ "info/info_information", infoIconFg }};
|
||||||
infoIconAddMember: icon {{ "info/info_add_member", infoIconFg }};
|
infoIconAddMember: icon {{ "info/info_add_member", infoIconFg }};
|
||||||
|
|
|
@ -1062,7 +1062,8 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
};
|
};
|
||||||
const auto fitLabelToButton = [&](
|
const auto fitLabelToButton = [&](
|
||||||
not_null<Ui::RpWidget*> button,
|
not_null<Ui::RpWidget*> button,
|
||||||
not_null<Ui::FlatLabel*> label) {
|
not_null<Ui::FlatLabel*> label,
|
||||||
|
int rightSkip) {
|
||||||
const auto parent = label->parentWidget();
|
const auto parent = label->parentWidget();
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
label->geometryValue(),
|
label->geometryValue(),
|
||||||
|
@ -1070,10 +1071,11 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
) | rpl::start_with_next([=](const QRect &, const QSize &buttonSize) {
|
) | rpl::start_with_next([=](const QRect &, const QSize &buttonSize) {
|
||||||
const auto s = parent->size();
|
const auto s = parent->size();
|
||||||
button->moveToRight(
|
button->moveToRight(
|
||||||
0,
|
rightSkip,
|
||||||
(s.height() - buttonSize.height()) / 2);
|
(s.height() - buttonSize.height()) / 2);
|
||||||
label->resizeToWidth(
|
label->resizeToWidth(
|
||||||
s.width()
|
s.width()
|
||||||
|
- rightSkip
|
||||||
- label->geometry().left()
|
- label->geometry().left()
|
||||||
- st::lineWidth * 2
|
- st::lineWidth * 2
|
||||||
- buttonSize.width());
|
- buttonSize.width());
|
||||||
|
@ -1195,8 +1197,9 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
const auto qrButton = Ui::CreateChild<Ui::IconButton>(
|
const auto qrButton = Ui::CreateChild<Ui::IconButton>(
|
||||||
usernameLine.text->parentWidget(),
|
usernameLine.text->parentWidget(),
|
||||||
st::infoProfileLabeledButtonQr);
|
st::infoProfileLabeledButtonQr);
|
||||||
fitLabelToButton(qrButton, usernameLine.text);
|
const auto rightSkip = st::infoProfileLabeledButtonQrRightSkip;
|
||||||
fitLabelToButton(qrButton, usernameLine.subtext);
|
fitLabelToButton(qrButton, usernameLine.text, rightSkip);
|
||||||
|
fitLabelToButton(qrButton, usernameLine.subtext, rightSkip);
|
||||||
qrButton->setClickedCallback([=] {
|
qrButton->setClickedCallback([=] {
|
||||||
controller->show(
|
controller->show(
|
||||||
Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr));
|
Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr));
|
||||||
|
@ -1272,8 +1275,9 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
const auto qr = Ui::CreateChild<Ui::IconButton>(
|
const auto qr = Ui::CreateChild<Ui::IconButton>(
|
||||||
linkLine.text->parentWidget(),
|
linkLine.text->parentWidget(),
|
||||||
st::infoProfileLabeledButtonQr);
|
st::infoProfileLabeledButtonQr);
|
||||||
fitLabelToButton(qr, linkLine.text);
|
const auto rightSkip = st::infoProfileLabeledButtonQrRightSkip;
|
||||||
fitLabelToButton(qr, linkLine.subtext);
|
fitLabelToButton(qr, linkLine.text, rightSkip);
|
||||||
|
fitLabelToButton(qr, linkLine.subtext, rightSkip);
|
||||||
qr->setClickedCallback([=, peer = _peer] {
|
qr->setClickedCallback([=, peer = _peer] {
|
||||||
controller->show(
|
controller->show(
|
||||||
Box(Ui::FillPeerQrBox, peer, std::nullopt, nullptr));
|
Box(Ui::FillPeerQrBox, peer, std::nullopt, nullptr));
|
||||||
|
|
Loading…
Add table
Reference in a new issue