Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI/sidebar_widget: Improved hierarchy between UI elements in settings sidebar #31332

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions selfdrive/ui/qt/offroad/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,23 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
QPushButton *close_btn = new QPushButton(tr("×"));
close_btn->setStyleSheet(R"(
QPushButton {
font-size: 140px;
color: grey;
background-color: transparent;
border: none;
font-size: 190px;
font-weight: 450;
text-align: left;
padding-left: 0px;
padding-bottom: 20px;
border-radius: 100px;
background-color: #292929;
font-weight: 400;
}
QPushButton:pressed {
background-color: #3B3B3B;
color: #ADADAD;
background-color: transparent;
}
)");
close_btn->setFixedSize(200, 200);
sidebar_layout->addSpacing(45);
sidebar_layout->addWidget(close_btn, 0, Qt::AlignCenter);
sidebar_layout->addWidget(close_btn, 0, Qt::AlignLeft);
sidebar_layout->addSpacing(95);
QObject::connect(close_btn, &QPushButton::clicked, this, &SettingsWindow::closeSettings);

// setup panels
Expand Down Expand Up @@ -393,6 +397,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
background: none;
font-size: 65px;
font-weight: 500;
padding-left: 15px;
}
QPushButton:checked {
color: white;
Expand All @@ -403,7 +408,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
)");
btn->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
nav_btns->addButton(btn);
sidebar_layout->addWidget(btn, 0, Qt::AlignRight);
sidebar_layout->addWidget(btn, 0, Qt::AlignLeft);

const int lr_margin = name != tr("Network") ? 50 : 0; // Network panel handles its own margins
panel->setContentsMargins(lr_margin, 25, lr_margin, 25);
Expand All @@ -416,7 +421,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
panel_widget->setCurrentWidget(w);
});
}
sidebar_layout->setContentsMargins(50, 50, 100, 50);
sidebar_layout->setContentsMargins(50, 0, 100, 50);

// main settings layout, sidebar + main panel
QHBoxLayout *main_layout = new QHBoxLayout(this);
Expand Down