mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Core / DolphinQt: Add ini only option to force low-contrast tooltips
This commit is contained in:
parent
9c204428fe
commit
cc837a59d6
@ -156,6 +156,8 @@ const Info<bool> MAIN_NETWORK_SSL_DUMP_PEER_CERT{{System::Main, "Network", "SSLD
|
||||
|
||||
// Main.Interface
|
||||
|
||||
const Info<bool> MAIN_USE_HIGH_CONTRAST_TOOLTIPS{
|
||||
{System::Main, "Interface", "UseHighContrastTooltips"}, true};
|
||||
const Info<bool> MAIN_USE_PANIC_HANDLERS{{System::Main, "Interface", "UsePanicHandlers"}, true};
|
||||
const Info<bool> MAIN_OSD_MESSAGES{{System::Main, "Interface", "OnScreenDisplayMessages"}, true};
|
||||
const Info<bool> MAIN_SKIP_NKIT_WARNING{{System::Main, "Interface", "SkipNKitWarning"}, false};
|
||||
|
@ -130,6 +130,7 @@ extern const Info<bool> MAIN_NETWORK_SSL_DUMP_PEER_CERT;
|
||||
|
||||
// Main.Interface
|
||||
|
||||
extern const Info<bool> MAIN_USE_HIGH_CONTRAST_TOOLTIPS;
|
||||
extern const Info<bool> MAIN_USE_PANIC_HANDLERS;
|
||||
extern const Info<bool> MAIN_OSD_MESSAGES;
|
||||
extern const Info<bool> MAIN_SKIP_NKIT_WARNING;
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include <QToolTip>
|
||||
#endif
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
std::unique_ptr<BalloonTip> s_the_balloon_tip = nullptr;
|
||||
@ -81,21 +83,42 @@ BalloonTip::BalloonTip(PrivateTag, const QIcon& icon, QString title, QString mes
|
||||
QColor window_color;
|
||||
QColor text_color;
|
||||
QColor dolphin_emphasis;
|
||||
const bool use_high_contrast = Config::Get(Config::MAIN_USE_HIGH_CONTRAST_TOOLTIPS);
|
||||
if (brightness > 128)
|
||||
{
|
||||
// Our theme color is light, so make it darker
|
||||
window_color = QColor(72, 72, 72);
|
||||
text_color = Qt::white;
|
||||
dolphin_emphasis = Qt::yellow;
|
||||
m_border_color = palette().color(QPalette::Window).darker(160);
|
||||
if (use_high_contrast)
|
||||
{
|
||||
// Our theme color is light, so make it darker
|
||||
window_color = QColor(72, 72, 72);
|
||||
text_color = Qt::white;
|
||||
dolphin_emphasis = Qt::yellow;
|
||||
m_border_color = palette().color(QPalette::Window).darker(160);
|
||||
}
|
||||
else
|
||||
{
|
||||
window_color = pal.color(QPalette::Window);
|
||||
text_color = pal.color(QPalette::Text);
|
||||
dolphin_emphasis = QColor(QStringLiteral("#0090ff"));
|
||||
m_border_color = pal.color(QPalette::Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Our theme color is dark, so make it lighter
|
||||
window_color = Qt::white;
|
||||
text_color = Qt::black;
|
||||
dolphin_emphasis = QColor(QStringLiteral("#0090ff"));
|
||||
m_border_color = palette().color(QPalette::Window).darker(160);
|
||||
if (use_high_contrast)
|
||||
{
|
||||
// Our theme color is dark, so make it lighter
|
||||
window_color = Qt::white;
|
||||
text_color = Qt::black;
|
||||
dolphin_emphasis = QColor(QStringLiteral("#0090ff"));
|
||||
m_border_color = palette().color(QPalette::Window).darker(160);
|
||||
}
|
||||
else
|
||||
{
|
||||
window_color = pal.color(QPalette::Window);
|
||||
text_color = pal.color(QPalette::Text);
|
||||
dolphin_emphasis = Qt::yellow;
|
||||
m_border_color = pal.color(QPalette::Text);
|
||||
}
|
||||
}
|
||||
|
||||
const auto style_sheet = QStringLiteral("background-color: #%1; color: #%2;")
|
||||
|
Loading…
Reference in New Issue
Block a user