From 29cce01e1a4b796cd8d79b4eb64dfd0f42bc62df Mon Sep 17 00:00:00 2001 From: Petros S Date: Mon, 11 Oct 2021 08:31:37 +0300 Subject: [PATCH] =?UTF-8?q?Colorize=20the=20preview=20tooltip=20in=20the?= =?UTF-8?q?=20DisassemblyWidget=20according=20to=20th=E2=80=A6=20(#2799)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/DisassemblyWidget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index 95c47375..3e933ccd 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -22,6 +22,8 @@ #include #include +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) {}