Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
748bf0cd
Commit
748bf0cd
authored
4 years ago
by
Jussi Kuokkanen
Committed by
Nicolas Werner
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rename CompletionModel to CompletionProxyModel
parent
cabeb146
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CompletionProxyModel.h
+20
-0
20 additions, 0 deletions
src/CompletionProxyModel.h
src/TextInputWidget.cpp
+2
-2
2 additions, 2 deletions
src/TextInputWidget.cpp
src/TextInputWidget.h
+2
-2
2 additions, 2 deletions
src/TextInputWidget.h
with
24 additions
and
4 deletions
src/CompletionProxyModel.h
0 → 100644
+
20
−
0
View file @
748bf0cd
#pragma once
// Class for showing a limited amount of completions at a time
#include
<QSortFilterProxyModel>
class
CompletionProxyModel
:
public
QSortFilterProxyModel
{
public:
CompletionProxyModel
(
QAbstractItemModel
*
model
,
QObject
*
parent
=
nullptr
)
:
QSortFilterProxyModel
(
parent
)
{
setSourceModel
(
model
);
}
int
rowCount
(
const
QModelIndex
&
parent
)
const
override
{
auto
row_count
=
QSortFilterProxyModel
::
rowCount
(
parent
);
return
(
row_count
<
7
)
?
row_count
:
7
;
}
};
This diff is collapsed.
Click to expand it.
src/TextInputWidget.cpp
+
2
−
2
View file @
748bf0cd
...
...
@@ -30,7 +30,7 @@
#include
"Cache.h"
#include
"ChatPage.h"
#include
"CompletionModel.h"
#include
"Completion
Proxy
Model.h"
#include
"Logging.h"
#include
"TextInputWidget.h"
#include
"Utils.h"
...
...
@@ -70,7 +70,7 @@ FilteredTextEdit::FilteredTextEdit(QWidget *parent)
completer_
->
setWidget
(
this
);
auto
model
=
new
emoji
::
EmojiSearchModel
(
this
);
model
->
sort
(
0
,
Qt
::
AscendingOrder
);
completer_
->
setModel
((
emoji_completion_model_
=
new
CompletionModel
(
model
,
this
)));
completer_
->
setModel
((
emoji_completion_model_
=
new
Completion
Proxy
Model
(
model
,
this
)));
completer_
->
setModelSorting
(
QCompleter
::
UnsortedModel
);
completer_
->
popup
()
->
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
completer_
->
popup
()
->
setVerticalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
...
...
This diff is collapsed.
Click to expand it.
src/TextInputWidget.h
+
2
−
2
View file @
748bf0cd
...
...
@@ -31,7 +31,7 @@
struct
SearchResult
;
class
CompletionModel
;
class
Completion
Proxy
Model
;
class
FlatButton
;
class
LoadingIndicator
;
class
QCompleter
;
...
...
@@ -72,7 +72,7 @@ protected:
private
:
bool
emoji_popup_open_
=
false
;
CompletionModel
*
emoji_completion_model_
;
Completion
Proxy
Model
*
emoji_completion_model_
;
std
::
deque
<
QString
>
true_history_
,
working_history_
;
int
trigger_pos_
;
// Where emoji completer was triggered
size_t
history_index_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment