mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Elide text from the right for all columns' header
Minimizing columns no longer truncates text from the left, now elides text from the right for better readability. Done by setting header's textElideMode to Qt::TextElideRight. Fix issue #14419. PR #15366.
This commit is contained in:
@@ -90,6 +90,8 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent)
|
||||
setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
header()->setStretchLastSection(false);
|
||||
header()->setTextElideMode(Qt::ElideRight);
|
||||
|
||||
// List Model
|
||||
m_listModel = new QStandardItemModel(0, PeerListColumns::COL_COUNT, this);
|
||||
m_listModel->setHeaderData(PeerListColumns::COUNTRY, Qt::Horizontal, tr("Country/Region")); // Country flag column
|
||||
|
||||
@@ -71,6 +71,7 @@ TrackerListWidget::TrackerListWidget(PropertiesWidget *properties)
|
||||
setItemsExpandable(false);
|
||||
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
header()->setStretchLastSection(false); // Must be set after loadSettings() in order to work
|
||||
header()->setTextElideMode(Qt::ElideRight);
|
||||
// Ensure that at least one column is visible at all times
|
||||
if (visibleColumnsCount() == 0)
|
||||
setColumnHidden(COL_URL, false);
|
||||
|
||||
@@ -71,6 +71,7 @@ SearchJobWidget::SearchJobWidget(SearchHandler *searchHandler, QWidget *parent)
|
||||
loadSettings();
|
||||
|
||||
header()->setStretchLastSection(false);
|
||||
header()->setTextElideMode(Qt::ElideRight);
|
||||
|
||||
// Set Search results list model
|
||||
m_searchListModel = new QStandardItemModel(0, SearchSortModel::NB_SEARCH_COLUMNS, this);
|
||||
|
||||
@@ -72,6 +72,7 @@ TorrentContentTreeView::TorrentContentTreeView(QWidget *parent)
|
||||
unused.setVerticalHeader(header());
|
||||
header()->setParent(this);
|
||||
header()->setStretchLastSection(false);
|
||||
header()->setTextElideMode(Qt::ElideRight);
|
||||
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
|
||||
}
|
||||
|
||||
|
||||
@@ -158,6 +158,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *mainWindow)
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
#endif
|
||||
header()->setStretchLastSection(false);
|
||||
header()->setTextElideMode(Qt::ElideRight);
|
||||
|
||||
// Default hidden columns
|
||||
if (!columnLoaded)
|
||||
|
||||
Reference in New Issue
Block a user