mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
rename IconPickerCategory and make public
Signed-off-by: Tayou <git@tayou.org>
This commit is contained in:
parent
74308fcaa5
commit
0c4c8703a3
2 changed files with 12 additions and 12 deletions
|
|
@ -41,7 +41,7 @@ IconPickerDialog::IconPickerDialog(QWidget* parent) : QDialog(parent), ui(new Ui
|
|||
tr("Legacy"),
|
||||
tr("Modpacks"),
|
||||
};
|
||||
static const Context context_id[] = {
|
||||
static const IconPickerCategory context_id[] = {
|
||||
Any,
|
||||
Modern,
|
||||
Legacy,
|
||||
|
|
@ -101,7 +101,7 @@ IconPickerDialog::IconPickerDialog(QWidget* parent) : QDialog(parent), ui(new Ui
|
|||
connect(buttonFolder, &QPushButton::clicked, this, &IconPickerDialog::openFolder);
|
||||
connect(ui->searchLine, &QLineEdit::textChanged, this, &IconPickerDialog::filterIcons);
|
||||
connect(ui->contextCombo, &QComboBox::currentIndexChanged, this, [this](int index) {
|
||||
Context category = static_cast<Context>(ui->contextCombo->itemData(index).toInt());
|
||||
IconPickerCategory category = static_cast<IconPickerCategory>(ui->contextCombo->itemData(index).toInt());
|
||||
filterIconsByCategory(category);
|
||||
});
|
||||
// Prevent incorrect indices from e.g. filesystem changes
|
||||
|
|
@ -200,7 +200,7 @@ void IconPickerDialog::filterIcons(const QString& query)
|
|||
proxyModel->setFilterFixedString(query);
|
||||
}
|
||||
|
||||
void IconPickerDialog::filterIconsByCategory(Context category)
|
||||
void IconPickerDialog::filterIconsByCategory(IconPickerCategory category)
|
||||
{
|
||||
switch (category) {
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -32,6 +32,14 @@ class IconPickerDialog : public QDialog {
|
|||
int execWithSelection(QString selection);
|
||||
QString selectedIconKey;
|
||||
|
||||
enum IconPickerCategory {
|
||||
Any,
|
||||
Modern,
|
||||
Legacy,
|
||||
Modpacks,
|
||||
};
|
||||
Q_ENUM(IconPickerCategory)
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject*, QEvent*);
|
||||
|
||||
|
|
@ -41,14 +49,6 @@ class IconPickerDialog : public QDialog {
|
|||
QLineEdit* searchBar;
|
||||
QSortFilterProxyModel* proxyModel;
|
||||
|
||||
enum Context {
|
||||
Any,
|
||||
Modern,
|
||||
Legacy,
|
||||
Modpacks,
|
||||
};
|
||||
Q_ENUM(Context)
|
||||
|
||||
private slots:
|
||||
void selectionChanged(QItemSelection, QItemSelection);
|
||||
void activated(QModelIndex);
|
||||
|
|
@ -57,5 +57,5 @@ class IconPickerDialog : public QDialog {
|
|||
void removeSelectedIcon();
|
||||
void openFolder();
|
||||
void filterIcons(const QString& text);
|
||||
void filterIconsByCategory(Context);
|
||||
void filterIconsByCategory(IconPickerCategory);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue