Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Plasma Desktop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
38
Merge Requests
38
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Plasma Desktop
Commits
7435c313
Commit
7435c313
authored
Feb 20, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Plasma/5.18'
parents
fc69be87
91c446e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
applets/kimpanel/backend/ibus/emojier/emojier.cpp
applets/kimpanel/backend/ibus/emojier/emojier.cpp
+14
-3
applets/kimpanel/backend/ibus/emojier/ui/CategoryPage.qml
applets/kimpanel/backend/ibus/emojier/ui/CategoryPage.qml
+2
-2
No files found.
applets/kimpanel/backend/ibus/emojier/emojier.cpp
View file @
7435c313
...
...
@@ -55,6 +55,7 @@ struct Emoji {
QString
content
;
QString
description
;
QString
category
;
QStringList
annotations
;
};
class
TextImageProvider
:
public
QQuickImageProvider
...
...
@@ -98,7 +99,7 @@ class AbstractEmojiModel : public QAbstractListModel
{
Q_OBJECT
public:
enum
EmojiRole
{
CategoryRole
=
Qt
::
UserRole
+
1
};
enum
EmojiRole
{
CategoryRole
=
Qt
::
UserRole
+
1
,
AnnotationsRole
};
int
rowCount
(
const
QModelIndex
&
parent
=
{})
const
override
{
return
parent
.
isValid
()
?
0
:
m_emoji
.
count
();
}
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
{
...
...
@@ -113,6 +114,8 @@ public:
return
emoji
.
description
;
case
CategoryRole
:
return
emoji
.
category
;
case
AnnotationsRole
:
return
emoji
.
annotations
;
}
return
{};
}
...
...
@@ -169,9 +172,15 @@ public:
continue
;
}
QStringList
annotations
;
const
auto
annotations_glib
=
ibus_emoji_data_get_annotations
(
data
);
for
(
GSList
*
l
=
annotations_glib
;
l
;
l
=
l
->
next
)
{
annotations
<<
QString
::
fromUtf8
((
const
gchar
*
)
l
->
data
);
}
const
QString
category
=
QString
::
fromUtf8
(
ibus_emoji_data_get_category
(
data
));
categories
.
insert
(
category
);
m_emoji
+=
{
emoji
,
description
,
category
};
m_emoji
+=
{
emoji
,
description
,
category
,
annotations
};
processedEmoji
<<
emoji
;
}
g_slist_free
(
list
);
...
...
@@ -280,7 +289,9 @@ public:
}
bool
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
source_parent
)
const
override
{
return
sourceModel
()
->
index
(
source_row
,
0
,
source_parent
).
data
(
Qt
::
ToolTipRole
).
toString
().
contains
(
m_search
,
Qt
::
CaseInsensitive
);
const
auto
idx
=
sourceModel
()
->
index
(
source_row
,
0
,
source_parent
);
return
idx
.
data
(
Qt
::
ToolTipRole
).
toString
().
contains
(
m_search
,
Qt
::
CaseInsensitive
)
||
idx
.
data
(
AbstractEmojiModel
::
AnnotationsRole
).
toStringList
().
contains
(
m_search
,
Qt
::
CaseInsensitive
);
}
private:
...
...
applets/kimpanel/backend/ibus/emojier/ui/CategoryPage.qml
View file @
7435c313
...
...
@@ -89,8 +89,8 @@ Kirigami.ScrollablePage
delegate
:
MouseArea
{
QQC2.Label
{
font.pointSize
:
30
fontSizeMode
:
Text
.
Fit
font.pointSize
:
25
fontSizeMode
:
model
.
display
.
length
>
5
?
Text
.
Fit
:
Text
.
FixedSize
minimumPointSize
:
10
text
:
model
.
display
horizontalAlignment
:
Text
.
AlignHCenter
...
...
Write
Preview
Markdown
is supported
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