2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Replace FlatTextarea with InputField.

This commit is contained in:
John Preston
2018-05-22 00:31:46 +03:00
parent 30dd8fe070
commit 017ec87d60
29 changed files with 1646 additions and 2272 deletions

View File

@@ -1072,7 +1072,7 @@ void EditBioBox::prepare() {
addButton(langFactory(lng_settings_save), [this] { save(); });
addButton(langFactory(lng_cancel), [this] { closeBox(); });
_bio->setMaxLength(kMaxBioLength);
_bio->setCtrlEnterSubmit(Ui::CtrlEnterSubmit::Both);
_bio->setSubmitSettings(Ui::InputField::SubmitSettings::Both);
auto cursor = _bio->textCursor();
cursor.setPosition(_bio->getLastText().size());
_bio->setTextCursor(cursor);

View File

@@ -7,9 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "boxes/change_phone_box.h"
#include <rpl/filter.h>
#include <rpl/mappers.h>
#include <rpl/take.h>
#include "lang/lang_keys.h"
#include "styles/style_boxes.h"
#include "ui/widgets/labels.h"

View File

@@ -137,7 +137,7 @@ EditCaptionBox::EditCaptionBox(
langFactory(lng_photo_caption),
caption);
_field->setMaxLength(MaxPhotoCaption);
_field->setCtrlEnterSubmit(Ui::CtrlEnterSubmit::Both);
_field->setSubmitSettings(Ui::InputField::SubmitSettings::Both);
_field->setInstantReplaces(Ui::InstantReplaces::Default());
}

View File

@@ -77,7 +77,7 @@ void RateCallBox::ratingChanged(int value) {
Ui::InputField::Mode::MultiLine,
langFactory(lng_call_rate_comment));
_comment->show();
_comment->setCtrlEnterSubmit(Ui::CtrlEnterSubmit::Both);
_comment->setSubmitSettings(Ui::InputField::SubmitSettings::Both);
_comment->setMaxLength(MaxPhotoCaption);
_comment->resize(width() - (st::callRatingPadding.left() + st::callRatingPadding.right()), _comment->height());

View File

@@ -88,7 +88,7 @@ void ReportBox::reasonChanged(Reason reason) {
Ui::InputField::Mode::MultiLine,
langFactory(lng_report_reason_description));
_reasonOtherText->show();
_reasonOtherText->setCtrlEnterSubmit(Ui::CtrlEnterSubmit::Both);
_reasonOtherText->setSubmitSettings(Ui::InputField::SubmitSettings::Both);
_reasonOtherText->setMaxLength(MaxPhotoCaption);
_reasonOtherText->resize(width() - (st::boxPadding.left() + st::boxOptionListPadding.left() + st::boxPadding.right()), _reasonOtherText->height());

View File

@@ -1556,7 +1556,7 @@ void SendFilesBox::setupCaption() {
Ui::InputField::Mode::MultiLine,
FieldPlaceholder(_list));
_caption->setMaxLength(MaxPhotoCaption);
_caption->setCtrlEnterSubmit(Ui::CtrlEnterSubmit::Both);
_caption->setSubmitSettings(Ui::InputField::SubmitSettings::Both);
connect(_caption, &Ui::InputField::resized, this, [this] {
captionResized();
});