Colorize the preview tooltip in the DisassemblyWidget according to th… (#2799)

This commit is contained in:
Petros S 2021-10-11 08:31:37 +03:00 committed by GitHub
parent c205acd773
commit 29cce01e1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,8 @@
#include <algorithm>
#include <cmath>
static const int kMaxTooltipWidth = 400;
class DisassemblyTextBlockUserData : public QTextBlockUserData
{
public:
@ -765,6 +767,14 @@ void DisassemblyWidget::setupColors()
mDisasTextEdit->setStyleSheet(QString("QPlainTextEdit { background-color: %1; color: %2; }")
.arg(ConfigColor("gui.background").name())
.arg(ConfigColor("btext").name()));
// Read and set a stylesheet for the QToolTip too
setStyleSheet(QString{"QToolTip { border-width: 1px; max-width: %1px;"
"opacity: 230; background-color: %2;"
"color: %3; border-color: %3;}"}
.arg(kMaxTooltipWidth)
.arg(Config()->getColor("gui.tooltip.background").name())
.arg(Config()->getColor("gui.tooltip.foreground").name()));
}
DisassemblyScrollArea::DisassemblyScrollArea(QWidget *parent) : QAbstractScrollArea(parent) {}