mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Protocol: Increase width of timestamp column #4721
Since the font metrics aren't reliable on windows, we add some extra space there.
This commit is contained in:
parent
45dd1d0acf
commit
0f9c32452c
1 changed files with 9 additions and 2 deletions
|
@ -57,9 +57,15 @@ ProtocolWidget::ProtocolWidget(QWidget *parent) :
|
|||
header << tr("Action");
|
||||
header << tr("Size");
|
||||
|
||||
int timestampColumnExtra = 0;
|
||||
#ifdef Q_OS_WIN
|
||||
timestampColumnExtra = 20; // font metrics are broken on Windows, see #4721
|
||||
#endif
|
||||
|
||||
_ui->_treeWidget->setHeaderLabels( header );
|
||||
int timestampColumnWidth =
|
||||
_ui->_treeWidget->fontMetrics().width(timeString(QDateTime::currentDateTime()));
|
||||
_ui->_treeWidget->fontMetrics().width(timeString(QDateTime::currentDateTime()))
|
||||
+ timestampColumnExtra;
|
||||
_ui->_treeWidget->setColumnWidth(0, timestampColumnWidth);
|
||||
_ui->_treeWidget->setColumnWidth(1, 180);
|
||||
_ui->_treeWidget->setColumnCount(5);
|
||||
|
@ -84,7 +90,8 @@ ProtocolWidget::ProtocolWidget(QWidget *parent) :
|
|||
_issueItemView->setHeaderLabels( header );
|
||||
timestampColumnWidth =
|
||||
ActivityItemDelegate::rowHeight() // icon
|
||||
+ _issueItemView->fontMetrics().width(timeString(QDateTime::currentDateTime()));
|
||||
+ _issueItemView->fontMetrics().width(timeString(QDateTime::currentDateTime()))
|
||||
+ timestampColumnExtra;
|
||||
_issueItemView->setColumnWidth(0, timestampColumnWidth);
|
||||
_issueItemView->setColumnWidth(1, 180);
|
||||
_issueItemView->setColumnCount(4);
|
||||
|
|
Loading…
Reference in a new issue