mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Properly reset on ESC key on LayoutBox/CategorizedCombo
Fix for bug #12497.
This commit is contained in:
parent
8e8825baa7
commit
7bdf372ecc
@ -370,6 +370,7 @@ void CategorizedCombo::Private::countCategories()
|
||||
|
||||
void CategorizedCombo::showPopup()
|
||||
{
|
||||
lastCurrentIndex_ = currentIndex();
|
||||
bool enabled = view()->updatesEnabled();
|
||||
view()->setUpdatesEnabled(false);
|
||||
|
||||
@ -400,6 +401,7 @@ bool CategorizedCombo::eventFilter(QObject * o, QEvent * e)
|
||||
case Qt::Key_Escape:
|
||||
if (!modified && !d->filter_.isEmpty()) {
|
||||
d->resetFilter();
|
||||
setCurrentIndex(lastCurrentIndex_);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
@ -74,6 +74,8 @@ private:
|
||||
struct Private;
|
||||
///
|
||||
Private * const d;
|
||||
///
|
||||
int lastCurrentIndex_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -401,6 +401,7 @@ void LayoutBox::Private::countCategories()
|
||||
|
||||
void LayoutBox::showPopup()
|
||||
{
|
||||
lastCurrentIndex_ = currentIndex();
|
||||
d->owner_.message(_("Enter characters to filter the layout list."));
|
||||
|
||||
bool enabled = view()->updatesEnabled();
|
||||
@ -425,6 +426,7 @@ bool LayoutBox::eventFilter(QObject * o, QEvent * e)
|
||||
case Qt::Key_Escape:
|
||||
if (!modified && !d->filter_.isEmpty()) {
|
||||
d->resetFilter();
|
||||
setCurrentIndex(lastCurrentIndex_);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
@ -60,6 +60,7 @@ private:
|
||||
friend class LayoutItemDelegate;
|
||||
class Private;
|
||||
Private * const d;
|
||||
int lastCurrentIndex_;
|
||||
};
|
||||
|
||||
} // namespace frontend
|
||||
|
Loading…
Reference in New Issue
Block a user