From 3719142fc85cca3debaad009411422ba9636271f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 11 Feb 2025 12:45:32 +0100 Subject: [PATCH] ScxmlEditor: Improve usability for dark themes Reverting the theming change broke readability. Improve this by making some colors of the graphics scene use themed colors. Change-Id: Ib16d867844aaafb07308eb7fbc128cdb7e6bb79c Reviewed-by: Alessandro Portale --- .../scxmleditor/plugin_interface/transitionitem.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp b/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp index a118fefda32..a6b974206d0 100644 --- a/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp @@ -15,6 +15,8 @@ #include "tagtextitem.h" #include "transitionitem.h" +#include + #include #include #include @@ -57,11 +59,11 @@ TransitionItem::TransitionItem(BaseItem *parent) { setFlag(ItemIsSelectable, true); - m_highlightPen = QPen(QColor(0xff, 0x00, 0x60)); + m_highlightPen = QPen(Utils::creatorColor(Utils::Theme::TextColorError)); m_highlightPen.setWidth(8); m_highlightPen.setJoinStyle(Qt::MiterJoin); - m_pen = QPen(QColor(0x12, 0x12, 0x12)); + m_pen = QPen(Utils::creatorColor(Utils::Theme::TextColorDisabled)); m_pen.setWidth(2); m_arrow << QPointF(0, 0) @@ -991,12 +993,13 @@ void TransitionItem::updateEditorInfo(bool allChilds) { BaseItem::updateEditorInfo(allChilds); + const QColor textDisabled = Utils::creatorColor(Utils::Theme::TextColorDisabled); const QColor fontColor = editorInfo(Constants::C_SCXML_EDITORINFO_FONTCOLOR); - m_eventTagItem->setDefaultTextColor(fontColor.isValid() ? fontColor : Qt::black); - m_condTagItem->setDefaultTextColor(fontColor.isValid() ? fontColor : Qt::black); + m_eventTagItem->setDefaultTextColor(fontColor.isValid() ? fontColor : textDisabled); + m_condTagItem->setDefaultTextColor(fontColor.isValid() ? fontColor : textDisabled); const QColor stateColor = editorInfo(Constants::C_SCXML_EDITORINFO_STATECOLOR); - m_pen.setColor(stateColor.isValid() ? stateColor : qRgb(0x12, 0x12, 0x12)); + m_pen.setColor(stateColor.isValid() ? stateColor : textDisabled); } void TransitionItem::updateTarget(bool fixValue)