Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KPimTextEdit
Commits
072ebc27
Commit
072ebc27
authored
Sep 16, 2021
by
Laurent Montel
😁
Browse files
Show or not search tab
parent
b890a9c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/emoticon/emoticonunicodeproxymodel.cpp
View file @
072ebc27
...
...
@@ -21,10 +21,6 @@ EmoticonUnicodeProxyModel::~EmoticonUnicodeProxyModel()
bool
EmoticonUnicodeProxyModel
::
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
source_parent
)
const
{
if
(
mCategories
.
isEmpty
())
{
const
QModelIndex
sourceIndex
=
sourceModel
()
->
index
(
source_row
,
0
,
source_parent
);
const
QString
identifier
=
sourceIndex
.
data
(
EmoticonUnicodeModel
::
UnicodeEmoji
).
toString
();
qDebug
()
<<
" identifier "
<<
identifier
;
return
QSortFilterProxyModel
::
filterAcceptsRow
(
source_row
,
source_parent
);
}
const
QModelIndex
sourceIndex
=
sourceModel
()
->
index
(
source_row
,
0
,
source_parent
);
...
...
src/emoticon/emoticonunicodetab.cpp
View file @
072ebc27
...
...
@@ -31,9 +31,12 @@ EmoticonUnicodeTab::~EmoticonUnicodeTab()
void
EmoticonUnicodeTab
::
searchUnicode
(
const
QString
&
str
)
{
qDebug
()
<<
" str"
<<
str
;
bool
searchVisible
=
!
str
.
trimmed
().
isEmpty
();
setTabVisible
(
mSearchTabIndex
,
searchVisible
);
if
(
searchVisible
)
{
setCurrentIndex
(
mSearchTabIndex
);
}
mEmoticonUnicodeProxyModel
->
setFilterFixedString
(
str
);
// TODO show search page + update proxyfilter + switch to search page
}
void
EmoticonUnicodeTab
::
createSearchTab
()
...
...
@@ -43,8 +46,8 @@ void EmoticonUnicodeTab::createSearchTab()
mEmoticonUnicodeProxyModel
=
new
EmoticonUnicodeProxyModel
(
this
);
mEmoticonUnicodeProxyModel
->
setSourceModel
(
emoticonModel
);
emoticonModel
->
setEmoticonList
(
EmoticonUnicodeUtils
::
unicodeFaceEmoji
()
+
EmoticonUnicodeUtils
::
unicodeAnimalsEmoji
());
allEmojisView
->
setModel
(
e
moticonModel
);
const
int
i
ndex
=
addTab
(
allEmojisView
,
i18n
(
"full"
));
allEmojisView
->
setModel
(
mE
moticon
UnicodeProxy
Model
);
mSearchTabI
ndex
=
addTab
(
allEmojisView
,
i18n
(
"full"
));
// if (!str.isEmpty()) {
// setTabToolTip(index, str);
// }
...
...
@@ -86,6 +89,7 @@ void EmoticonUnicodeTab::loadEmoticons()
createPlainTextEmoticonTab
(
i18n
(
"Dishware"
),
EmoticonUnicodeUtils
::
unicodeDishwareEmoji
());
createPlainTextEmoticonTab
(
i18n
(
"Hotel"
),
EmoticonUnicodeUtils
::
unicodeHotelEmoji
());
createPlainTextEmoticonTab
(
i18n
(
"Award-Medal"
),
EmoticonUnicodeUtils
::
unicodeAwardMedalEmoji
());
setTabVisible
(
mSearchTabIndex
,
false
);
}
void
EmoticonUnicodeTab
::
createPlainTextEmoticonTab
(
const
QString
&
str
,
const
QVector
<
EmoticonUnicodeUtils
::
EmoticonStruct
>
&
emoticons
)
...
...
src/emoticon/emoticonunicodetab.h
View file @
072ebc27
...
...
@@ -35,6 +35,7 @@ private:
void
createPlainTextEmoticonTab
(
const
QString
&
str
,
const
QVector
<
EmoticonUnicodeUtils
::
EmoticonStruct
>
&
emoticons
);
void
createSearchTab
();
EmoticonUnicodeProxyModel
*
mEmoticonUnicodeProxyModel
=
nullptr
;
int
mSearchTabIndex
=
-
1
;
};
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment