Qt: Row colors and resize
Set the row colors in the traffic dialogs to alternating for better readibility and add a context menu option to resize the columns back to content Fixes #16189
This commit is contained in:
parent
6913bff6cd
commit
5a53e72c63
|
@ -728,6 +728,13 @@ ConversationTreeWidget::ConversationTreeWidget(QWidget *parent, register_ct_t* t
|
|||
connect(fa, SIGNAL(triggered()), this, SLOT(filterActionTriggered()));
|
||||
}
|
||||
|
||||
ctx_menu_.addSeparator();
|
||||
QAction * act = ctx_menu_.addAction(tr("Resize all columns to content"));
|
||||
connect(act, &QAction::triggered, [this]() {
|
||||
for (int col = 0; col < this->columnCount(); col++)
|
||||
this->resizeColumnToContents(col);
|
||||
});
|
||||
|
||||
updateItems();
|
||||
}
|
||||
|
||||
|
|
|
@ -708,6 +708,13 @@ EndpointTreeWidget::EndpointTreeWidget(QWidget *parent, register_ct_t *table) :
|
|||
connect(fa, SIGNAL(triggered()), this, SLOT(filterActionTriggered()));
|
||||
}
|
||||
|
||||
ctx_menu_.addSeparator();
|
||||
QAction * act = ctx_menu_.addAction(tr("Resize all columns to content"));
|
||||
connect(act, &QAction::triggered, [this]() {
|
||||
for (int col = 0; col < this->columnCount(); col++)
|
||||
this->resizeColumnToContents(col);
|
||||
});
|
||||
|
||||
updateItems();
|
||||
|
||||
}
|
||||
|
|
|
@ -338,6 +338,7 @@ TrafficTableTreeWidget::TrafficTableTreeWidget(QWidget *parent, register_ct_t *t
|
|||
resolve_names_(false)
|
||||
{
|
||||
setRootIsDecorated(false);
|
||||
setAlternatingRowColors(true);
|
||||
sortByColumn(0, Qt::AscendingOrder);
|
||||
|
||||
connect(mainApp, SIGNAL(addressResolutionChanged()), this, SLOT(updateItemsForSettingChange()));
|
||||
|
@ -364,6 +365,7 @@ QList<QVariant> TrafficTableTreeWidget::rowData(int row) const
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return row_data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue