mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +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:
@@ -495,7 +495,7 @@ Notification::Notification(Manager *manager, History *history, PeerData *peer, P
|
||||
updateNotifyDisplay();
|
||||
|
||||
_hideTimer.setSingleShot(true);
|
||||
connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(onHideByTimer()));
|
||||
connect(&_hideTimer, &QTimer::timeout, [=] { startHiding(); });
|
||||
|
||||
_close->setClickedCallback([this] {
|
||||
unlinkHistoryInManager();
|
||||
@@ -576,15 +576,11 @@ bool Notification::checkLastInput(bool hasReplyingNotifications) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Notification::onReplyResize() {
|
||||
void Notification::replyResized() {
|
||||
changeHeight(st::notifyMinHeight + _replyArea->height() + st::notifyBorderWidth);
|
||||
}
|
||||
|
||||
void Notification::onReplySubmit(bool ctrlShiftEnter) {
|
||||
sendReply();
|
||||
}
|
||||
|
||||
void Notification::onReplyCancel() {
|
||||
void Notification::replyCancel() {
|
||||
unlinkHistoryInManager();
|
||||
}
|
||||
|
||||
@@ -777,9 +773,9 @@ void Notification::showReplyField() {
|
||||
|
||||
// Catch mouse press event to activate the window.
|
||||
QCoreApplication::instance()->installEventFilter(this);
|
||||
connect(_replyArea, SIGNAL(resized()), this, SLOT(onReplyResize()));
|
||||
connect(_replyArea, SIGNAL(submitted(bool)), this, SLOT(onReplySubmit(bool)));
|
||||
connect(_replyArea, SIGNAL(cancelled()), this, SLOT(onReplyCancel()));
|
||||
connect(_replyArea, &Ui::InputField::resized, [=] { replyResized(); });
|
||||
connect(_replyArea, &Ui::InputField::submitted, [=] { sendReply(); });
|
||||
connect(_replyArea, &Ui::InputField::cancelled, [=] { replyCancel(); });
|
||||
|
||||
_replySend.create(this, st::notifySendReply);
|
||||
_replySend->moveToRight(st::notifyBorderWidth, st::notifyMinHeight);
|
||||
@@ -788,7 +784,7 @@ void Notification::showReplyField() {
|
||||
|
||||
toggleActionButtons(false);
|
||||
|
||||
onReplyResize();
|
||||
replyResized();
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -868,10 +864,6 @@ void Notification::stopHiding() {
|
||||
Widget::hideStop();
|
||||
}
|
||||
|
||||
void Notification::onHideByTimer() {
|
||||
startHiding();
|
||||
}
|
||||
|
||||
HideAllButton::HideAllButton(Manager *manager, QPoint startPosition, int shift, Direction shiftDirection) : Widget(manager, startPosition, shift, shiftDirection) {
|
||||
setCursor(style::cur_pointer);
|
||||
|
||||
|
Reference in New Issue
Block a user