mirror of https://github.com/procxx/kepka.git
Remove the Link row in Settings.
Anyway it duplicates the Username row.
This commit is contained in:
parent
2e5930eb58
commit
216692cd9b
|
@ -48,10 +48,6 @@ void InfoWidget::createControls() {
|
||||||
style::margins slidedPadding(0, 0, 0, 0);
|
style::margins slidedPadding(0, 0, 0, 0);
|
||||||
addChildRow(_mobileNumber, margin, slidedPadding, st::settingsBlockOneLineTextPart);
|
addChildRow(_mobileNumber, margin, slidedPadding, st::settingsBlockOneLineTextPart);
|
||||||
addChildRow(_username, margin, slidedPadding, st::settingsBlockOneLineTextPart);
|
addChildRow(_username, margin, slidedPadding, st::settingsBlockOneLineTextPart);
|
||||||
addChildRow(_link, margin, slidedPadding, st::settingsBlockOneLineTextPart);
|
|
||||||
if (self()->username.isEmpty()) {
|
|
||||||
_link->hideFast();
|
|
||||||
}
|
|
||||||
addChildRow(_bio, margin, slidedPadding, st::settingsBioValue);
|
addChildRow(_bio, margin, slidedPadding, st::settingsBioValue);
|
||||||
refreshControls();
|
refreshControls();
|
||||||
}
|
}
|
||||||
|
@ -59,7 +55,6 @@ void InfoWidget::createControls() {
|
||||||
void InfoWidget::refreshControls() {
|
void InfoWidget::refreshControls() {
|
||||||
refreshMobileNumber();
|
refreshMobileNumber();
|
||||||
refreshUsername();
|
refreshUsername();
|
||||||
refreshLink();
|
|
||||||
refreshBio();
|
refreshBio();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,31 +95,6 @@ void InfoWidget::refreshUsername() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoWidget::refreshLink() {
|
|
||||||
TextWithEntities linkText;
|
|
||||||
TextWithEntities linkTextShort;
|
|
||||||
if (!self()->username.isEmpty()) {
|
|
||||||
linkText.text = Messenger::Instance().createInternalLinkFull(self()->username);
|
|
||||||
linkText.entities.push_back(EntityInText(EntityInTextUrl, 0, linkText.text.size()));
|
|
||||||
linkTextShort.text = Messenger::Instance().createInternalLink(self()->username);
|
|
||||||
linkTextShort.entities.push_back(EntityInText(EntityInTextCustomUrl, 0, linkTextShort.text.size(), Messenger::Instance().createInternalLinkFull(self()->username)));
|
|
||||||
}
|
|
||||||
setLabeledText(_link, lang(lng_profile_link), linkText, linkTextShort, QString());
|
|
||||||
if (auto text = _link->entity()->textLabel()) {
|
|
||||||
text->setClickHandlerHook([](const ClickHandlerPtr &handler, Qt::MouseButton button) {
|
|
||||||
Ui::show(Box<UsernameBox>());
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (auto shortText = _link->entity()->shortTextLabel()) {
|
|
||||||
shortText->setExpandLinksMode(ExpandLinksUrlOnly);
|
|
||||||
shortText->setClickHandlerHook([](const ClickHandlerPtr &handler, Qt::MouseButton button) {
|
|
||||||
Ui::show(Box<UsernameBox>());
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void InfoWidget::refreshBio() {
|
void InfoWidget::refreshBio() {
|
||||||
TextWithEntities bioText;
|
TextWithEntities bioText;
|
||||||
auto aboutText = self()->about();
|
auto aboutText = self()->about();
|
||||||
|
@ -195,7 +165,6 @@ void InfoWidget::notifyPeerUpdated(const Notify::PeerUpdate &update) {
|
||||||
|
|
||||||
if (update.flags & UpdateFlag::UsernameChanged) {
|
if (update.flags & UpdateFlag::UsernameChanged) {
|
||||||
refreshUsername();
|
refreshUsername();
|
||||||
refreshLink();
|
|
||||||
}
|
}
|
||||||
if (update.flags & (UpdateFlag::UserPhoneChanged)) {
|
if (update.flags & (UpdateFlag::UserPhoneChanged)) {
|
||||||
refreshMobileNumber();
|
refreshMobileNumber();
|
||||||
|
|
|
@ -44,7 +44,6 @@ private:
|
||||||
void refreshControls();
|
void refreshControls();
|
||||||
void refreshMobileNumber();
|
void refreshMobileNumber();
|
||||||
void refreshUsername();
|
void refreshUsername();
|
||||||
void refreshLink();
|
|
||||||
void refreshBio();
|
void refreshBio();
|
||||||
|
|
||||||
class LabeledWidget : public TWidget {
|
class LabeledWidget : public TWidget {
|
||||||
|
@ -76,7 +75,6 @@ private:
|
||||||
|
|
||||||
object_ptr<LabeledWrap> _mobileNumber = { nullptr };
|
object_ptr<LabeledWrap> _mobileNumber = { nullptr };
|
||||||
object_ptr<LabeledWrap> _username = { nullptr };
|
object_ptr<LabeledWrap> _username = { nullptr };
|
||||||
object_ptr<LabeledWrap> _link = { nullptr };
|
|
||||||
object_ptr<LabeledWrap> _bio = { nullptr };
|
object_ptr<LabeledWrap> _bio = { nullptr };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue