[3/4] kernel-shark: Set text color to black in KsTraceGraph's axes labels
diff mbox series

Message ID 20191010212429.469155-4-mike.rudenko@gmail.com
State Accepted
Headers show
Series
  • Fix KernelShark appearance on dark color schemes
Related show

Commit Message

Mikhail Rudenko Oct. 10, 2019, 9:24 p.m. UTC
At present, background color of axes labels of the plot is forced to
white with a stylesheet, but the text color stays unchanged. As a
result, text is barely visible when using dark color schemes. This
patch forces the text color to black for these labels, making them
readable on all color schemes.

Signed-off-by: Mikhail Rudenko <mike.rudenko@gmail.com>
---
 kernel-shark/src/KsTraceGraph.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
2.23.0

Patch
diff mbox series

diff --git a/kernel-shark/src/KsTraceGraph.cpp b/kernel-shark/src/KsTraceGraph.cpp
index 73e7577..90f83f3 100644
--- a/kernel-shark/src/KsTraceGraph.cpp
+++ b/kernel-shark/src/KsTraceGraph.cpp
@@ -96,6 +96,8 @@  KsTraceGraph::KsTraceGraph(QWidget *parent)
 	_legendAxisX.layout()->addWidget(&_labelXMin);
 	_legendAxisX.layout()->addWidget(&_labelXMid);
 	_legendAxisX.layout()->addWidget(&_labelXMax);
+	_legendAxisX.setStyleSheet("QLabel { background-color : white; color: black}");
+
 	_drawWindow.setMinimumSize(100, 100);
 	_drawWindow.setStyleSheet("QWidget {background-color : white;}");

@@ -580,7 +582,7 @@  void KsTraceGraph::_updateGraphLegends()
 			width = STRING_WIDTH(graphName);

 		name->setAlignment(Qt::AlignBottom);
-		name->setStyleSheet("QLabel {background-color : white;}");
+		name->setStyleSheet("QLabel {background-color : white; color : black}");
 		name->setFixedHeight(KS_GRAPH_HEIGHT);
 		layout->addWidget(name);
 	};