Improve the button's appearence

This commit is contained in:
Spiros
2024-06-16 05:00:16 +03:00
parent aea31d1a17
commit 563585f604
2 changed files with 5 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ void CustomButton::adjustWidthToFitText() {
} }
} }
int desiredWidth = maxWidth + 30; int desiredWidth = maxWidth + 28;
setMinimumWidth(desiredWidth); setMinimumWidth(desiredWidth);
setMaximumWidth(desiredWidth); setMaximumWidth(desiredWidth);
} }
@@ -32,9 +32,9 @@ void CustomButton::paintEvent(QPaintEvent *event) {
QPalette pal = palette(); QPalette pal = palette();
QColor textColor = pal.color(QPalette::ButtonText); QColor textColor = pal.color(QPalette::ButtonText);
QPen pen(lineColor, 5); QPen pen(lineColor, 6);
painter.setPen(pen); painter.setPen(pen);
painter.drawLine(10, 9, 10, 50); painter.drawLine(11, 10, 11, 50);
QRect rect(20, 0, width() - 25, height()); QRect rect(20, 0, width() - 25, height());
painter.setPen(textColor); painter.setPen(textColor);

View File

@@ -144,7 +144,7 @@ void MainWindow::scanDevices()
for (const QJsonValue &value : std::as_const(devices)) { for (const QJsonValue &value : std::as_const(devices)) {
QJsonObject device = value.toObject(); QJsonObject device = value.toObject();
QString deviceName = device["name"].toString(); QString deviceName = device["name"].toString();
commandList.append(QString(smartctlPath + " --all --json %1").arg(deviceName)); commandList.append(QString(smartctlPath + " --all --json=o %1").arg(deviceName));
} }
QString command = commandList.join(" ; "); QString command = commandList.join(" ; ");
@@ -272,7 +272,7 @@ void MainWindow::updateUI()
healthColor = naColor; healthColor = naColor;
} }
CustomButton *button = new CustomButton(health, deviceName, temperature, healthColor, this); CustomButton *button = new CustomButton(health, temperature, deviceName, healthColor, this);
button->setToolTip(tr("Disk") + " " + QString::number(i) + " : " + modelName + " : " + userCapacityString); button->setToolTip(tr("Disk") + " " + QString::number(i) + " : " + modelName + " : " + userCapacityString);
buttonGroup->addButton(button); buttonGroup->addButton(button);