Commit 381d3268 authored by Laurent Montel's avatar Laurent Montel 😁

Port to SlideContainer

parent ad13096f
......@@ -19,6 +19,7 @@
#include "editor/sievetextedit.h"
#include "pimcommon/texteditor/plaintexteditor/plaintexteditfindbar.h"
#include "pimcommon/widgets/slidecontainer.h"
#include <KLocalizedString>
#include <KLineEdit>
......@@ -61,8 +62,12 @@ SieveTemplateEditDialog::SieveTemplateEditDialog(QWidget *parent, bool defaultTe
mTextEdit->setReadOnly(defaultTemplate);
vbox->addWidget(mTextEdit);
mSliderContainer = new PimCommon::SlideContainer(this);
mFindBar = new PimCommon::PlainTextEditFindBar( mTextEdit, this );
vbox->addWidget(mFindBar);
mFindBar->setHideWhenClose(false);
connect(mFindBar, SIGNAL(hideFindBar()), mSliderContainer, SLOT(slideOut()));
mSliderContainer->setContent(mFindBar);
vbox->addWidget(mSliderContainer);
QShortcut *shortcut = new QShortcut( this );
shortcut->setKey( Qt::Key_F+Qt::CTRL );
......@@ -87,6 +92,7 @@ SieveTemplateEditDialog::~SieveTemplateEditDialog()
void SieveTemplateEditDialog::slotFind()
{
mSliderContainer->slideIn();
if ( mTextEdit->textCursor().hasSelection() )
mFindBar->setText( mTextEdit->textCursor().selectedText() );
mTextEdit->moveCursor(QTextCursor::Start);
......
......@@ -24,6 +24,7 @@ class KLineEdit;
namespace PimCommon {
class PlainTextEditFindBar;
class SlideContainer;
}
......@@ -52,6 +53,7 @@ private:
SieveTextEdit *mTextEdit;
PimCommon::PlainTextEditFindBar *mFindBar;
KLineEdit *mTemplateNameEdit;
PimCommon::SlideContainer *mSliderContainer;
};
}
......
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