mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'pr2982'
This commit is contained in:
commit
9db1032e1d
@ -41,7 +41,10 @@ CroppingLabel::CroppingLabel(QWidget* parent)
|
||||
void keyPressEvent(QKeyEvent* event) override
|
||||
{
|
||||
if (event->key() == Qt::Key_Escape)
|
||||
{
|
||||
undo();
|
||||
clearFocus();
|
||||
}
|
||||
|
||||
QLineEdit::keyPressEvent(event);
|
||||
}
|
||||
@ -53,8 +56,7 @@ CroppingLabel::CroppingLabel(QWidget* parent)
|
||||
| Qt::ImhNoPredictiveText
|
||||
| Qt::ImhPreferLatin);
|
||||
|
||||
connect(textEdit, &QLineEdit::returnPressed, this, &CroppingLabel::editingFinished);
|
||||
connect(textEdit, &QLineEdit::editingFinished, this, &CroppingLabel::hideTextEdit);
|
||||
connect(textEdit, &QLineEdit::editingFinished, this, &CroppingLabel::editingFinished);
|
||||
}
|
||||
|
||||
void CroppingLabel::editBegin()
|
||||
@ -162,6 +164,7 @@ void CroppingLabel::minimizeMaximumWidth()
|
||||
|
||||
void CroppingLabel::editingFinished()
|
||||
{
|
||||
hideTextEdit();
|
||||
QString newText = textEdit->text().trimmed().remove(QRegExp("[\\t\\n\\v\\f\\r\\x0000]"));
|
||||
|
||||
if (origText != newText)
|
||||
|
Loading…
x
Reference in New Issue
Block a user