mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 22:57:11 +02:00
Adjusted code for refactor of input fields in lib_ui.
This commit is contained in:
parent
ae2182c1e5
commit
98bb520f47
89 changed files with 413 additions and 300 deletions
|
@ -29,6 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/fields/special_fields.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/text/format_values.h"
|
||||
|
@ -297,8 +298,11 @@ void AddContactBox::prepare() {
|
|||
: tr::lng_enter_contact_data());
|
||||
updateButtons();
|
||||
|
||||
connect(_first, &Ui::InputField::submitted, [=] { submit(); });
|
||||
connect(_last, &Ui::InputField::submitted, [=] { submit(); });
|
||||
const auto submitted = [=] { submit(); };
|
||||
_first->submits(
|
||||
) | rpl::start_with_next(submitted, _first->lifetime());
|
||||
_last->submits(
|
||||
) | rpl::start_with_next(submitted, _last->lifetime());
|
||||
connect(_phone, &Ui::PhoneInput::submitted, [=] { submit(); });
|
||||
|
||||
setDimensions(
|
||||
|
@ -567,23 +571,24 @@ void GroupInfoBox::prepare() {
|
|||
_description->setSubmitSettings(
|
||||
Core::App().settings().sendSubmitWay());
|
||||
|
||||
connect(_description, &Ui::InputField::resized, [=] {
|
||||
_description->heightChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
descriptionResized();
|
||||
});
|
||||
connect(_description, &Ui::InputField::submitted, [=] {
|
||||
submit();
|
||||
});
|
||||
connect(_description, &Ui::InputField::cancelled, [=] {
|
||||
}, _description->lifetime());
|
||||
_description->submits(
|
||||
) | rpl::start_with_next([=] { submit(); }, _description->lifetime());
|
||||
_description->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
closeBox();
|
||||
});
|
||||
}, _description->lifetime());
|
||||
|
||||
Ui::Emoji::SuggestionsController::Init(
|
||||
getDelegate()->outerContainer(),
|
||||
_description,
|
||||
&_navigation->session());
|
||||
}
|
||||
|
||||
connect(_title, &Ui::InputField::submitted, [=] { submitName(); });
|
||||
_title->submits(
|
||||
) | rpl::start_with_next([=] { submitName(); }, _title->lifetime());
|
||||
|
||||
addButton(
|
||||
((_type != Type::Group || _canAddBot)
|
||||
|
@ -1522,20 +1527,22 @@ void EditNameBox::prepare() {
|
|||
_first->setMaxLength(Ui::EditPeer::kMaxUserFirstLastName);
|
||||
_last->setMaxLength(Ui::EditPeer::kMaxUserFirstLastName);
|
||||
|
||||
connect(_first, &Ui::InputField::submitted, [=] { submit(); });
|
||||
connect(_last, &Ui::InputField::submitted, [=] { submit(); });
|
||||
_first->submits(
|
||||
) | rpl::start_with_next([=] { submit(); }, _first->lifetime());
|
||||
_last->submits(
|
||||
) | rpl::start_with_next([=] { submit(); }, _last->lifetime());
|
||||
|
||||
_first->customTab(true);
|
||||
_last->customTab(true);
|
||||
|
||||
QObject::connect(
|
||||
_first,
|
||||
&Ui::InputField::tabbed,
|
||||
[=] { _last->setFocus(); });
|
||||
QObject::connect(
|
||||
_last,
|
||||
&Ui::InputField::tabbed,
|
||||
[=] { _first->setFocus(); });
|
||||
_first->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
_last->setFocus();
|
||||
}, _first->lifetime());
|
||||
_last->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
_first->setFocus();
|
||||
}, _last->lifetime());
|
||||
}
|
||||
|
||||
void EditNameBox::setInnerFocus() {
|
||||
|
|
|
@ -18,7 +18,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "mtproto/facade.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/fields/number_input.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/dropdown_menu.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
|
|
|
@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/wrap/fade_wrap.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
|
@ -184,7 +184,8 @@ not_null<Ui::FlatLabel*> CreateWarningLabel(
|
|||
QString(),
|
||||
st::createPollWarning);
|
||||
result->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
QObject::connect(field, &Ui::InputField::changed, [=] {
|
||||
field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
Ui::PostponeCall(crl::guard(field, [=] {
|
||||
const auto length = field->getLastText().size();
|
||||
const auto value = valueLimit - length;
|
||||
|
@ -198,7 +199,7 @@ not_null<Ui::FlatLabel*> CreateWarningLabel(
|
|||
}
|
||||
result->setVisible(shown);
|
||||
}));
|
||||
});
|
||||
}, field->lifetime());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -243,13 +244,14 @@ Options::Option::Option(
|
|||
_content->resize(_content->width(), height);
|
||||
}, _field->lifetime());
|
||||
|
||||
QObject::connect(_field, &Ui::InputField::changed, [=] {
|
||||
_field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
Ui::PostponeCall(crl::guard(_field, [=] {
|
||||
if (_hasCorrect) {
|
||||
_correct->toggle(isGood(), anim::type::normal);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}, _field->lifetime());
|
||||
|
||||
createShadow();
|
||||
createRemove();
|
||||
|
@ -303,10 +305,11 @@ void Options::Option::createRemove() {
|
|||
const auto toggle = lifetime.make_state<rpl::variable<bool>>(false);
|
||||
_removeAlways = lifetime.make_state<rpl::variable<bool>>(false);
|
||||
|
||||
QObject::connect(field, &Ui::InputField::changed, [=] {
|
||||
field->changes(
|
||||
) | rpl::start_with_next([field, toggle] {
|
||||
// Don't capture 'this'! Because Option is a value type.
|
||||
*toggle = !field->getLastText().isEmpty();
|
||||
});
|
||||
}, field->lifetime());
|
||||
rpl::combine(
|
||||
toggle->value(),
|
||||
_removeAlways->value(),
|
||||
|
@ -649,28 +652,32 @@ void Options::addEmptyOption() {
|
|||
_position + _list.size() + _destroyed.size(),
|
||||
_chooseCorrectGroup));
|
||||
const auto field = _list.back()->field();
|
||||
QObject::connect(field, &Ui::InputField::submitted, [=] {
|
||||
field->submits(
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto index = findField(field);
|
||||
if (_list[index]->isGood() && index + 1 < _list.size()) {
|
||||
_list[index + 1]->setFocus();
|
||||
}
|
||||
});
|
||||
QObject::connect(field, &Ui::InputField::changed, [=] {
|
||||
}, field->lifetime());
|
||||
field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
Ui::PostponeCall(crl::guard(field, [=] {
|
||||
validateState();
|
||||
}));
|
||||
});
|
||||
QObject::connect(field, &Ui::InputField::focused, [=] {
|
||||
}, field->lifetime());
|
||||
field->focusedChanges(
|
||||
) | rpl::filter(rpl::mappers::_1) | rpl::start_with_next([=] {
|
||||
_scrollToWidget.fire_copy(field);
|
||||
});
|
||||
QObject::connect(field, &Ui::InputField::tabbed, [=] {
|
||||
}, field->lifetime());
|
||||
field->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto index = findField(field);
|
||||
if (index + 1 < _list.size()) {
|
||||
_list[index + 1]->setFocus();
|
||||
} else {
|
||||
_tabbed.fire({});
|
||||
}
|
||||
});
|
||||
}, field->lifetime());
|
||||
base::install_event_filter(field, [=](not_null<QEvent*> event) {
|
||||
if (event->type() != QEvent::KeyPress
|
||||
|| !field->getLastText().isEmpty()) {
|
||||
|
@ -927,9 +934,10 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
|
|||
st::boxDividerLabel),
|
||||
st::createPollLimitPadding));
|
||||
|
||||
connect(question, &Ui::InputField::tabbed, [=] {
|
||||
question->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
options->focusFirst();
|
||||
});
|
||||
}, question->lifetime());
|
||||
|
||||
AddSkip(container);
|
||||
AddSubsectionTitle(container, tr::lng_polls_create_settings());
|
||||
|
@ -975,9 +983,10 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
|
|||
}
|
||||
}, question->lifetime());
|
||||
|
||||
connect(solution, &Ui::InputField::tabbed, [=] {
|
||||
solution->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
question->setFocus();
|
||||
});
|
||||
}, solution->lifetime());
|
||||
|
||||
quiz->setDisabled(_disabled & PollData::Flag::Quiz);
|
||||
if (multiple) {
|
||||
|
@ -1009,12 +1018,12 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
|
|||
const auto text = question->getLastText().trimmed();
|
||||
return !text.isEmpty() && (text.size() <= kQuestionLimit);
|
||||
};
|
||||
|
||||
connect(question, &Ui::InputField::submitted, [=] {
|
||||
question->submits(
|
||||
) | rpl::start_with_next([=] {
|
||||
if (isValidQuestion()) {
|
||||
options->focusFirst();
|
||||
}
|
||||
});
|
||||
}, question->lifetime());
|
||||
|
||||
_setInnerFocus = [=] {
|
||||
question->setFocusFast();
|
||||
|
|
|
@ -54,7 +54,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/painter.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
|
@ -488,9 +488,16 @@ void EditCaptionBox::setupField() {
|
|||
Core::App().settings().sendSubmitWay());
|
||||
_field->setMaxHeight(st::defaultComposeFiles.caption.heightMax);
|
||||
|
||||
connect(_field, &Ui::InputField::submitted, [=] { save(); });
|
||||
connect(_field, &Ui::InputField::cancelled, [=] { closeBox(); });
|
||||
connect(_field, &Ui::InputField::resized, [=] { captionResized(); });
|
||||
_field->submits(
|
||||
) | rpl::start_with_next([=] { save(); }, _field->lifetime());
|
||||
_field->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
closeBox();
|
||||
}, _field->lifetime());
|
||||
_field->heightChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
captionResized();
|
||||
}, _field->lifetime());
|
||||
_field->setMimeDataHook([=](
|
||||
not_null<const QMimeData*> data,
|
||||
Ui::InputField::MimeAction action) {
|
||||
|
@ -522,10 +529,11 @@ void EditCaptionBox::setInitialText() {
|
|||
setCloseByOutsideClick(true);
|
||||
}
|
||||
});
|
||||
connect(_field, &Ui::InputField::changed, [=] {
|
||||
_field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
_checkChangedTimer.callOnce(kChangesDebounceTimeout);
|
||||
setCloseByOutsideClick(false);
|
||||
});
|
||||
}, _field->lifetime());
|
||||
}
|
||||
|
||||
void EditCaptionBox::setupControls() {
|
||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/text/text_options.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/effects/panel_animation.h"
|
||||
#include "ui/filter_icons.h"
|
||||
|
@ -619,11 +619,12 @@ void EditFilterBox(
|
|||
nameEditing->custom = true;
|
||||
}, box->lifetime());
|
||||
|
||||
QObject::connect(name, &Ui::InputField::changed, [=] {
|
||||
name->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
if (!nameEditing->settingDefault) {
|
||||
nameEditing->custom = true;
|
||||
}
|
||||
});
|
||||
}, name->lifetime());
|
||||
const auto updateDefaultTitle = [=](const Data::ChatFilter &filter) {
|
||||
if (nameEditing->custom) {
|
||||
return;
|
||||
|
|
|
@ -26,7 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/controls/invite_link_label.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
|
|
|
@ -21,10 +21,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/sent_code_field.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/fade_wrap.h"
|
||||
#include "ui/painter.h"
|
||||
#include "passport/passport_encryption.h"
|
||||
|
@ -306,15 +305,26 @@ void PasscodeBox::prepare() {
|
|||
connect(_oldPasscode, &Ui::MaskedInputField::changed, [=] { oldChanged(); });
|
||||
connect(_newPasscode, &Ui::MaskedInputField::changed, [=] { newChanged(); });
|
||||
connect(_reenterPasscode, &Ui::MaskedInputField::changed, [=] { newChanged(); });
|
||||
connect(_passwordHint, &Ui::InputField::changed, [=] { newChanged(); });
|
||||
connect(_recoverEmail, &Ui::InputField::changed, [=] { emailChanged(); });
|
||||
_passwordHint->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
newChanged();
|
||||
}, _passwordHint->lifetime());
|
||||
_recoverEmail->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
if (!_emailError.isEmpty()) {
|
||||
_emailError = QString();
|
||||
update();
|
||||
}
|
||||
}, _recoverEmail->lifetime());
|
||||
|
||||
const auto fieldSubmit = [=] { submit(); };
|
||||
connect(_oldPasscode, &Ui::MaskedInputField::submitted, fieldSubmit);
|
||||
connect(_newPasscode, &Ui::MaskedInputField::submitted, fieldSubmit);
|
||||
connect(_reenterPasscode, &Ui::MaskedInputField::submitted, fieldSubmit);
|
||||
connect(_passwordHint, &Ui::InputField::submitted, fieldSubmit);
|
||||
connect(_recoverEmail, &Ui::InputField::submitted, fieldSubmit);
|
||||
_passwordHint->submits(
|
||||
) | rpl::start_with_next(fieldSubmit, _passwordHint->lifetime());
|
||||
_recoverEmail->submits(
|
||||
) | rpl::start_with_next(fieldSubmit, _recoverEmail->lifetime());
|
||||
|
||||
_recover->addClickHandler([=] { recoverByEmail(); });
|
||||
|
||||
|
@ -1061,13 +1071,6 @@ void PasscodeBox::newChanged() {
|
|||
}
|
||||
}
|
||||
|
||||
void PasscodeBox::emailChanged() {
|
||||
if (!_emailError.isEmpty()) {
|
||||
_emailError = QString();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void PasscodeBox::recoverByEmail() {
|
||||
if (!_cloudFields.hasRecovery) {
|
||||
Assert(_session != nullptr);
|
||||
|
@ -1189,8 +1192,12 @@ void RecoverBox::prepare() {
|
|||
+ _recoverCode->height()
|
||||
+ st::passcodeTextLine));
|
||||
|
||||
connect(_recoverCode, &Ui::InputField::changed, [=] { codeChanged(); });
|
||||
connect(_recoverCode, &Ui::InputField::submitted, [=] { submit(); });
|
||||
_recoverCode->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
codeChanged();
|
||||
}, _recoverCode->lifetime());
|
||||
_recoverCode->submits(
|
||||
) | rpl::start_with_next([=] { submit(); }, _recoverCode->lifetime());
|
||||
}
|
||||
|
||||
void RecoverBox::paintEvent(QPaintEvent *e) {
|
||||
|
|
|
@ -90,7 +90,6 @@ private:
|
|||
void closeReplacedBy();
|
||||
void oldChanged();
|
||||
void newChanged();
|
||||
void emailChanged();
|
||||
void save(bool force = false);
|
||||
void badOldPasscode();
|
||||
void recoverByEmail();
|
||||
|
|
|
@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/text/format_values.h" // Ui::FormatPhone
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "info/profile/info_profile_cover.h"
|
||||
|
@ -239,8 +239,8 @@ void Controller::initNameFields(
|
|||
_save();
|
||||
}
|
||||
};
|
||||
QObject::connect(first, &Ui::InputField::submitted, submit);
|
||||
QObject::connect(last, &Ui::InputField::submitted, submit);
|
||||
first->submits() | rpl::start_with_next(submit, first->lifetime());
|
||||
last->submits() | rpl::start_with_next(submit, last->lifetime());
|
||||
first->setMaxLength(Ui::EditPeer::kMaxUserFirstLastName);
|
||||
first->setMaxLength(Ui::EditPeer::kMaxUserFirstLastName);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "boxes/peers/edit_forum_topic_box.h"
|
||||
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/effects/emoji_fly_animation.h"
|
||||
#include "ui/abstract_button.h"
|
||||
|
@ -465,15 +465,13 @@ void EditForumTopicBox(
|
|||
ChooseNextColorId(current.colorId, state->otherColorIds),
|
||||
};
|
||||
});
|
||||
base::qt_signal_producer(
|
||||
title,
|
||||
&Ui::InputField::changed
|
||||
title->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
state->defaultIcon = DefaultIcon{
|
||||
title->getLastText().trimmed(),
|
||||
state->defaultIcon.current().colorId,
|
||||
};
|
||||
}, box->lifetime());
|
||||
}, title->lifetime());
|
||||
|
||||
if (!topic || !topic->isGeneral()) {
|
||||
Settings::AddDividerText(
|
||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/toast/toast.h"
|
||||
|
@ -461,13 +461,14 @@ not_null<Ui::InputField*> EditAdminBox::addRankInput(
|
|||
st::rightsAboutMargin);
|
||||
result->setMaxLength(kAdminRoleLimit);
|
||||
result->setInstantReplaces(Ui::InstantReplaces::TextOnly());
|
||||
connect(result, &Ui::InputField::changed, [=] {
|
||||
result->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto text = result->getLastText();
|
||||
const auto removed = TextUtilities::RemoveEmoji(text);
|
||||
if (removed != text) {
|
||||
result->setText(removed);
|
||||
}
|
||||
});
|
||||
}, result->lifetime());
|
||||
|
||||
container->add(
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
|
|
|
@ -51,7 +51,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
|
@ -519,10 +519,10 @@ object_ptr<Ui::RpWidget> Controller::createTitleEdit() {
|
|||
result->entity(),
|
||||
&_peer->session());
|
||||
|
||||
QObject::connect(
|
||||
result->entity(),
|
||||
&Ui::InputField::submitted,
|
||||
[=] { submitTitle(); });
|
||||
result->entity()->submits(
|
||||
) | rpl::start_with_next([=] {
|
||||
submitTitle();
|
||||
}, result->entity()->lifetime());
|
||||
|
||||
_controls.title = result->entity();
|
||||
return result;
|
||||
|
@ -555,10 +555,10 @@ object_ptr<Ui::RpWidget> Controller::createDescriptionEdit() {
|
|||
result->entity(),
|
||||
&_peer->session());
|
||||
|
||||
QObject::connect(
|
||||
result->entity(),
|
||||
&Ui::InputField::submitted,
|
||||
[=] { submitDescription(); });
|
||||
result->entity()->submits(
|
||||
) | rpl::start_with_next([=] {
|
||||
submitDescription();
|
||||
}, result->entity()->lifetime());
|
||||
|
||||
_controls.description = result->entity();
|
||||
return result;
|
||||
|
|
|
@ -32,7 +32,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/controls/userpic_button.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
|
|
|
@ -31,7 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/effects/scroll_content_shadow.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
|
@ -1030,17 +1030,21 @@ void SendFilesBox::setupCaption() {
|
|||
Core::App().settings().sendSubmitWay());
|
||||
_caption->setMaxLength(kMaxMessageLength);
|
||||
|
||||
connect(_caption, &Ui::InputField::resized, [=] {
|
||||
_caption->heightChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
captionResized();
|
||||
});
|
||||
connect(_caption, &Ui::InputField::submitted, [=](
|
||||
Qt::KeyboardModifiers modifiers) {
|
||||
}, _caption->lifetime());
|
||||
_caption->submits(
|
||||
) | rpl::start_with_next([=](Qt::KeyboardModifiers modifiers) {
|
||||
const auto ctrlShiftEnter = modifiers.testFlag(Qt::ShiftModifier)
|
||||
&& (modifiers.testFlag(Qt::ControlModifier)
|
||||
|| modifiers.testFlag(Qt::MetaModifier));
|
||||
send({}, ctrlShiftEnter);
|
||||
});
|
||||
connect(_caption, &Ui::InputField::cancelled, [=] { closeBox(); });
|
||||
}, _caption->lifetime());
|
||||
_caption->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
closeBox();
|
||||
}, _caption->lifetime());
|
||||
_caption->setMimeDataHook([=](
|
||||
not_null<const QMimeData*> data,
|
||||
Ui::InputField::MimeAction action) {
|
||||
|
|
|
@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "lang/lang_keys.h"
|
||||
#include "main/main_session.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
|
@ -144,7 +144,7 @@ void RenameBox(not_null<Ui::GenericBox*> box) {
|
|||
Core::App().settings().setCustomDeviceModel(result);
|
||||
Core::App().saveSettingsDelayed();
|
||||
};
|
||||
QObject::connect(name, &Ui::InputField::submitted, submit);
|
||||
name->submits() | rpl::start_with_next(submit, name->lifetime());
|
||||
box->addButton(tr::lng_settings_save(), submit);
|
||||
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/multi_select.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/text/text_options.h"
|
||||
|
@ -226,9 +226,8 @@ void ShareBox::prepareCommentField() {
|
|||
|
||||
const auto field = _comment->entity();
|
||||
|
||||
connect(field, &Ui::InputField::submitted, [=] {
|
||||
submit({});
|
||||
});
|
||||
field->submits(
|
||||
) | rpl::start_with_next([=] { submit({}); }, field->lifetime());
|
||||
if (const auto show = uiShow(); show->valid()) {
|
||||
InitMessageFieldHandlers(
|
||||
_descriptor.session,
|
||||
|
|
|
@ -31,7 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/effects/ripple_animation.h"
|
||||
#include "ui/effects/slide_animation.h"
|
||||
#include "ui/widgets/discrete_sliders.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/image/image.h"
|
||||
#include "ui/cached_round_corners.h"
|
||||
#include "ui/painter.h"
|
||||
|
|
|
@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/widgets/menu/menu_action.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/effects/ripple_animation.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/painter.h"
|
||||
|
|
|
@ -23,7 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/widgets/call_button.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/dropdown_menu.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/tooltip.h"
|
||||
#include "ui/widgets/rp_window.h"
|
||||
#include "ui/chat/group_call_bar.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/widgets/continuous_sliders.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
|
|
|
@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/image/image_prepare.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "styles/style_calls.h"
|
||||
#include "styles/style_layers.h"
|
||||
|
@ -287,7 +287,7 @@ void EditGroupCallTitleBox(
|
|||
box->closeBox();
|
||||
done(result);
|
||||
};
|
||||
QObject::connect(input, &Ui::InputField::submitted, submit);
|
||||
input->submits() | rpl::start_with_next(submit, input->lifetime());
|
||||
box->addButton(tr::lng_settings_save(), submit);
|
||||
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ void AddTitleGroupCallRecordingBox(
|
|||
box->closeBox();
|
||||
done(result);
|
||||
};
|
||||
QObject::connect(input, &Ui::InputField::submitted, submit);
|
||||
input->submits() | rpl::start_with_next(submit, input->lifetime());
|
||||
box->addButton(tr::lng_group_call_recording_start_button(), submit);
|
||||
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/effects/ripple_animation.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/widgets/inner_dropdown.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/emoji_config.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "ui/cached_round_corners.h"
|
||||
|
|
|
@ -31,7 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "media/clip/media_clip_reader.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/text/text_options.h"
|
||||
#include "ui/image/image.h"
|
||||
#include "ui/effects/path_shift_gradient.h"
|
||||
|
|
|
@ -24,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/click_handler_types.h"
|
||||
#include "ui/controls/tabbed_search.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/effects/ripple_animation.h"
|
||||
#include "ui/image/image.h"
|
||||
|
|
|
@ -190,16 +190,18 @@ void EditLinkBox(
|
|||
}
|
||||
};
|
||||
|
||||
QObject::connect(text, &Ui::InputField::submitted, [=] {
|
||||
text->submits(
|
||||
) | rpl::start_with_next([=] {
|
||||
url->setFocusFast();
|
||||
});
|
||||
QObject::connect(url, &Ui::InputField::submitted, [=] {
|
||||
}, text->lifetime());
|
||||
url->submits(
|
||||
) | rpl::start_with_next([=] {
|
||||
if (text->getLastText().isEmpty()) {
|
||||
text->setFocusFast();
|
||||
} else {
|
||||
submit();
|
||||
}
|
||||
});
|
||||
}, url->lifetime());
|
||||
|
||||
box->setTitle(url->getLastText().isEmpty()
|
||||
? tr::lng_formatting_link_create_title()
|
||||
|
@ -223,8 +225,14 @@ void EditLinkBox(
|
|||
url->customTab(true);
|
||||
text->customTab(true);
|
||||
|
||||
QObject::connect(url, &Ui::InputField::tabbed, [=] { text->setFocus(); });
|
||||
QObject::connect(text, &Ui::InputField::tabbed, [=] { url->setFocus(); });
|
||||
url->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
text->setFocus();
|
||||
}, url->lifetime());
|
||||
text->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
url->setFocus();
|
||||
}, text->lifetime());
|
||||
}
|
||||
|
||||
TextWithEntities StripSupportHashtag(TextWithEntities text) {
|
||||
|
@ -590,7 +598,8 @@ AutocompleteQuery ParseMentionHashtagBotCommandQuery(
|
|||
MessageLinksParser::MessageLinksParser(not_null<Ui::InputField*> field)
|
||||
: _field(field)
|
||||
, _timer([=] { parse(); }) {
|
||||
_connection = QObject::connect(_field, &Ui::InputField::changed, [=] {
|
||||
_lifetime = _field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto length = _field->getTextWithTags().text.size();
|
||||
const auto timeout = (std::abs(length - _lastLength) > 2)
|
||||
? 0
|
||||
|
|
|
@ -7,9 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "base/timer.h"
|
||||
#include "base/qt_connection.h"
|
||||
#include "chat_helpers/compose/compose_features.h"
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_SPELLCHECK
|
||||
|
@ -132,7 +131,7 @@ private:
|
|||
int _lastLength = 0;
|
||||
bool _disabled = false;
|
||||
base::Timer _timer;
|
||||
base::qt_connection _connection;
|
||||
rpl::lifetime _lifetime;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "lottie/lottie_single_player.h"
|
||||
#include "ui/dpr/dpr_icon.h"
|
||||
#include "ui/dpr/dpr_image.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/painter.h"
|
||||
#include "ui/rect_part.h"
|
||||
|
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "boxes/send_files_box.h"
|
||||
#include "history/view/history_view_quick_action.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "storage/serialize_common.h"
|
||||
#include "window/section_widget.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
|
|
|
@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "data/data_drafts.h"
|
||||
|
||||
#include "api/api_text_entities.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "chat_helpers/message_field.h"
|
||||
#include "history/history.h"
|
||||
#include "history/history_widget.h"
|
||||
|
|
|
@ -24,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "lang/lang_keys.h"
|
||||
#include "core/application.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "storage/storage_facade.h"
|
||||
#include "storage/storage_shared_media.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
|
|
@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "data/data_types.h"
|
||||
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "storage/cache/storage_cache_types.h"
|
||||
#include "base/openssl_help.h"
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ffmpeg/ffmpeg_frame_generator.h"
|
||||
#include "chat_helpers/stickers_lottie.h"
|
||||
#include "storage/file_download.h" // kMaxFileInMemory
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/text/text_custom_emoji.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/ui_utility.h"
|
||||
|
|
|
@ -22,7 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "boxes/peers/edit_peer_requests_box.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/elastic_scroll.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/wrap/fade_wrap.h"
|
||||
#include "ui/effects/radial_animation.h"
|
||||
#include "ui/chat/requests_bar.h"
|
||||
|
@ -78,6 +78,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include <QtCore/QMimeData>
|
||||
#include <QtWidgets/QScrollBar>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
|
||||
namespace Dialogs {
|
||||
namespace {
|
||||
|
@ -340,12 +341,12 @@ Widget::Widget(
|
|||
Ui::PostponeCall(this, [=] { listScrollUpdated(); });
|
||||
}, lifetime());
|
||||
|
||||
QObject::connect(_filter, &Ui::InputField::changed, [=] {
|
||||
_filter->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
applyFilterUpdate();
|
||||
});
|
||||
QObject::connect(_filter, &Ui::InputField::submitted, [=] {
|
||||
submit();
|
||||
});
|
||||
}, _filter->lifetime());
|
||||
_filter->submits(
|
||||
) | rpl::start_with_next([=] { submit(); }, _filter->lifetime());
|
||||
QObject::connect(
|
||||
_filter->rawTextEdit().get(),
|
||||
&QTextEdit::cursorPositionChanged,
|
||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "mainwidget.h"
|
||||
#include "mainwindow.h"
|
||||
|
@ -125,9 +125,16 @@ FixedBar::FixedBar(
|
|||
_cancel->setClickedCallback([=] { cancelSearch(); });
|
||||
_field->hide();
|
||||
_filter->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
||||
connect(_field, &Ui::InputField::cancelled, [=] { cancelSearch(); });
|
||||
connect(_field, &Ui::InputField::changed, [=] { searchUpdated(); });
|
||||
connect(_field, &Ui::InputField::submitted, [=] { applySearch(); });
|
||||
_field->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
cancelSearch();
|
||||
}, _field->lifetime());
|
||||
_field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
searchUpdated();
|
||||
}, _field->lifetime());
|
||||
_field->submits(
|
||||
) | rpl::start_with_next([=] { applySearch(); }, _field->lifetime());
|
||||
_searchTimer.setCallback([=] { applySearch(); });
|
||||
|
||||
_cancel->hide(anim::type::instant);
|
||||
|
|
|
@ -304,25 +304,30 @@ HistoryWidget::HistoryWidget(
|
|||
_joinChannel->addClickHandler([=] { joinChannel(); });
|
||||
_muteUnmute->addClickHandler([=] { toggleMuteUnmute(); });
|
||||
_reportMessages->addClickHandler([=] { reportSelectedMessages(); });
|
||||
connect(
|
||||
_field,
|
||||
&Ui::InputField::submitted,
|
||||
[=](Qt::KeyboardModifiers modifiers) { sendWithModifiers(modifiers); });
|
||||
connect(_field, &Ui::InputField::cancelled, [=] {
|
||||
_field->submits(
|
||||
) | rpl::start_with_next([=](Qt::KeyboardModifiers modifiers) {
|
||||
sendWithModifiers(modifiers);
|
||||
}, _field->lifetime());
|
||||
_field->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
escape();
|
||||
});
|
||||
connect(_field, &Ui::InputField::tabbed, [=] {
|
||||
}, _field->lifetime());
|
||||
_field->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
fieldTabbed();
|
||||
});
|
||||
connect(_field, &Ui::InputField::resized, [=] {
|
||||
}, _field->lifetime());
|
||||
_field->heightChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
fieldResized();
|
||||
});
|
||||
connect(_field, &Ui::InputField::focused, [=] {
|
||||
}, _field->lifetime());
|
||||
_field->focusedChanges(
|
||||
) | rpl::filter(rpl::mappers::_1) | rpl::start_with_next([=] {
|
||||
fieldFocused();
|
||||
});
|
||||
connect(_field, &Ui::InputField::changed, [=] {
|
||||
}, _field->lifetime());
|
||||
_field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
fieldChanged();
|
||||
});
|
||||
}, _field->lifetime());
|
||||
connect(
|
||||
controller->widget()->windowHandle(),
|
||||
&QWindow::visibleChanged,
|
||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "chat_helpers/bot_command.h"
|
||||
#include "chat_helpers/field_autocomplete.h"
|
||||
#include "window/section_widget.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "mtproto/sender.h"
|
||||
#include "base/flags.h"
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "media/audio/media_audio.h"
|
||||
#include "ui/text/text_options.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/dropdown_menu.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "ui/controls/emoji_button.h"
|
||||
|
@ -1250,7 +1250,7 @@ bool ComposeControls::focused() const {
|
|||
}
|
||||
|
||||
rpl::producer<bool> ComposeControls::focusedValue() const {
|
||||
return rpl::single(focused()) | rpl::then(_focusChanges.events());
|
||||
return rpl::single(focused()) | rpl::then(_field->focusedChanges());
|
||||
}
|
||||
|
||||
rpl::producer<bool> ComposeControls::tabbedPanelShownValue() const {
|
||||
|
@ -1291,12 +1291,9 @@ auto ComposeControls::sendContentRequests(SendRequestType requestType) const {
|
|||
return (_send->type() == type) && (sendRequestType == requestType);
|
||||
});
|
||||
auto map = rpl::map_to(Api::SendOptions());
|
||||
auto submits = base::qt_signal_producer(
|
||||
_field.get(),
|
||||
&Ui::InputField::submitted);
|
||||
return rpl::merge(
|
||||
_send->clicks() | filter | map,
|
||||
std::move(submits) | filter | map,
|
||||
_field->submits() | filter | map,
|
||||
_sendCustomRequests.events());
|
||||
}
|
||||
|
||||
|
@ -1317,12 +1314,9 @@ rpl::producer<MessageToEdit> ComposeControls::editRequests() const {
|
|||
auto filter = rpl::filter([=] {
|
||||
return _send->type() == Ui::SendButton::Type::Save;
|
||||
});
|
||||
auto submits = base::qt_signal_producer(
|
||||
_field.get(),
|
||||
&Ui::InputField::submitted);
|
||||
return rpl::merge(
|
||||
_send->clicks() | filter | toValue,
|
||||
std::move(submits) | filter | toValue);
|
||||
_field->submits() | filter | toValue);
|
||||
}
|
||||
|
||||
rpl::producer<std::optional<bool>> ComposeControls::attachRequests() const {
|
||||
|
@ -1776,17 +1770,22 @@ void ComposeControls::initKeyHandler() {
|
|||
void ComposeControls::initField() {
|
||||
_field->setMaxHeight(st::historyComposeFieldMaxHeight);
|
||||
updateSubmitSettings();
|
||||
//Ui::Connect(_field, &Ui::InputField::submitted, [=] { send(); });
|
||||
Ui::Connect(_field, &Ui::InputField::cancelled, [=] { escape(); });
|
||||
Ui::Connect(_field, &Ui::InputField::tabbed, [=] { fieldTabbed(); });
|
||||
Ui::Connect(_field, &Ui::InputField::resized, [=] { updateHeight(); });
|
||||
Ui::Connect(_field, &Ui::InputField::focused, [=] {
|
||||
_focusChanges.fire(true);
|
||||
});
|
||||
Ui::Connect(_field, &Ui::InputField::blurred, [=] {
|
||||
_focusChanges.fire(false);
|
||||
});
|
||||
Ui::Connect(_field, &Ui::InputField::changed, [=] { fieldChanged(); });
|
||||
_field->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
escape();
|
||||
}, _field->lifetime());
|
||||
_field->tabbed(
|
||||
) | rpl::start_with_next([=] {
|
||||
fieldTabbed();
|
||||
}, _field->lifetime());
|
||||
_field->heightChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
updateHeight();
|
||||
}, _field->lifetime());
|
||||
_field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
fieldChanged();
|
||||
}, _field->lifetime());
|
||||
InitMessageField(_show, _field, [=](not_null<DocumentData*> emoji) {
|
||||
if (_history && Data::AllowEmojiWithoutPremium(_history->peer)) {
|
||||
return true;
|
||||
|
|
|
@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/round_rect.h"
|
||||
#include "ui/rp_widget.h"
|
||||
#include "ui/effects/animations.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
|
||||
class History;
|
||||
class DocumentData;
|
||||
|
@ -424,7 +424,6 @@ private:
|
|||
std::unique_ptr<WebpageProcessor> _preview;
|
||||
|
||||
Fn<void()> _raiseEmojiSuggestions;
|
||||
rpl::event_stream<bool> _focusChanges;
|
||||
|
||||
rpl::lifetime _historyLifetime;
|
||||
rpl::lifetime _uploaderSubscriptions;
|
||||
|
|
|
@ -14,7 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "base/event_filter.h"
|
||||
#include "base/qt/qt_key_modifiers.h"
|
||||
#include "base/unixtime.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
|
|
|
@ -27,7 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/controls/userpic_button.h"
|
||||
#include "ui/wrap/fade_wrap.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/widgets/menu/menu_add_action_callback_factory.h"
|
||||
#include "ui/effects/radial_animation.h"
|
||||
|
@ -1225,10 +1225,12 @@ bool TopBarWidget::toggleSearch(bool shown, anim::type animated) {
|
|||
_searchCancel.create(this, st::dialogsCancelSearch);
|
||||
_searchCancel->show(anim::type::instant);
|
||||
_searchCancel->setClickedCallback([=] { _searchCancelled.fire({}); });
|
||||
QObject::connect(_searchField, &Ui::InputField::submitted, [=] {
|
||||
_searchField->submits(
|
||||
) | rpl::start_with_next([=] {
|
||||
_searchSubmitted.fire({});
|
||||
});
|
||||
QObject::connect(_searchField, &Ui::InputField::changed, [=] {
|
||||
}, _searchField->lifetime());
|
||||
_searchField->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto was = _searchQuery.current();
|
||||
const auto now = _searchField->getLastText();
|
||||
if (_jumpToDate && was.isEmpty() != now.isEmpty()) {
|
||||
|
@ -1243,7 +1245,7 @@ bool TopBarWidget::toggleSearch(bool shown, anim::type animated) {
|
|||
}
|
||||
}
|
||||
_searchQuery = now;
|
||||
});
|
||||
}, _searchField->lifetime());
|
||||
} else {
|
||||
Assert(_searchField != nullptr);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "window/window_session_controller.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/search_field_controller.h"
|
||||
#include "lang/lang_keys.h"
|
||||
|
|
|
@ -23,7 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "main/main_session.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/wrap/fade_wrap.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
|
@ -253,7 +253,8 @@ void TopBar::createSearchView(
|
|||
};
|
||||
|
||||
cancel->addClickHandler(cancelSearch);
|
||||
field->connect(field, &Ui::InputField::cancelled, cancelSearch);
|
||||
field->cancelled(
|
||||
) | rpl::start_with_next(cancelSearch, field->lifetime());
|
||||
|
||||
wrap->widthValue(
|
||||
) | rpl::start_with_next([=](int newWidth) {
|
||||
|
|
|
@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "info/info_memento.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/text/text_utilities.h" // Ui::Text::ToUpper
|
||||
|
|
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/update_checker.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/fields/masked_input_field.h"
|
||||
#include "ui/text/format_values.h" // Ui::FormatPhone
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
|
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "intro/intro_step.h"
|
||||
#include "intro/intro_widget.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/masked_input_field.h"
|
||||
#include "base/timer.h"
|
||||
|
||||
namespace Ui {
|
||||
|
|
|
@ -8,15 +8,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "intro/intro_password_check.h"
|
||||
|
||||
#include "intro/intro_widget.h"
|
||||
#include "core/file_utilities.h"
|
||||
#include "core/core_cloud_password.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "boxes/passcode_box.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "intro/intro_signup.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
#include "main/main_account.h"
|
||||
#include "base/random.h"
|
||||
#include "styles/style_intro.h"
|
||||
|
@ -46,7 +45,10 @@ PasswordCheckWidget::PasswordCheckWidget(
|
|||
_toRecover->addClickHandler([=] { toRecover(); });
|
||||
_toPassword->addClickHandler([=] { toPassword(); });
|
||||
connect(_pwdField, &Ui::PasswordInput::changed, [=] { hideError(); });
|
||||
connect(_codeField, &Ui::InputField::changed, [=] { hideError(); });
|
||||
_codeField->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
hideError();
|
||||
}, _codeField->lifetime());
|
||||
|
||||
setTitleText(tr::lng_signin_title());
|
||||
updateDescriptionText();
|
||||
|
|
|
@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "lang/lang_keys.h"
|
||||
#include "ui/controls/userpic_button.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "styles/style_intro.h"
|
||||
#include "styles/style_boxes.h"
|
||||
|
|
|
@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "main/main_session_settings.h"
|
||||
|
||||
#include "chat_helpers/tabbed_selector.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/chat/attach/attach_send_files_way.h"
|
||||
#include "window/section_widget.h"
|
||||
#include "support/support_common.h"
|
||||
|
|
|
@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "passport/passport_edit_identity_box.h"
|
||||
|
||||
#include "passport/passport_panel_controller.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/text_options.h"
|
||||
#include "lang/lang_keys.h"
|
||||
|
|
|
@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/file_utilities.h"
|
||||
#include "passport/passport_panel_controller.h"
|
||||
#include "passport/ui/passport_details_row.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
|
@ -195,11 +195,12 @@ void VerifyBox::setupControls(
|
|||
if (codeLength > 0) {
|
||||
_code->setAutoSubmit(codeLength, _submit);
|
||||
} else {
|
||||
connect(_code, &Ui::SentCodeField::submitted, _submit);
|
||||
_code->submits() | rpl::start_with_next(_submit, _code->lifetime());
|
||||
}
|
||||
connect(_code, &Ui::SentCodeField::changed, [=] {
|
||||
_code->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
problem->hide(anim::type::normal);
|
||||
});
|
||||
}, _code->lifetime());
|
||||
}
|
||||
|
||||
void VerifyBox::setInnerFocus() {
|
||||
|
|
|
@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "passport/passport_panel_edit_scans.h"
|
||||
#include "passport/ui/passport_details_row.h"
|
||||
#include "ui/effects/scroll_content_shadow.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
|
|
|
@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/controls/userpic_button.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "boxes/passcode_box.h"
|
||||
|
|
|
@ -9,7 +9,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "lang/lang_keys.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/fields/masked_input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
|
@ -268,9 +269,16 @@ AbstractTextRow<Input>::AbstractTextRow(
|
|||
, _field(this, st::passportDetailsField, nullptr, value)
|
||||
, _value(value) {
|
||||
_field->setMaxLength(limit);
|
||||
connect(_field, &Input::changed, [=] {
|
||||
_value = valueCurrent();
|
||||
});
|
||||
if constexpr (std::is_same<Input, Ui::InputField>::value) {
|
||||
_field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
_value = valueCurrent();
|
||||
}, _field->lifetime());
|
||||
} else {
|
||||
connect(_field, &Input::changed, [=] {
|
||||
_value = valueCurrent();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Input>
|
||||
|
|
|
@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "payments/ui/payments_field.h"
|
||||
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/boxes/country_select_box.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "ui/ui_utility.h"
|
||||
|
@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "styles/style_payments.h"
|
||||
|
||||
#include <QtCore/QRegularExpression>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
|
||||
namespace Payments::Ui {
|
||||
namespace {
|
||||
|
@ -610,7 +611,8 @@ void Field::setupValidator(Fn<ValidateResult(ValidateRequest)> validator) {
|
|||
} else {
|
||||
const auto raw = _input->rawTextEdit();
|
||||
QObject::connect(raw, &QTextEdit::cursorPositionChanged, save);
|
||||
QObject::connect(_input, &InputField::changed, validate);
|
||||
_input->changes(
|
||||
) | rpl::start_with_next(validate, _input->lifetime());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -648,7 +650,8 @@ void Field::setupSubmit() {
|
|||
if (_masked) {
|
||||
QObject::connect(_masked, &MaskedInputField::submitted, submitted);
|
||||
} else {
|
||||
QObject::connect(_input, &InputField::submitted, submitted);
|
||||
_input->submits(
|
||||
) | rpl::start_with_next(submitted, _input->lifetime());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "base/event_filter.h"
|
||||
#include "ui/platform/ui_platform_window_title.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/ui_utility.h"
|
||||
|
||||
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
|
@ -40,6 +40,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include <QtCore/QMimeData>
|
||||
#include <QtGui/QWindow>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <giomm.h>
|
||||
|
|
|
@ -33,10 +33,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "boxes/about_box.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "base/platform/mac/base_utilities_mac.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/ui_utility.h"
|
||||
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
#include <QtGui/QClipboard>
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "platform/mac/touchbar/mac_touchbar_common.h"
|
||||
#include "styles/style_basic.h"
|
||||
#include "styles/style_settings.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "window/section_widget.h"
|
||||
#include "window/window_controller.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
@ -47,6 +47,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#import <AppKit/NSSegmentedControl.h>
|
||||
#import <AppKit/NSTextField.h>
|
||||
|
||||
#include <QtWidgets/QTextEdit>
|
||||
|
||||
using TouchBar::kCircleDiameter;
|
||||
using TouchBar::CreateNSImageFromStyleIcon;
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "lang/lang_keys.h"
|
||||
#include "lottie/lottie_icon.h"
|
||||
#include "main/main_session.h"
|
||||
#include "settings/cloud_password/settings_cloud_password_common.h"
|
||||
#include "settings/cloud_password/settings_cloud_password_email.h"
|
||||
#include "settings/cloud_password/settings_cloud_password_email_confirm.h"
|
||||
#include "settings/cloud_password/settings_cloud_password_hint.h"
|
||||
|
@ -23,7 +22,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "settings/settings_common.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "settings/cloud_password/settings_cloud_password_manage.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
@ -90,9 +90,10 @@ void Email::setupContent() {
|
|||
currentStepDataEmail);
|
||||
const auto newInput = wrap->entity();
|
||||
const auto error = AddError(content, nullptr);
|
||||
QObject::connect(newInput, &Ui::InputField::changed, [=] {
|
||||
newInput->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
error->hide();
|
||||
});
|
||||
}, newInput->lifetime());
|
||||
AddSkipInsteadOfField(content);
|
||||
|
||||
const auto send = [=](Fn<void()> close) {
|
||||
|
@ -189,7 +190,7 @@ void Email::setupContent() {
|
|||
});
|
||||
|
||||
const auto submit = [=] { button->clicked({}, Qt::LeftButton); };
|
||||
QObject::connect(newInput, &Ui::InputField::submitted, submit);
|
||||
newInput->submits() | rpl::start_with_next(submit, newInput->lifetime());
|
||||
|
||||
setFocusCallback([=] { newInput->setFocus(); });
|
||||
|
||||
|
|
|
@ -136,9 +136,10 @@ void EmailConfirm::setupContent() {
|
|||
std::move(objectInput)));
|
||||
|
||||
const auto error = AddError(content, nullptr);
|
||||
QObject::connect(newInput, &Ui::InputField::changed, [=] {
|
||||
newInput->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
error->hide();
|
||||
});
|
||||
}, newInput->lifetime());
|
||||
AddSkipInsteadOfField(content);
|
||||
|
||||
const auto resendInfo = Ui::CreateChild<Ui::FlatLabel>(
|
||||
|
@ -326,7 +327,7 @@ void EmailConfirm::setupContent() {
|
|||
|
||||
const auto submit = [=] { button->clicked({}, Qt::LeftButton); };
|
||||
newInput->setAutoSubmit(currentStepDataCodeLength, submit);
|
||||
QObject::connect(newInput, &Ui::InputField::submitted, submit);
|
||||
newInput->submits() | rpl::start_with_next(submit, newInput->lifetime());
|
||||
|
||||
setFocusCallback([=] { newInput->setFocus(); });
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "settings/cloud_password/settings_cloud_password_email.h"
|
||||
#include "settings/cloud_password/settings_cloud_password_manage.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
|
@ -79,9 +79,10 @@ void Hint::setupContent() {
|
|||
currentStepDataHint);
|
||||
const auto newInput = wrap->entity();
|
||||
const auto error = AddError(content, nullptr);
|
||||
QObject::connect(newInput, &Ui::InputField::changed, [=] {
|
||||
newInput->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
error->hide();
|
||||
});
|
||||
}, newInput->lifetime());
|
||||
AddSkipInsteadOfField(content);
|
||||
|
||||
const auto save = [=](const QString &hint) {
|
||||
|
@ -142,7 +143,7 @@ void Hint::setupContent() {
|
|||
});
|
||||
|
||||
const auto submit = [=] { button->clicked({}, Qt::LeftButton); };
|
||||
QObject::connect(newInput, &Ui::InputField::submitted, submit);
|
||||
newInput->submits() | rpl::start_with_next(submit, newInput->lifetime());
|
||||
|
||||
setFocusCallback([=] { newInput->setFocus(); });
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
|
|
@ -21,7 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "boxes/local_storage_box.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/color_editor.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
|
|
|
@ -30,7 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "window/window_controller.h"
|
||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "ui/widgets/menu/menu_add_action_callback_factory.h"
|
||||
|
@ -538,10 +538,8 @@ void SetupBio(
|
|||
auto cursor = bio->textCursor();
|
||||
cursor.setPosition(bio->getLastText().size());
|
||||
bio->setTextCursor(cursor);
|
||||
QObject::connect(bio, &Ui::InputField::submitted, [=] {
|
||||
save();
|
||||
});
|
||||
QObject::connect(bio, &Ui::InputField::changed, updated);
|
||||
bio->submits() | rpl::start_with_next([=] { save(); }, bio->lifetime());
|
||||
bio->changes() | rpl::start_with_next(updated, bio->lifetime());
|
||||
bio->setInstantReplaces(Ui::InstantReplaces::Default());
|
||||
bio->setInstantReplacesEnabled(
|
||||
Core::App().settings().replaceEmojiValue());
|
||||
|
|
|
@ -20,7 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "storage/storage_domain.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
|
|
@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/application.h"
|
||||
#include "core/core_settings.h"
|
||||
#include "mtproto/mtproto_config.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/chat/attach/attach_send_files_way.h"
|
||||
#include "ui/power_saving.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
|
|
|
@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/chat/chat_theme.h"
|
||||
#include "ui/chat/chat_style.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/painter.h"
|
||||
|
@ -418,16 +418,20 @@ void Autocomplete::setupContent() {
|
|||
};
|
||||
|
||||
inner->activated() | rpl::start_with_next(submit, lifetime());
|
||||
connect(input, &Ui::InputField::blurred, [=] {
|
||||
input->focusedChanges(
|
||||
) | rpl::filter(!rpl::mappers::_1) | rpl::start_with_next([=] {
|
||||
base::call_delayed(10, this, [=] {
|
||||
if (!input->hasFocus()) {
|
||||
deactivate();
|
||||
}
|
||||
});
|
||||
});
|
||||
connect(input, &Ui::InputField::cancelled, [=] { deactivate(); });
|
||||
connect(input, &Ui::InputField::changed, refresh);
|
||||
connect(input, &Ui::InputField::submitted, submit);
|
||||
}, input->lifetime());
|
||||
input->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
deactivate();
|
||||
}, input->lifetime());
|
||||
input->changes() | rpl::start_with_next(refresh, input->lifetime());
|
||||
input->submits() | rpl::start_with_next(submit, input->lifetime());
|
||||
input->customUpDown(true);
|
||||
|
||||
_activate = [=] {
|
||||
|
|
|
@ -18,7 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "history/history.h"
|
||||
#include "boxes/abstract_box.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "ui/text/text_entity.h"
|
||||
|
@ -109,8 +109,11 @@ void EditInfoBox::prepare() {
|
|||
addButton(tr::lng_settings_save(), save);
|
||||
addButton(tr::lng_cancel(), [=] { closeBox(); });
|
||||
|
||||
connect(_field, &Ui::InputField::submitted, save);
|
||||
connect(_field, &Ui::InputField::cancelled, [=] { closeBox(); });
|
||||
_field->submits() | rpl::start_with_next(save, _field->lifetime());
|
||||
_field->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
closeBox();
|
||||
}, _field->lifetime());
|
||||
Ui::Emoji::SuggestionsController::Init(
|
||||
getDelegate()->outerContainer(),
|
||||
_field,
|
||||
|
|
|
@ -11,13 +11,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "base/event_filter.h"
|
||||
#include "ui/boxes/calendar_box.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/time_input.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "styles/style_layers.h"
|
||||
#include "styles/style_boxes.h"
|
||||
|
||||
#include <QtWidgets/QTextEdit>
|
||||
|
||||
namespace Ui {
|
||||
namespace {
|
||||
|
||||
|
@ -147,8 +149,9 @@ ChooseDateTimeBoxDescriptor ChooseDateTimeBox(
|
|||
const auto calendar =
|
||||
content->lifetime().make_state<QPointer<CalendarBox>>();
|
||||
const auto calendarStyle = args.style.calendarStyle;
|
||||
QObject::connect(state->day, &InputField::focused, [=] {
|
||||
if (*calendar) {
|
||||
state->day->focusedChanges(
|
||||
) | rpl::start_with_next([=](bool focused) {
|
||||
if (*calendar || !focused) {
|
||||
return;
|
||||
}
|
||||
*calendar = box->getDelegate()->show(
|
||||
|
@ -167,7 +170,7 @@ ChooseDateTimeBoxDescriptor ChooseDateTimeBox(
|
|||
) | rpl::start_with_next(crl::guard(state->time, [=] {
|
||||
state->time->setFocusFast();
|
||||
}), (*calendar)->lifetime());
|
||||
});
|
||||
}, state->day->lifetime());
|
||||
|
||||
const auto collect = [=] {
|
||||
const auto timeValue = state->time->valueCurrent().split(':');
|
||||
|
|
|
@ -73,7 +73,8 @@ void ConfirmPhoneBox::prepare() {
|
|||
+ st::usernameSkip
|
||||
+ (_fragment ? (_fragment->height() + fragmentSkip()) : 0));
|
||||
|
||||
connect(_code, &Ui::InputField::submitted, [=] { sendCode(); });
|
||||
_code->submits(
|
||||
) | rpl::start_with_next([=] { sendCode(); }, _code->lifetime());
|
||||
|
||||
showChildren();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "lang/lang_keys.h"
|
||||
#include "ui/boxes/choose_date_time.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/fields/number_input.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "base/unixtime.h"
|
||||
|
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "styles/style_layers.h"
|
||||
#include "styles/style_calls.h"
|
||||
|
||||
|
@ -92,11 +92,16 @@ void RateCallBox::ratingChanged(int value) {
|
|||
_comment->height());
|
||||
|
||||
updateMaxHeight();
|
||||
connect(_comment, &InputField::resized, [=] {
|
||||
_comment->heightChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
commentResized();
|
||||
});
|
||||
connect(_comment, &InputField::submitted, [=] { send(); });
|
||||
connect(_comment, &InputField::cancelled, [=] { closeBox(); });
|
||||
}, _comment->lifetime());
|
||||
_comment->submits(
|
||||
) | rpl::start_with_next([=] { send(); }, _comment->lifetime());
|
||||
_comment->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
closeBox();
|
||||
}, _comment->lifetime());
|
||||
}
|
||||
_comment->setFocusFast();
|
||||
} else if (_comment) {
|
||||
|
|
|
@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "info/profile/info_profile_icon.h"
|
||||
#include "styles/style_chat_helpers.h"
|
||||
|
@ -148,7 +148,8 @@ void ReportDetailsBox(
|
|||
const auto text = details->getLastText();
|
||||
done(text);
|
||||
};
|
||||
QObject::connect(details, &InputField::submitted, submit);
|
||||
details->submits(
|
||||
) | rpl::start_with_next(submit, details->lifetime());
|
||||
box->addButton(tr::lng_report_button(), submit);
|
||||
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "base/qt_signal_producer.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/wrap/fade_wrap.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/painter.h"
|
||||
|
@ -306,7 +306,8 @@ anim::type SearchWithGroups::animated() const {
|
|||
}
|
||||
|
||||
void SearchWithGroups::initField() {
|
||||
connect(_field, &InputField::changed, [=] {
|
||||
_field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto last = FieldQuery(_field);
|
||||
_query = last;
|
||||
const auto empty = last.empty();
|
||||
|
@ -319,7 +320,7 @@ void SearchWithGroups::initField() {
|
|||
_chosenGroup = QString();
|
||||
scrollGroupsToStart();
|
||||
}
|
||||
});
|
||||
}, _field->lifetime());
|
||||
|
||||
_fieldPlaceholderWidth = tr::lng_dlg_filter(
|
||||
) | rpl::map([=](const QString &value) {
|
||||
|
@ -492,9 +493,10 @@ void SearchWithGroups::initButtons() {
|
|||
_field->setFocus();
|
||||
scrollGroupsToStart();
|
||||
});
|
||||
QObject::connect(_field, &InputField::focused, [=] {
|
||||
_field->focusedChanges(
|
||||
) | rpl::filter(rpl::mappers::_1) | rpl::start_with_next([=] {
|
||||
scrollGroupsToStart();
|
||||
});
|
||||
}, _field->lifetime());
|
||||
_field->raise();
|
||||
_fade->raise();
|
||||
_search->raise();
|
||||
|
@ -519,9 +521,7 @@ void SearchWithGroups::ensureRounding(int size, float64 ratio) {
|
|||
}
|
||||
|
||||
rpl::producer<> SearchWithGroups::escapes() const {
|
||||
return base::qt_signal_producer(
|
||||
_field.get(),
|
||||
&Ui::InputField::cancelled);
|
||||
return _field->cancelled();
|
||||
}
|
||||
|
||||
rpl::producer<std::vector<QString>> SearchWithGroups::queryValue() const {
|
||||
|
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "styles/style_widgets.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "lang/lang_keys.h"
|
||||
|
@ -30,9 +30,10 @@ auto SearchFieldController::createRowView(
|
|||
|
||||
auto field = createField(wrap, st.field).release();
|
||||
field->show();
|
||||
field->connect(field, &Ui::InputField::cancelled, [=] {
|
||||
field->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
field->setText(QString());
|
||||
});
|
||||
}, field->lifetime());
|
||||
|
||||
auto cancel = CreateChild<Ui::CrossButton>(
|
||||
wrap,
|
||||
|
@ -104,9 +105,10 @@ base::unique_qptr<Ui::InputField> SearchFieldController::createField(
|
|||
tr::lng_dlg_filter(),
|
||||
_query.current());
|
||||
auto field = result.get();
|
||||
field->connect(field, &Ui::InputField::changed, [=] {
|
||||
field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
_query = field->getLastText();
|
||||
});
|
||||
}, field->lifetime());
|
||||
_view.reset(field);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/painter.h"
|
||||
#include "ui/rect.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/masked_input_field.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "styles/style_boxes.h"
|
||||
#include "styles/style_media_view.h"
|
||||
|
|
|
@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "lang/lang_keys.h"
|
||||
#include "countries/countries_instance.h" // Countries::ValidPhoneCode
|
||||
#include "styles/style_widgets.h"
|
||||
|
||||
#include <QtCore/QRegularExpression>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/masked_input_field.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/widgets/multi_select.h"
|
||||
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/effects/animations.h"
|
||||
#include "ui/effects/cross_animation.h"
|
||||
|
@ -453,7 +453,6 @@ protected:
|
|||
void keyPressEvent(QKeyEvent *e) override;
|
||||
|
||||
private:
|
||||
void submitted(Qt::KeyboardModifiers modifiers);
|
||||
void cancelled();
|
||||
void queryChanged();
|
||||
void fieldFocused();
|
||||
|
@ -659,10 +658,24 @@ MultiSelect::Inner::Inner(
|
|||
, _field(this, _st.field, std::move(placeholder), query)
|
||||
, _cancel(this, _st.fieldCancel) {
|
||||
_field->customUpDown(true);
|
||||
connect(_field, &Ui::InputField::focused, [=] { fieldFocused(); });
|
||||
connect(_field, &Ui::InputField::changed, [=] { queryChanged(); });
|
||||
connect(_field, &Ui::InputField::submitted, this, &Inner::submitted);
|
||||
connect(_field, &Ui::InputField::cancelled, this, &Inner::cancelled);
|
||||
_field->focusedChanges(
|
||||
) | rpl::filter(rpl::mappers::_1) | rpl::start_with_next([=] {
|
||||
fieldFocused();
|
||||
}, _field->lifetime());
|
||||
_field->changes(
|
||||
) | rpl::start_with_next([=] {
|
||||
queryChanged();
|
||||
}, _field->lifetime());
|
||||
_field->submits(
|
||||
) | rpl::start_with_next([=](Qt::KeyboardModifiers m) {
|
||||
if (_submittedCallback) {
|
||||
_submittedCallback(m);
|
||||
}
|
||||
}, _field->lifetime());
|
||||
_field->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
cancelled();
|
||||
}, _field->lifetime());
|
||||
_cancel->setClickedCallback([=] {
|
||||
clearQuery();
|
||||
_field->setFocus();
|
||||
|
@ -874,12 +887,6 @@ void MultiSelect::Inner::keyPressEvent(QKeyEvent *e) {
|
|||
}
|
||||
}
|
||||
|
||||
void MultiSelect::Inner::submitted(Qt::KeyboardModifiers modifiers) {
|
||||
if (_submittedCallback) {
|
||||
_submittedCallback(modifiers);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiSelect::Inner::cancelled() {
|
||||
if (_cancelledCallback) {
|
||||
_cancelledCallback();
|
||||
|
|
|
@ -19,7 +19,7 @@ SentCodeField::SentCodeField(
|
|||
rpl::producer<QString> placeholder,
|
||||
const QString &val)
|
||||
: Ui::InputField(parent, st, std::move(placeholder), val) {
|
||||
connect(this, &Ui::InputField::changed, [this] { fix(); });
|
||||
changes() | rpl::start_with_next([=] { fix(); }, lifetime());
|
||||
}
|
||||
|
||||
void SentCodeField::setAutoSubmit(int length, Fn<void()> submitCallback) {
|
||||
|
|
|
@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#pragma once
|
||||
|
||||
#include "base/timer.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "chat_helpers/message_field.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/platform/ui_platform_utility.h"
|
||||
#include "ui/text/text_options.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
|
@ -1105,9 +1105,16 @@ void Notification::showReplyField() {
|
|||
|
||||
// Catch mouse press event to activate the window.
|
||||
QCoreApplication::instance()->installEventFilter(this);
|
||||
connect(_replyArea, &Ui::InputField::resized, [=] { replyResized(); });
|
||||
connect(_replyArea, &Ui::InputField::submitted, [=] { sendReply(); });
|
||||
connect(_replyArea, &Ui::InputField::cancelled, [=] { replyCancel(); });
|
||||
_replyArea->heightChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
replyResized();
|
||||
}, _replyArea->lifetime());
|
||||
_replyArea->submits(
|
||||
) | rpl::start_with_next([=] { sendReply(); }, _replyArea->lifetime());
|
||||
_replyArea->cancelled(
|
||||
) | rpl::start_with_next([=] {
|
||||
replyCancel();
|
||||
}, _replyArea->lifetime());
|
||||
|
||||
_replySend.create(this, st::notifySendReply);
|
||||
_replySend->moveToRight(st::notifyBorderWidth, st::notifyMinHeight);
|
||||
|
|
|
@ -14,7 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "window/window_controller.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/text/text.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/toast/toast.h"
|
||||
|
|
|
@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "chat_helpers/compose/compose_show.h"
|
||||
#include "chat_helpers/message_field.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "api/api_chat_participants.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
|
@ -1924,9 +1924,8 @@ QPointer<Ui::BoxContent> ShowForwardMessagesBox(
|
|||
|
||||
const auto field = comment->entity();
|
||||
|
||||
QObject::connect(field, &Ui::InputField::submitted, [=] {
|
||||
submit({});
|
||||
});
|
||||
field->submits(
|
||||
) | rpl::start_with_next([=] { submit({}); }, field->lifetime());
|
||||
InitMessageFieldHandlers(
|
||||
session,
|
||||
show,
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c989a9f41e5bd8268587af2256efa89327cb3ae0
|
||||
Subproject commit dfc42b20ce602b105e5400e03eed626fd5bab7df
|
|
@ -1 +1 @@
|
|||
Subproject commit bcf88b90658c7e0925c11c486732d874477baf0d
|
||||
Subproject commit 5a2402ad5d7e41a48c84d56c45df6b5d49e8b176
|
|
@ -1 +1 @@
|
|||
Subproject commit 5b9092bcb27a207fed3cb2155bb98db46d7cedfa
|
||||
Subproject commit 552d96a51fa5c8e50f9d6f631055558d99356cb4
|
Loading…
Add table
Reference in a new issue