Commit efe95ca4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Don't allow to hide tab as by default it can't be empty

parent 610d75ba
......@@ -18,5 +18,4 @@ void EmoticonUnicodeTabTest::shouldHaveDefaultValues()
{
KPIMTextEdit::EmoticonUnicodeTab w;
QVERIFY(w.count() > 0);
QVERIFY(w.tabBarAutoHide());
}
......@@ -16,9 +16,8 @@
using namespace KPIMTextEdit;
EmoticonUnicodeTab::EmoticonUnicodeTab(QWidget *parent)
: QTabWidget(parent)
, mEmoticonUnicodeSearchProxyModel(new EmoticonUnicodeProxyModel(this))
{
setTabBarAutoHide(true);
loadEmoticons();
QFont f;
f.setPointSize(22);
......@@ -44,7 +43,7 @@ void EmoticonUnicodeTab::searchUnicode(const QString &str)
void EmoticonUnicodeTab::createSearchTab()
{
auto allEmojisView = new EmoticonListView(this);
mEmoticonUnicodeSearchProxyModel = new EmoticonUnicodeProxyModel(this);
mEmoticonUnicodeSearchProxyModel->setSourceModel(EmoticonUnicodeModelManager::self()->emoticonUnicodeModel());
allEmojisView->setModel(mEmoticonUnicodeSearchProxyModel);
mSearchTabIndex = addTab(allEmojisView, QIcon::fromTheme(QStringLiteral("edit-find")), {});
......@@ -52,6 +51,11 @@ void EmoticonUnicodeTab::createSearchTab()
connect(allEmojisView, &KPIMTextEdit::EmoticonListView::emojiItemSelected, this, &EmoticonUnicodeTab::itemSelected);
}
void EmoticonUnicodeTab::createRecentTab()
{
// TODO
}
void EmoticonUnicodeTab::createEmoticonTab(const QString &str, const QVector<EmoticonUnicodeUtils::EmoticonStruct> &emoticons)
{
if (!emoticons.isEmpty()) {
......
......@@ -34,8 +34,10 @@ Q_SIGNALS:
private:
void createEmoticonTab(const QString &str, const QVector<EmoticonUnicodeUtils::EmoticonStruct> &emoticons);
void createSearchTab();
EmoticonUnicodeProxyModel *mEmoticonUnicodeSearchProxyModel = nullptr;
void createRecentTab();
EmoticonUnicodeProxyModel *const mEmoticonUnicodeSearchProxyModel;
int mSearchTabIndex = -1;
int mRecentTabIndex = -1;
};
}
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