mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Merge pull request #13668 from jagannatharjun/consistent
Improve consistency between transfer list and torrent content view
This commit is contained in:
commit
424e2c76fa
@ -351,6 +351,12 @@ QVariant TorrentContentModel::data(const QModelIndex &index, int role) const
|
|||||||
return Qt::PartiallyChecked;
|
return Qt::PartiallyChecked;
|
||||||
return Qt::Checked;
|
return Qt::Checked;
|
||||||
}
|
}
|
||||||
|
case Qt::TextAlignmentRole:
|
||||||
|
if ((index.column() == TorrentContentModelItem::COL_SIZE)
|
||||||
|
|| (index.column() == TorrentContentModelItem::COL_REMAINING))
|
||||||
|
return QVariant {Qt::AlignRight | Qt::AlignVCenter};
|
||||||
|
return {};
|
||||||
|
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
return item->displayData(index.column());
|
return item->displayData(index.column());
|
||||||
|
|
||||||
@ -375,10 +381,22 @@ Qt::ItemFlags TorrentContentModel::flags(const QModelIndex &index) const
|
|||||||
|
|
||||||
QVariant TorrentContentModel::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant TorrentContentModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if ((orientation == Qt::Horizontal) && (role == Qt::DisplayRole))
|
if (orientation != Qt::Horizontal)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
switch (role) {
|
||||||
|
case Qt::DisplayRole:
|
||||||
return m_rootItem->displayData(section);
|
return m_rootItem->displayData(section);
|
||||||
|
|
||||||
return {};
|
case Qt::TextAlignmentRole:
|
||||||
|
if ((section == TorrentContentModelItem::COL_SIZE)
|
||||||
|
|| (section == TorrentContentModelItem::COL_REMAINING))
|
||||||
|
return QVariant {Qt::AlignRight | Qt::AlignVCenter};
|
||||||
|
return {};
|
||||||
|
|
||||||
|
default:
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex TorrentContentModel::index(int row, int column, const QModelIndex &parent) const
|
QModelIndex TorrentContentModel::index(int row, int column, const QModelIndex &parent) const
|
||||||
|
@ -166,7 +166,7 @@ QVariant TransferListModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
case TR_QUEUE_POSITION: return QChar('#');
|
case TR_QUEUE_POSITION: return QChar('#');
|
||||||
case TR_NAME: return tr("Name", "i.e: torrent name");
|
case TR_NAME: return tr("Name", "i.e: torrent name");
|
||||||
case TR_SIZE: return tr("Size", "i.e: torrent size");
|
case TR_SIZE: return tr("Size", "i.e: torrent size");
|
||||||
case TR_PROGRESS: return tr("Done", "% Done");
|
case TR_PROGRESS: return tr("Progress", "% Done");
|
||||||
case TR_STATUS: return tr("Status", "Torrent status (e.g. downloading, seeding, paused)");
|
case TR_STATUS: return tr("Status", "Torrent status (e.g. downloading, seeding, paused)");
|
||||||
case TR_SEEDS: return tr("Seeds", "i.e. full sources (often untranslated)");
|
case TR_SEEDS: return tr("Seeds", "i.e. full sources (often untranslated)");
|
||||||
case TR_PEERS: return tr("Peers", "i.e. partial sources (often untranslated)");
|
case TR_PEERS: return tr("Peers", "i.e. partial sources (often untranslated)");
|
||||||
|
Loading…
Reference in New Issue
Block a user