aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/instance/InstanceSettingsPage.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-11-11 15:22:16 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2022-11-11 15:22:16 +0100
commitcabd887866929103f635a2640589ce95570f8573 (patch)
treeb866c47b755db9c508256ee3b0abee017a14d882 /launcher/ui/pages/instance/InstanceSettingsPage.cpp
parent863a168cb5cb7332ae9782c3967d563f7f98316d (diff)
downloadPrismLauncher-cabd887866929103f635a2640589ce95570f8573.tar.gz
PrismLauncher-cabd887866929103f635a2640589ce95570f8573.tar.bz2
PrismLauncher-cabd887866929103f635a2640589ce95570f8573.zip
feat: use icons to show memory allocation state
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/ui/pages/instance/InstanceSettingsPage.cpp')
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/launcher/ui/pages/instance/InstanceSettingsPage.cpp b/launcher/ui/pages/instance/InstanceSettingsPage.cpp
index 50039e87..af2ba7c8 100644
--- a/launcher/ui/pages/instance/InstanceSettingsPage.cpp
+++ b/launcher/ui/pages/instance/InstanceSettingsPage.cpp
@@ -458,14 +458,23 @@ void InstanceSettingsPage::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);
+ }
}