ui/settings: fixed button overlap in sidebar. (#28220)

fix button overlap
old-commit-hash: 781a6fcc5f
vw-mqb-aeb
Dean Lee 2 years ago committed by GitHub
parent 40094396b4
commit b6fe3eac41
  1. 11
      selfdrive/ui/qt/offroad/settings.cc

@ -343,7 +343,6 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
QPushButton {
font-size: 140px;
padding-bottom: 20px;
font-weight: bold;
border 1px grey solid;
border-radius: 100px;
background-color: #292929;
@ -379,22 +378,18 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
QObject::connect(map_panel, &MapPanel::closeSettings, this, &SettingsWindow::closeSettings);
#endif
const int padding = panels.size() > 3 ? 25 : 35;
nav_btns = new QButtonGroup(this);
for (auto &[name, panel] : panels) {
QPushButton *btn = new QPushButton(name);
btn->setCheckable(true);
btn->setChecked(nav_btns->buttons().size() == 0);
btn->setStyleSheet(QString(R"(
btn->setStyleSheet(R"(
QPushButton {
color: grey;
border: none;
background: none;
font-size: 65px;
font-weight: 500;
padding-top: %1px;
padding-bottom: %1px;
}
QPushButton:checked {
color: white;
@ -402,8 +397,8 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
QPushButton:pressed {
color: #ADADAD;
}
)").arg(padding));
)");
btn->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
nav_btns->addButton(btn);
sidebar_layout->addWidget(btn, 0, Qt::AlignRight);

Loading…
Cancel
Save