game_list: move SearchField to game_list_p.h and fix untranslated text
I have tested and made sure the text is translatable, but this would require a translation update to take effect.
This commit is contained in:
parent
87872aa369
commit
11da018ea6
3 changed files with 54 additions and 39 deletions
|
@ -12,6 +12,7 @@
|
|||
|
||||
class GameListWorker;
|
||||
class GameListDir;
|
||||
class GameListSearchField;
|
||||
class GMainWindow;
|
||||
class QFileSystemWatcher;
|
||||
class QHBoxLayout;
|
||||
|
@ -41,37 +42,6 @@ public:
|
|||
COLUMN_COUNT, // Number of columns
|
||||
};
|
||||
|
||||
class SearchField : public QWidget {
|
||||
public:
|
||||
explicit SearchField(GameList* parent = nullptr);
|
||||
|
||||
void setFilterResult(int visible, int total);
|
||||
void clear();
|
||||
void setFocus();
|
||||
|
||||
int visible;
|
||||
int total;
|
||||
|
||||
private:
|
||||
class KeyReleaseEater : public QObject {
|
||||
public:
|
||||
explicit KeyReleaseEater(GameList* gamelist);
|
||||
|
||||
private:
|
||||
GameList* gamelist = nullptr;
|
||||
QString edit_filter_text_old;
|
||||
|
||||
protected:
|
||||
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;
|
||||
};
|
||||
|
||||
explicit GameList(GMainWindow* parent = nullptr);
|
||||
~GameList() override;
|
||||
|
||||
|
@ -121,7 +91,7 @@ private:
|
|||
void AddCustomDirPopup(QMenu& context_menu, QModelIndex selected);
|
||||
void AddPermDirPopup(QMenu& context_menu, QModelIndex selected);
|
||||
|
||||
SearchField* search_field;
|
||||
GameListSearchField* search_field;
|
||||
GMainWindow* main_window = nullptr;
|
||||
QVBoxLayout* layout = nullptr;
|
||||
QTreeView* tree_view = nullptr;
|
||||
|
@ -129,6 +99,8 @@ private:
|
|||
GameListWorker* current_worker = nullptr;
|
||||
QFileSystemWatcher* watcher = nullptr;
|
||||
std::unordered_map<std::string, std::pair<QString, QString>> compatibility_list;
|
||||
|
||||
friend class GameListSearchField;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(GameListOpenTarget);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue