aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2014-10-25 17:19:38 -0700
committerGerald Combs <gerald@wireshark.org>2014-10-26 00:30:57 +0000
commit155c939bb945c0ddc41f2a399c4d2b9303c11f51 (patch)
tree4c8ee0740ae9420c9bf4f6a890175069e8d28056
parent6e5784d88a3657b738db8a00a1a8a1c29ed16753 (diff)
Use better theme-derived colors. Switch back to AlternateBase for
protocol-level highlighting. Change-Id: I3de3442885b93093c3a4f5341080713a2039cd4c Reviewed-on: https://code.wireshark.org/review/4933 Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--ui/qt/byte_view_text.cpp14
-rw-r--r--ui/qt/byte_view_text.h1
-rw-r--r--ui/qt/proto_tree.cpp3
3 files changed, 6 insertions, 12 deletions
diff --git a/ui/qt/byte_view_text.cpp b/ui/qt/byte_view_text.cpp
index 314131c1e4..30d9538d17 100644
--- a/ui/qt/byte_view_text.cpp
+++ b/ui/qt/byte_view_text.cpp
@@ -129,14 +129,12 @@ void ByteViewText::paintEvent(QPaintEvent *)
painter.fillRect(viewport()->rect(), palette().base());
// Offset background
- offset_bg_.setColor(ColorUtils::alphaBlend(palette().text(), palette().base(), 0.05));
- offset_bg_.setStyle(Qt::SolidPattern);
- offset_normal_fg_.setColor(ColorUtils::alphaBlend(palette().text(), palette().base(), 0.35));
- offset_field_fg_.setColor(ColorUtils::alphaBlend(palette().text(), palette().base(), 0.6));
+ offset_normal_fg_.setColor(ColorUtils::alphaBlend(palette().windowText(), palette().window(), 0.35));
+ offset_field_fg_.setColor(ColorUtils::alphaBlend(palette().windowText(), palette().window(), 0.65));
if (show_offset_) {
QRect offset_rect = QRect(viewport()->rect());
offset_rect.setWidth(offsetPixels());
- painter.fillRect(offset_rect, offset_bg_);
+ painter.fillRect(offset_rect, palette().window());
}
if (!tvb_) {
@@ -350,22 +348,20 @@ qreal ByteViewText::flushOffsetFragment(QPainter &painter, qreal x, int y, highl
if (state == StateField) {
painter.fillRect(QRectF(x, y, width, line_spacing_), palette().highlight());
} else if (state == StateProtocol) {
- painter.fillRect(QRectF(x, y, width, line_spacing_), palette().button());
+ painter.fillRect(QRectF(x, y, width, line_spacing_), palette().alternateBase());
}
// Text
QBrush text_brush;
switch (state) {
case StateNormal:
+ case StateProtocol:
default:
text_brush = palette().text();
break;
case StateField:
text_brush = palette().highlightedText();
break;
- case StateProtocol:
- text_brush = palette().buttonText();
- break;
case StateOffsetNormal:
text_brush = offset_normal_fg_;
break;
diff --git a/ui/qt/byte_view_text.h b/ui/qt/byte_view_text.h
index e40c256ec3..25f5a94c0e 100644
--- a/ui/qt/byte_view_text.h
+++ b/ui/qt/byte_view_text.h
@@ -89,7 +89,6 @@ private:
// Fonts and colors
QFont mono_font_;
// QFont mono_bold_font_;
- QBrush offset_bg_;
QBrush offset_normal_fg_;
QBrush offset_field_fg_;
diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp
index 80e3df65b9..eefa999986 100644
--- a/ui/qt/proto_tree.cpp
+++ b/ui/qt/proto_tree.cpp
@@ -94,8 +94,7 @@ proto_tree_draw_node(proto_node *node, gpointer data)
QPalette pal = QApplication::palette();
if (fi && fi->hfinfo) {
if(fi->hfinfo->type == FT_PROTOCOL) {
- item->setData(0, Qt::BackgroundRole, pal.button());
- item->setData(0, Qt::ForegroundRole, pal.buttonText());
+ item->setData(0, Qt::BackgroundRole, pal.alternateBase());
}
if((fi->hfinfo->type == FT_FRAMENUM) ||