@ -37,8 +37,10 @@ ParamsToggle::ParamsToggle(QString param, QString title, QString description, QS
QLabel * label = new QLabel ( description ) ;
QLabel * label = new QLabel ( description ) ;
label - > setWordWrap ( true ) ;
label - > setWordWrap ( true ) ;
vlayout - > addSpacing ( 50 ) ;
vlayout - > addWidget ( checkbox ) ;
vlayout - > addWidget ( checkbox ) ;
vlayout - > addWidget ( label ) ;
vlayout - > addWidget ( label ) ;
vlayout - > addSpacing ( 50 ) ;
hlayout - > addLayout ( vlayout ) ;
hlayout - > addLayout ( vlayout ) ;
setLayout ( hlayout ) ;
setLayout ( hlayout ) ;
@ -46,7 +48,19 @@ ParamsToggle::ParamsToggle(QString param, QString title, QString description, QS
checkbox - > setChecked ( Params ( ) . read_db_bool ( param . toStdString ( ) . c_str ( ) ) ) ;
checkbox - > setChecked ( Params ( ) . read_db_bool ( param . toStdString ( ) . c_str ( ) ) ) ;
setStyleSheet ( R " (
setStyleSheet ( R " (
QCheckBox { font - size : 70 px }
QCheckBox {
font - size : 70 px ;
}
QCheckBox : : indicator {
width : 100 px ;
height : 100 px ;
}
QCheckBox : : indicator : unchecked {
image : url ( . . / assets / offroad / circled - checkmark - empty . png ) ;
}
QCheckBox : : indicator : checked {
image : url ( . . / assets / offroad / circled - checkmark . png ) ;
}
QLabel { font - size : 40 px }
QLabel { font - size : 40 px }
* {
* {
background - color : # 114265 ;
background - color : # 114265 ;
@ -62,14 +76,15 @@ void ParamsToggle::checkboxClicked(int state){
}
}
SettingsWindow : : SettingsWindow ( QWidget * parent ) : QWidget ( parent ) {
SettingsWindow : : SettingsWindow ( QWidget * parent ) : QWidget ( parent ) {
QWidget * container = new QWidget ( this ) ;
QVBoxLayout * settings_list = new QVBoxLayout ( ) ;
QVBoxLayout * settings_list = new QVBoxLayout ( ) ;
/*
settings_list - > addWidget ( new ParamsToggle ( " OpenpilotEnabledToggle " ,
settings_list - > addWidget ( new ParamsToggle ( " OpenpilotEnabledToggle " ,
" Enable Openpilot " ,
" Enable Openpilot " ,
" Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off. " ,
" Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off. " ,
" ../assets/offroad/icon_openpilot.png "
" ../assets/offroad/icon_openpilot.png "
) ) ;
) ) ;
*/
settings_list - > addWidget ( new ParamsToggle ( " LaneChangeEnabled " ,
settings_list - > addWidget ( new ParamsToggle ( " LaneChangeEnabled " ,
" Enable Lane Change Assist " ,
" Enable Lane Change Assist " ,
" Perform assisted lane changes with openpilot by checking your surroundings for safety, activating the turn signal and gently nudging the steering wheel towards your desired lane. openpilot is not capable of checking if a lane change is safe. You must continuously observe your surroundings to use this feature. " ,
" Perform assisted lane changes with openpilot by checking your surroundings for safety, activating the turn signal and gently nudging the steering wheel towards your desired lane. openpilot is not capable of checking if a lane change is safe. You must continuously observe your surroundings to use this feature. " ,
@ -80,6 +95,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QWidget(parent) {
" Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31mph (50kph). " ,
" Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31mph (50kph). " ,
" ../assets/offroad/icon_warning.png "
" ../assets/offroad/icon_warning.png "
) ) ;
) ) ;
/*
settings_list - > addWidget ( new ParamsToggle ( " RecordFront " ,
settings_list - > addWidget ( new ParamsToggle ( " RecordFront " ,
" Record and Upload Driver Camera " ,
" Record and Upload Driver Camera " ,
" Upload data from the driver facing camera and help improve the driver monitoring algorithm. " ,
" Upload data from the driver facing camera and help improve the driver monitoring algorithm. " ,
@ -90,6 +106,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QWidget(parent) {
" Allow openpilot to obey left-hand traffic conventions and perform driver monitoring on right driver seat. " ,
" Allow openpilot to obey left-hand traffic conventions and perform driver monitoring on right driver seat. " ,
" ../assets/offroad/icon_openpilot_mirrored.png "
" ../assets/offroad/icon_openpilot_mirrored.png "
) ) ;
) ) ;
*/
settings_list - > addWidget ( new ParamsToggle ( " IsMetric " ,
settings_list - > addWidget ( new ParamsToggle ( " IsMetric " ,
" Use Metric System " ,
" Use Metric System " ,
" Display speed in km/h instead of mp/h. " ,
" Display speed in km/h instead of mp/h. " ,
@ -103,35 +120,28 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QWidget(parent) {
settings_list - > setSpacing ( 25 ) ;
settings_list - > setSpacing ( 25 ) ;
QWidget * container = new QWidget ( this ) ;
container - > setLayout ( settings_list ) ;
container - > setLayout ( settings_list ) ;
container - > setFixedWidth ( 1650 ) ;
container - > setFixedWidth ( 1900 ) ;
QScrollArea * scrollArea = new QScrollArea ;
scrollArea - > setHorizontalScrollBarPolicy ( Qt : : ScrollBarAlwaysOff ) ;
scrollArea - > setVerticalScrollBarPolicy ( Qt : : ScrollBarAlwaysOff ) ;
scrollArea - > setWidget ( container ) ;
QScrollerProperties sp ;
sp . setScrollMetric ( QScrollerProperties : : DecelerationFactor , 2.0 ) ;
QScroller * qs = QScroller : : scroller ( scrollArea ) ;
qs - > setScrollerProperties ( sp ) ;
QHBoxLayout * main_layout = new QHBoxLayout ;
QHBoxLayout * main_layout = new QHBoxLayout ;
main_layout - > addSpacing ( 50 ) ;
main_layout - > addSpacing ( 50 ) ;
main_layout - > addWidget ( scrollArea ) ;
main_layout - > addWidget ( container ) ;
QVBoxLayout * button_layout = new QVBoxLayout ;
QPushButton * button = new QPushButton ( " X " ) ;
button_layout - > addWidget ( button ) ;
button_layout - > addSpacing ( 900 ) ;
QPushButton * button = new QPushButton ( " Close " ) ;
main_layout - > addLayout ( button_layout ) ;
main_layout - > addWidget ( button ) ;
main_layout - > addSpacing ( 20 ) ;
main_layout - > addSpacing ( 20 ) ;
setLayout ( main_layout ) ;
setLayout ( main_layout ) ;
QScroller : : grabGesture ( scrollArea , QScroller : : LeftMouseButtonGesture ) ;
QObject : : connect ( button , SIGNAL ( clicked ( ) ) , this , SIGNAL ( closeSettings ( ) ) ) ;
QObject : : connect ( button , SIGNAL ( clicked ( ) ) , this , SIGNAL ( closeSettings ( ) ) ) ;
setStyleSheet ( R " (
setStyleSheet ( R " (
QPushButton { font - size : 4 0px }
QPushButton { font - size : 10 0px }
* {
* {
color : white ;
color : white ;
background - color : # 07233 9 ;
background - color : # 07233 9 ;