mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-14 05:42:13 +08:00
settings: button press states (#21771)
* settings button press states * tune color * states for panel labels and close btn old-commit-hash: 4ed49562406cc0621c8590c3dd9806fc949abb08
This commit is contained in:
@@ -169,7 +169,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
|
||||
power_layout->setSpacing(30);
|
||||
|
||||
QPushButton *reboot_btn = new QPushButton("Reboot");
|
||||
reboot_btn->setStyleSheet("height: 120px;border-radius: 15px; background-color: #393939;");
|
||||
reboot_btn->setObjectName("reboot_btn");
|
||||
power_layout->addWidget(reboot_btn);
|
||||
QObject::connect(reboot_btn, &QPushButton::clicked, [=]() {
|
||||
if (ConfirmationDialog::confirm("Are you sure you want to reboot?", this)) {
|
||||
@@ -178,7 +178,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
|
||||
});
|
||||
|
||||
QPushButton *poweroff_btn = new QPushButton("Power Off");
|
||||
poweroff_btn->setStyleSheet("height: 120px;border-radius: 15px; background-color: #E22C2C;");
|
||||
poweroff_btn->setObjectName("poweroff_btn");
|
||||
power_layout->addWidget(poweroff_btn);
|
||||
QObject::connect(poweroff_btn, &QPushButton::clicked, [=]() {
|
||||
if (ConfirmationDialog::confirm("Are you sure you want to power off?", this)) {
|
||||
@@ -186,6 +186,16 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
|
||||
}
|
||||
});
|
||||
|
||||
setStyleSheet(R"(
|
||||
QPushButton {
|
||||
height: 120px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
#reboot_btn { background-color: #393939; }
|
||||
#reboot_btn:pressed { background-color: #4a4a4a; }
|
||||
#poweroff_btn { background-color: #E22C2C; }
|
||||
#poweroff_btn:pressed { background-color: #FF2424; }
|
||||
)");
|
||||
main_layout->addLayout(power_layout);
|
||||
}
|
||||
|
||||
@@ -298,13 +308,18 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
|
||||
// close button
|
||||
QPushButton *close_btn = new QPushButton("×");
|
||||
close_btn->setStyleSheet(R"(
|
||||
font-size: 140px;
|
||||
padding-bottom: 20px;
|
||||
font-weight: bold;
|
||||
border 1px grey solid;
|
||||
border-radius: 100px;
|
||||
background-color: #292929;
|
||||
font-weight: 400;
|
||||
QPushButton {
|
||||
font-size: 140px;
|
||||
padding-bottom: 20px;
|
||||
font-weight: bold;
|
||||
border 1px grey solid;
|
||||
border-radius: 100px;
|
||||
background-color: #292929;
|
||||
font-weight: 400;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: #3B3B3B;
|
||||
}
|
||||
)");
|
||||
close_btn->setFixedSize(200, 200);
|
||||
sidebar_layout->addSpacing(45);
|
||||
@@ -349,6 +364,9 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
|
||||
QPushButton:checked {
|
||||
color: white;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
color: #ADADAD;
|
||||
}
|
||||
)").arg(padding));
|
||||
|
||||
nav_btns->addButton(btn);
|
||||
|
||||
@@ -78,6 +78,9 @@ ButtonControl::ButtonControl(const QString &title, const QString &text, const QS
|
||||
color: #E4E4E4;
|
||||
background-color: #393939;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: #4a4a4a;
|
||||
}
|
||||
QPushButton:disabled {
|
||||
color: #33E4E4E4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user