Merge pull request #1360 from FearlessTobi/port-3979

Port citra-emu/citra#3979 game_list: move SearchField to game_list_p.h and fix untranslated text
This commit is contained in:
bunnei
2018-09-27 17:09:11 -04:00
committed by GitHub
3 changed files with 51 additions and 35 deletions

View File

@ -16,6 +16,7 @@
#include <QObject>
#include <QStandardItem>
#include <QString>
#include <QWidget>
#include "common/common_types.h"
#include "common/logging/log.h"
@ -176,3 +177,42 @@ public:
return data(SizeRole).toULongLong() < other.data(SizeRole).toULongLong();
}
};
class GameList;
class QHBoxLayout;
class QTreeView;
class QLabel;
class QLineEdit;
class QToolButton;
class GameListSearchField : public QWidget {
Q_OBJECT
public:
explicit GameListSearchField(GameList* parent = nullptr);
void setFilterResult(int visible, int total);
void clear();
void setFocus();
private:
class KeyReleaseEater : public QObject {
public:
explicit KeyReleaseEater(GameList* gamelist);
private:
GameList* gamelist = nullptr;
QString edit_filter_text_old;
protected:
// EventFilter in order to process systemkeys while editing the searchfield
bool eventFilter(QObject* obj, QEvent* event) override;
};
QHBoxLayout* layout_filter = nullptr;
QTreeView* tree_view = nullptr;
QLabel* label_filter = nullptr;
QLineEdit* edit_filter = nullptr;
QLabel* label_filter_result = nullptr;
QToolButton* button_filter_close = nullptr;
};