Improved decode highlighting

Add  "Settings->Colors->Decode Highlighting"  context menu  buttons to
unset b/g  and f/g colours.  Add colour value  as #rrggbb or  unset in
text  to list  items.  Improved colour  assignment  to decodes  giving
better and more intuitive behaviour.
This commit is contained in:
Bill Somerville
2018-11-29 01:03:44 +00:00
parent 4b4f65eb9f
commit e5b17e270c
6 changed files with 75 additions and 79 deletions
+6 -2
View File
@@ -4,7 +4,8 @@
#include <QVariant>
#include <QList>
#include <QBrush>
#include <QFont>
#include <QColor>
#include <QFont>
#include <QMap>
#include <QVector>
#include <QDataStream>
@@ -160,7 +161,10 @@ QVariant DecodeHighlightingModel::data (const QModelIndex& index, int role) cons
result = item.enabled_ ? Qt::Checked : Qt::Unchecked;
break;
case Qt::DisplayRole:
result = highlight_name (item.type_);
return QString {"%1 [f/g:%2, b/g:%3]"}
.arg (highlight_name (item.type_))
.arg (item.foreground_.style () != Qt::NoBrush ? QString {"#%1"}.arg (item.foreground_.color ().rgb () & 0xffffff, 6, 16, QChar {'0'}) : QString {"unset"})
.arg (item.background_.style () != Qt::NoBrush ? QString {"#%1"}.arg (item.background_.color ().rgb () & 0xffffff, 6, 16, QChar {'0'}) : QString {"unset"});
break;
case Qt::ForegroundRole:
if (Qt::NoBrush != item.foreground_.style ())