mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 21:40:00 -08:00
[CardSearch] Add card completion popups to chats and search fields (#7089)
* Add card completion popups to chats and search fields Completes @mention and [[card]] in chat, and card names in the deck editor, EDHREC, Archidekt, card art rules, and user card settings searches. Pops up a styled list with mana pips and a card image preview, flipping the list order when the popup opens above the text field. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
a0e76607b5
commit
83fd65b34b
25 changed files with 1526 additions and 290 deletions
32
cockatrice/src/interface/widgets/utility/completer_utils.h
Normal file
32
cockatrice/src/interface/widgets/utility/completer_utils.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* @file completer_utils.h
|
||||
* @ingroup UtilityWidgets
|
||||
*/
|
||||
//! \todo Document this file.
|
||||
|
||||
#ifndef COMPLETER_UTILS_H
|
||||
#define COMPLETER_UTILS_H
|
||||
|
||||
class CardCompleterProxyModel;
|
||||
class CardDatabaseDisplayModel;
|
||||
class CardSearchModel;
|
||||
class QCompleter;
|
||||
class QLineEdit;
|
||||
class QObject;
|
||||
class QStringListModel;
|
||||
|
||||
struct CardCompleterSetup
|
||||
{
|
||||
CardSearchModel *searchModel;
|
||||
CardCompleterProxyModel *proxyModel;
|
||||
QCompleter *completer;
|
||||
};
|
||||
|
||||
CardCompleterSetup
|
||||
createCardCompleter(CardDatabaseDisplayModel *displayModel, QObject *parent, int maxVisibleItems = 10);
|
||||
|
||||
void connectCardCompleterSearch(QLineEdit *edit, const CardCompleterSetup &setup);
|
||||
|
||||
QCompleter *createMentionCompleter(QStringListModel *model, QObject *parent);
|
||||
|
||||
#endif // CARD_COMPLETER_UTILS_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue