sign: Improve StreamStatsWindow UX with colors
This commit is contained in:
parent
ff01ef9682
commit
416292e42b
@ -21,6 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|||||||
|
|
||||||
#include "protocol.pb.h"
|
#include "protocol.pb.h"
|
||||||
|
|
||||||
|
#include <QBrush>
|
||||||
|
|
||||||
// XXX: Keep the enum in sync with it's string
|
// XXX: Keep the enum in sync with it's string
|
||||||
enum {
|
enum {
|
||||||
kTxPkts,
|
kTxPkts,
|
||||||
@ -97,6 +99,14 @@ QVariant StreamStatsModel::data(const QModelIndex &index, int role) const
|
|||||||
if (role == Qt::TextAlignmentRole)
|
if (role == Qt::TextAlignmentRole)
|
||||||
return Qt::AlignRight;
|
return Qt::AlignRight;
|
||||||
|
|
||||||
|
int portColumn = index.column() - kMaxAggrStreamStats;
|
||||||
|
if (role == Qt::BackgroundRole) {
|
||||||
|
if (portColumn < 0) // Aggregate Column
|
||||||
|
return QBrush(QColor("#dbe5f1"));
|
||||||
|
else if ((portColumn/kMaxStreamStats) & 1) // Alternate Ports
|
||||||
|
return QBrush(QColor("#eeeeee"));
|
||||||
|
}
|
||||||
|
|
||||||
if (role != Qt::DisplayRole)
|
if (role != Qt::DisplayRole)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
@ -116,7 +126,6 @@ QVariant StreamStatsModel::data(const QModelIndex &index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
int portColumn = index.column() - kMaxAggrStreamStats;
|
|
||||||
PortGroupPort pgp = portList_.at(portColumn/kMaxStreamStats);
|
PortGroupPort pgp = portList_.at(portColumn/kMaxStreamStats);
|
||||||
int stat = portColumn % kMaxStreamStats;
|
int stat = portColumn % kMaxStreamStats;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user