79 ThemeModel * themes = DataManager::instance().themeModel(); |
79 ThemeModel * themes = DataManager::instance().themeModel(); |
80 for (int i = 0; i < themes->rowCount(); i++) |
80 for (int i = 0; i < themes->rowCount(); i++) |
81 { |
81 { |
82 QModelIndex index = themes->index(i, 0); |
82 QModelIndex index = themes->index(i, 0); |
83 QToolButton * btn = new QToolButton(); |
83 QToolButton * btn = new QToolButton(); |
|
84 bool dlc = themes->data(index, Qt::UserRole + 2).toBool(); |
84 btn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
85 btn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
85 btn->setIcon(qVariantValue<QIcon>(themes->data(index, Qt::UserRole))); |
86 btn->setIcon(qVariantValue<QIcon>(themes->data(index, Qt::UserRole))); |
86 btn->setText(themes->data(index, Qt::DisplayRole).toString()); |
87 btn->setText((dlc ? "*" : "") + themes->data(index, Qt::DisplayRole).toString()); |
87 btn->setIconSize(QSize(60, 60)); |
88 btn->setIconSize(QSize(60, 60)); |
88 btn->setProperty("themeID", QVariant(i)); |
89 btn->setProperty("themeID", QVariant(i)); |
89 btn->setStyleSheet("padding: 2px;"); |
90 btn->setStyleSheet("padding: 2px;"); |
90 connect(btn, SIGNAL(clicked()), this, SLOT(themeClicked())); |
91 connect(btn, SIGNAL(clicked()), this, SLOT(themeClicked())); |
91 themesGrid->addWidget(btn); |
92 themesGrid->addWidget(btn); |