mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Pass modifiers inside InputField submitted signal.
Also use non-MOC connections for all InputFields. Also use Ctrl/Cmd + Enter to submit fast share box. Fixes #4769.
This commit is contained in:
@@ -1558,17 +1558,18 @@ void SendFilesBox::applyAlbumOrder() {
|
||||
void SendFilesBox::setupCaption() {
|
||||
_caption->setMaxLength(MaxPhotoCaption);
|
||||
_caption->setSubmitSettings(Ui::InputField::SubmitSettings::Both);
|
||||
connect(_caption, &Ui::InputField::resized, this, [this] {
|
||||
connect(_caption, &Ui::InputField::resized, [=] {
|
||||
captionResized();
|
||||
});
|
||||
connect(_caption, &Ui::InputField::submitted, this, [this](
|
||||
bool ctrlShiftEnter) {
|
||||
connect(_caption, &Ui::InputField::submitted, [=](
|
||||
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, this, [this] {
|
||||
closeBox();
|
||||
});
|
||||
_caption->setMimeDataHook([this](
|
||||
connect(_caption, &Ui::InputField::cancelled, [=] { closeBox(); });
|
||||
_caption->setMimeDataHook([=](
|
||||
not_null<const QMimeData*> data,
|
||||
Ui::InputField::MimeAction action) {
|
||||
if (action == Ui::InputField::MimeAction::Check) {
|
||||
|
Reference in New Issue
Block a user