From 3852a387b5d5167cc5e392a9350f37458e5c74d0 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 6 Jun 2021 00:33:53 -0700 Subject: [PATCH] SettingsDialog: Attempt at fixing tooltip icon on Windows --- src/forms/SettingsDialog.cpp | 8 +++++--- src/forms/SettingsDialog.ui | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/forms/SettingsDialog.cpp b/src/forms/SettingsDialog.cpp index 42b20ffe..d3c22a3e 100644 --- a/src/forms/SettingsDialog.cpp +++ b/src/forms/SettingsDialog.cpp @@ -11,10 +11,12 @@ #include "../plugin-macros.generated.h" -QString GetToolTipIcon() +QString GetToolTipIconHtml() { bool lightTheme = QApplication::palette().text().color().redF() < 0.5; - return lightTheme ? ":toolTip/images/help.svg" : ":toolTip/images/help_light.svg"; + QString iconFile = lightTheme ? ":toolTip/images/help.svg" : ":toolTip/images/help_light.svg"; + QString iconTemplate = " "; + return iconTemplate.arg(iconFile); } SettingsDialog::SettingsDialog(QWidget* parent) : @@ -27,7 +29,7 @@ SettingsDialog::SettingsDialog(QWidget* parent) : ui->websocketSessionTable->horizontalHeader()->resizeSection(3, 100); // Resize Session Table column widths ui->websocketSessionTable->horizontalHeader()->resizeSection(4, 100); - ui->enableDebugLoggingToolTipLabel->setPixmap(QPixmap(GetToolTipIcon())); // Set the appropriate tooltip icon for the theme + ui->enableDebugLoggingToolTipLabel->setText(GetToolTipIconHtml()); // Set the appropriate tooltip icon for the theme connect(sessionTableTimer, &QTimer::timeout, this, &SettingsDialog::FillSessionTable); diff --git a/src/forms/SettingsDialog.ui b/src/forms/SettingsDialog.ui index 9aade501..c790e17f 100644 --- a/src/forms/SettingsDialog.ui +++ b/src/forms/SettingsDialog.ui @@ -97,9 +97,6 @@ OBSWebSocket.Settings.DebugEnableHoverText - - :/toolTip/images/help.svg -