mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-21 22:13:45 +08:00
ui: sunnypilot Vehicles panel refactor (#126)
* take out toyota stock long for now * remove scrollbar (use in other areas!) * use ListWidget for toggles * Revert "remove scrollbar (use in other areas!)" This reverts commit 0b6bbc49e968598b204558060e04fb6f64ad1977. * turn off scrollbar * new fcr styling
This commit is contained in:
@@ -535,25 +535,33 @@ SPVehiclesPanel::SPVehiclesPanel(QWidget *parent) : QWidget(parent) {
|
||||
home_widget->setObjectName("homeWidget");
|
||||
|
||||
ScrollView *scroller = new ScrollView(home_widget, this);
|
||||
scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
fcr_layout->addWidget(scroller, 1);
|
||||
|
||||
main_layout->addWidget(home);
|
||||
|
||||
setStyleSheet(R"(
|
||||
#setCarBtn {
|
||||
border-radius: 50px;
|
||||
font-size: 50px;
|
||||
margin: 0px;
|
||||
padding: 20px;
|
||||
border-width: 0;
|
||||
border-radius: 30px;
|
||||
color: #dddddd;
|
||||
background-color: #444444;
|
||||
font-weight: 500;
|
||||
height:100px;
|
||||
padding: 0 35 0 35;
|
||||
color: #E4E4E4;
|
||||
background-color: #393939;
|
||||
}
|
||||
#setCarBtn:pressed {
|
||||
background-color: #4a4a4a;
|
||||
}
|
||||
)");
|
||||
|
||||
toggle_layout->addWidget(horizontal_line());
|
||||
toggle_layout->addWidget(new LabelControl(tr("Toyota/Lexus")));
|
||||
auto toggle_panel = new SPVehiclesTogglesPanel(this);
|
||||
toggle_layout->addWidget(toggle_panel);
|
||||
}
|
||||
|
||||
SPVehiclesTogglesPanel::SPVehiclesTogglesPanel(SPVehiclesPanel *parent) : ListWidget(parent) {
|
||||
setSpacing(50);
|
||||
addItem(new LabelControl(tr("Toyota/Lexus")));
|
||||
stockLongToyota = new ParamControl(
|
||||
"StockLongToyota",
|
||||
"Enable Stock Toyota Longitudinal Control",
|
||||
@@ -561,8 +569,7 @@ SPVehiclesPanel::SPVehiclesPanel(QWidget *parent) : QWidget(parent) {
|
||||
"../assets/offroad/icon_blank.png"
|
||||
);
|
||||
stockLongToyota->setConfirmation(true, false);
|
||||
toggle_layout->addWidget(horizontal_line());
|
||||
toggle_layout->addWidget(stockLongToyota);
|
||||
addItem(stockLongToyota);
|
||||
}
|
||||
|
||||
SPVisualsPanel::SPVisualsPanel(QWidget *parent) : QWidget(parent) {
|
||||
|
||||
@@ -118,6 +118,15 @@ private:
|
||||
QWidget* home = nullptr;
|
||||
|
||||
QWidget* home_widget;
|
||||
};
|
||||
|
||||
class SPVehiclesTogglesPanel : public ListWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SPVehiclesTogglesPanel(SPVehiclesPanel *parent);
|
||||
|
||||
private:
|
||||
Params params;
|
||||
|
||||
ParamControl *stockLongToyota;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user