SettingsDialog: Attempt at fixing tooltip icon on Windows

This commit is contained in:
tt2468 2021-06-06 00:33:53 -07:00
parent 92214ebbd2
commit 3852a387b5
2 changed files with 5 additions and 6 deletions

View File

@ -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 = "<html> <img src='%1' style=' vertical-align: bottom; ' /></html>";
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);

View File

@ -97,9 +97,6 @@
<property name="toolTip">
<string>OBSWebSocket.Settings.DebugEnableHoverText</string>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/toolTip/images/help.svg</pixmap>
</property>
</widget>
</item>
<item>