Commit b102e2b9 authored by Laurent Montel's avatar Laurent Montel 😁

Readd focus to editor.

Bug found by David
parent eaee7fda
......@@ -107,7 +107,7 @@ void PlainTextEditorWidget::init(PlainTextEditor *customEditor)
d->mFindBar = new KPIMTextEdit::PlainTextEditFindBar(d->mEditor, this);
d->mFindBar->setHideWhenClose(false);
connect(d->mFindBar, &KPIMTextEdit::PlainTextEditFindBar::displayMessageIndicator, d->mEditor, &PlainTextEditor::slotDisplayMessageIndicator);
connect(d->mFindBar, &KPIMTextEdit::PlainTextEditFindBar::hideFindBar, d->mSliderContainer, &KPIMTextEdit::SlideContainer::slideOut);
connect(d->mFindBar, &KPIMTextEdit::PlainTextEditFindBar::hideFindBar, this, &PlainTextEditorWidget::slotHideFindBar);
d->mSliderContainer->setContent(d->mFindBar);
lay->addWidget(d->mSliderContainer);
......@@ -119,6 +119,12 @@ void PlainTextEditorWidget::init(PlainTextEditor *customEditor)
setLayout(lay);
}
void PlainTextEditorWidget::slotHideFindBar()
{
d->mSliderContainer->slideOut();
d->mEditor->setFocus();
}
bool PlainTextEditorWidget::isReadOnly() const
{
return d->mEditor->isReadOnly();
......
......@@ -48,6 +48,7 @@ private Q_SLOTS:
void slotFind();
void slotReplace();
void slotHideFindBar();
private:
void init(PlainTextEditor *customEditor = Q_NULLPTR);
PlainTextEditorWidgetPrivate *const d;
......
......@@ -129,7 +129,7 @@ void RichTextEditorWidget::init(RichTextEditor *customEditor)
d->mFindBar->setHideWhenClose(false);
connect(d->mFindBar, &KPIMTextEdit::RichTextEditFindBar::displayMessageIndicator, d->mEditor, &RichTextEditor::slotDisplayMessageIndicator);
connect(d->mFindBar, &KPIMTextEdit::RichTextEditFindBar::hideFindBar, d->mSliderContainer, &KPIMTextEdit::SlideContainer::slideOut);
connect(d->mFindBar, &KPIMTextEdit::RichTextEditFindBar::hideFindBar, this, &RichTextEditorWidget::slotHideFindBar);
d->mSliderContainer->setContent(d->mFindBar);
lay->addWidget(d->mSliderContainer);
......@@ -139,6 +139,12 @@ void RichTextEditorWidget::init(RichTextEditor *customEditor)
setLayout(lay);
}
void RichTextEditorWidget::slotHideFindBar()
{
d->mSliderContainer->slideOut();
d->mEditor->setFocus();
}
bool RichTextEditorWidget::isReadOnly() const
{
return d->mEditor->isReadOnly();
......
......@@ -60,6 +60,7 @@ private Q_SLOTS:
void slotFind();
void slotReplace();
void slotHideFindBar();
private:
void init(RichTextEditor *customEditor = Q_NULLPTR);
RichTextEditorWidgetPrivate *const d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment