Improve highlight colors (#1003)

This commit is contained in:
Itay Cohen 2018-12-16 09:07:25 +02:00 committed by GitHub
parent ab42756729
commit ea5dc6e594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 8 deletions

View File

@ -139,7 +139,7 @@ void Configuration::loadDefaultTheme()
setColor("gui.dataoffset", QColor(0, 0, 0)); setColor("gui.dataoffset", QColor(0, 0, 0));
setColor("gui.border", QColor(0, 0, 0)); setColor("gui.border", QColor(0, 0, 0));
setColor("highlight", QColor(210, 210, 255, 150)); 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 // RIP line selection in debug
setColor("highlightPC", QColor(214, 255, 210)); setColor("highlightPC", QColor(214, 255, 210));
// Windows background // Windows background
@ -219,7 +219,7 @@ void Configuration::loadDarkTheme()
setColor("gui.disass_selected", QColor(31, 34, 40)); setColor("gui.disass_selected", QColor(31, 34, 40));
// Disassembly line selected // Disassembly line selected
setColor("highlight", QColor(21, 29, 29, 150)); setColor("highlight", QColor(21, 29, 29, 150));
setColor("highlightWord", QColor(100, 100, 100)); setColor("highlightWord", QColor(52, 58, 71, 255));
} }

View File

@ -510,8 +510,7 @@ void DisassemblerGraphView::drawBlock(QPainter &p, GraphView::GraphBlock &block)
highlightWidth = block.width - widthBefore - (10 + 4 * charWidth); highlightWidth = block.width - widthBefore - (10 + 4 * charWidth);
} }
QColor selectionColor = disassemblySelectionColor.blue() > 160 ? QColor(179, 119, 214, 50) : QColor selectionColor = ConfigColor("highlightWord");
QColor(52, 58, 71, 255);
p.fillRect(QRect(block.x + charWidth * 3 + widthBefore, y, highlightWidth, p.fillRect(QRect(block.x + charWidth * 3 + widthBefore, y, highlightWidth,
charHeight), selectionColor); charHeight), selectionColor);

View File

@ -325,9 +325,6 @@ void DisassemblyWidget::highlightCurrentLine()
QColor highlightColor = ConfigColor("highlight"); QColor highlightColor = ConfigColor("highlight");
QColor highlightPCColor = ConfigColor("highlightPC"); QColor highlightPCColor = ConfigColor("highlightPC");
QColor highlightWordColor = ConfigColor("highlightWord"); QColor highlightWordColor = ConfigColor("highlightWord");
highlightWordColor.setAlpha(128);
QColor highlightWordCurrentLineColor = ConfigColor("gui.background");
highlightWordCurrentLineColor.setAlpha(128);
// Highlight the current word // Highlight the current word
QTextCursor cursor = mDisasTextEdit->textCursor(); QTextCursor cursor = mDisasTextEdit->textCursor();
@ -374,7 +371,7 @@ void DisassemblyWidget::highlightCurrentLine()
if (!highlightSelection.cursor.isNull()) { if (!highlightSelection.cursor.isNull()) {
if (highlightSelection.cursor.position() >= listStartPos if (highlightSelection.cursor.position() >= listStartPos
&& highlightSelection.cursor.position() <= lineEndPos) { && highlightSelection.cursor.position() <= lineEndPos) {
highlightSelection.format.setBackground(highlightWordCurrentLineColor); highlightSelection.format.setBackground(highlightWordColor);
} else { } else {
highlightSelection.format.setBackground(highlightWordColor); highlightSelection.format.setBackground(highlightWordColor);
} }