diff options
Diffstat (limited to 'launcher/ui/pages/global')
-rw-r--r-- | launcher/ui/pages/global/JavaPage.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/launcher/ui/pages/global/JavaPage.cpp b/launcher/ui/pages/global/JavaPage.cpp index 00c06cff..81dd4cc1 100644 --- a/launcher/ui/pages/global/JavaPage.cpp +++ b/launcher/ui/pages/global/JavaPage.cpp @@ -196,14 +196,23 @@ void JavaPage::updateThresholds() auto sysMiB = Sys::getSystemRam() / Sys::mebibyte; unsigned int maxMem = ui->maxMemSpinBox->value(); + QString iconName; + if (maxMem >= sysMiB) { - ui->labelMaxMemIcon->setText(u8"✘"); + iconName = "status-bad"; ui->labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation exceeds your system memory capacity.")); } else if (maxMem > (sysMiB * 0.9)) { - ui->labelMaxMemIcon->setText(u8"⚠"); + iconName = "status-yellow"; ui->labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation approaches your system memory capacity.")); } else { - ui->labelMaxMemIcon->setText(u8"✔"); + iconName = "status-good"; ui->labelMaxMemIcon->setToolTip(""); } + + { + auto height = ui->labelMaxMemIcon->fontInfo().pixelSize(); + QIcon icon = APPLICATION->getThemedIcon(iconName); + QPixmap pix = icon.pixmap(height, height); + ui->labelMaxMemIcon->setPixmap(pix); + } } |