Mercurial > minori
diff src/gui/pages/anime_list.cc @ 108:2004b41d4a59
*: huge commit
1. WORKING LOCALIZATION + translation for Spanish and British English
2. idk like 2 changes for the dark theme :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 05 Nov 2023 23:31:49 -0500 |
parents | c8c72278f6fd |
children | 80f49f623d30 |
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cc Sun Nov 05 17:44:49 2023 -0500 +++ b/src/gui/pages/anime_list.cc Sun Nov 05 23:31:49 2023 -0500 @@ -29,42 +29,6 @@ #include <QThreadPool> #include <set> -AnimeListPageDelegate::AnimeListPageDelegate(QObject* parent) : QStyledItemDelegate(parent) { -} - -QWidget* AnimeListPageDelegate::createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const { - // no edit 4 u - return nullptr; -} - -void AnimeListPageDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, - const QModelIndex& index) const { - switch (index.column()) { -#if 0 /* I'm just commenting this out for now. Seems like a huge headache to do with Qt. */ - case AnimeListPageModel::AL_PROGRESS: { - const int progress = static_cast<int>(index.data(Qt::UserRole).toReal()); - const int episodes = - static_cast<int>(index.siblingAtColumn(AnimeListPageModel::AL_EPISODES).data(Qt::UserRole).toReal()); - - int text_width = 59; - QRectF text_rect(option.rect.x() + text_width, option.rect.y(), text_width, option.decorationSize.height()); - painter->save(); - painter->drawText(text_rect, tr("/"), QTextOption(Qt::AlignCenter | Qt::AlignVCenter)); - drawText(const QRectF &rectangle, const QString &text, const QTextOption &option = - QTextOption()) painter->drawText(QRectF(text_rect.x(), text_rect.y(), text_width / 2 - 2, - text_rect.height()), QString::number(progress), QTextOption(Qt::AlignRight | Qt::AlignVCenter)); - painter->drawText( - QRectF(text_rect.x() + text_width / 2 + 2, text_rect.y(), text_width / 2 - 2, text_rect.height()), - QString::number(episodes), QTextOption(Qt::AlignLeft | Qt::AlignVCenter)); - painter->restore(); - QStyledItemDelegate::paint(painter, option, index); - break; - } -#endif - default: QStyledItemDelegate::paint(painter, option, index); break; - } -} - AnimeListPageSortFilter::AnimeListPageSortFilter(QObject* parent) : QSortFilterProxyModel(parent) { } @@ -423,7 +387,6 @@ /* Tree view... */ QWidget* tree_widget = new QWidget(this); tree_view = new QTreeView(tree_widget); - tree_view->setItemDelegate(new AnimeListPageDelegate(tree_view)); tree_view->setUniformRowHeights(true); tree_view->setAllColumnsShowFocus(false); tree_view->setAlternatingRowColors(true);