From ea5dc6e594470b8abfc31004b73faef5a527a717 Mon Sep 17 00:00:00 2001 From: Itay Cohen Date: Sun, 16 Dec 2018 09:07:25 +0200 Subject: [PATCH] Improve highlight colors (#1003) --- src/common/Configuration.cpp | 4 ++-- src/widgets/DisassemblerGraphView.cpp | 3 +-- src/widgets/DisassemblyWidget.cpp | 5 +---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/common/Configuration.cpp b/src/common/Configuration.cpp index 687b2866..7501d9d8 100644 --- a/src/common/Configuration.cpp +++ b/src/common/Configuration.cpp @@ -139,7 +139,7 @@ void Configuration::loadDefaultTheme() setColor("gui.dataoffset", QColor(0, 0, 0)); setColor("gui.border", QColor(0, 0, 0)); setColor("highlight", QColor(210, 210, 255, 150)); - setColor("highlightWord", QColor(210, 210, 255)); + setColor("highlightWord", QColor(179, 119, 214, 60)); // RIP line selection in debug setColor("highlightPC", QColor(214, 255, 210)); // Windows background @@ -219,7 +219,7 @@ void Configuration::loadDarkTheme() setColor("gui.disass_selected", QColor(31, 34, 40)); // Disassembly line selected setColor("highlight", QColor(21, 29, 29, 150)); - setColor("highlightWord", QColor(100, 100, 100)); + setColor("highlightWord", QColor(52, 58, 71, 255)); } diff --git a/src/widgets/DisassemblerGraphView.cpp b/src/widgets/DisassemblerGraphView.cpp index 625c1b48..ef3c0877 100644 --- a/src/widgets/DisassemblerGraphView.cpp +++ b/src/widgets/DisassemblerGraphView.cpp @@ -510,8 +510,7 @@ void DisassemblerGraphView::drawBlock(QPainter &p, GraphView::GraphBlock &block) highlightWidth = block.width - widthBefore - (10 + 4 * charWidth); } - QColor selectionColor = disassemblySelectionColor.blue() > 160 ? QColor(179, 119, 214, 50) : - QColor(52, 58, 71, 255); + QColor selectionColor = ConfigColor("highlightWord"); p.fillRect(QRect(block.x + charWidth * 3 + widthBefore, y, highlightWidth, charHeight), selectionColor); diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index de31aee1..d9658e32 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -325,9 +325,6 @@ void DisassemblyWidget::highlightCurrentLine() QColor highlightColor = ConfigColor("highlight"); QColor highlightPCColor = ConfigColor("highlightPC"); QColor highlightWordColor = ConfigColor("highlightWord"); - highlightWordColor.setAlpha(128); - QColor highlightWordCurrentLineColor = ConfigColor("gui.background"); - highlightWordCurrentLineColor.setAlpha(128); // Highlight the current word QTextCursor cursor = mDisasTextEdit->textCursor(); @@ -374,7 +371,7 @@ void DisassemblyWidget::highlightCurrentLine() if (!highlightSelection.cursor.isNull()) { if (highlightSelection.cursor.position() >= listStartPos && highlightSelection.cursor.position() <= lineEndPos) { - highlightSelection.format.setBackground(highlightWordCurrentLineColor); + highlightSelection.format.setBackground(highlightWordColor); } else { highlightSelection.format.setBackground(highlightWordColor); }