From 563585f60412c96ec434fe229a4f3c1626ac7e42 Mon Sep 17 00:00:00 2001 From: Spiros Date: Sun, 16 Jun 2024 05:00:16 +0300 Subject: [PATCH] Improve the button's appearence --- src/custombutton.cpp | 6 +++--- src/mainwindow.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/custombutton.cpp b/src/custombutton.cpp index 88f275f..7d7e739 100644 --- a/src/custombutton.cpp +++ b/src/custombutton.cpp @@ -21,7 +21,7 @@ void CustomButton::adjustWidthToFitText() { } } - int desiredWidth = maxWidth + 30; + int desiredWidth = maxWidth + 28; setMinimumWidth(desiredWidth); setMaximumWidth(desiredWidth); } @@ -32,9 +32,9 @@ void CustomButton::paintEvent(QPaintEvent *event) { QPalette pal = palette(); QColor textColor = pal.color(QPalette::ButtonText); - QPen pen(lineColor, 5); + QPen pen(lineColor, 6); painter.setPen(pen); - painter.drawLine(10, 9, 10, 50); + painter.drawLine(11, 10, 11, 50); QRect rect(20, 0, width() - 25, height()); painter.setPen(textColor); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d5e20be..20fc5a2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -144,7 +144,7 @@ void MainWindow::scanDevices() for (const QJsonValue &value : std::as_const(devices)) { QJsonObject device = value.toObject(); 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(" ; "); @@ -272,7 +272,7 @@ void MainWindow::updateUI() 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); buttonGroup->addButton(button);