This commit is contained in:
Your Name
2024-04-28 13:48:26 -05:00
parent 30f217ef62
commit a44d563376
3 changed files with 25 additions and 13 deletions

View File

@@ -17,6 +17,9 @@
// HomeWindow: the container for the offroad and onroad UIs // HomeWindow: the container for the offroad and onroad UIs
HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) { HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
// CLEARPILOT Sidebar set to invisible in drive view.
params.putBool("Sidebar", false);
QHBoxLayout *main_layout = new QHBoxLayout(this); QHBoxLayout *main_layout = new QHBoxLayout(this);
main_layout->setMargin(0); main_layout->setMargin(0);
main_layout->setSpacing(0); main_layout->setSpacing(0);
@@ -107,19 +110,25 @@ void HomeWindow::showDriverView(bool show, bool started) {
} }
void HomeWindow::mousePressEvent(QMouseEvent* e) { void HomeWindow::mousePressEvent(QMouseEvent* e) {
// Handle sidebar collapsing
// CLEARPILOT todo - tap on main goes straight to settings // CLEARPILOT todo - tap on main goes straight to settings
// Unless we click a debug widget. // Unless we click a debug widget.
if ((onroad->isVisible() || body->isVisible()) && (!sidebar->isVisible() || e->x() > sidebar->width())) {
sidebar->setVisible(!sidebar->isVisible() && !onroad->isMapVisible()); // Handle sidebar collapsing
uiState()->scene.map_open = onroad->isMapVisible(); // if ((onroad->isVisible() || body->isVisible()) && (!sidebar->isVisible() || e->x() > sidebar->width())) {
params.putBool("Sidebar", sidebar->isVisible()); // sidebar->setVisible(!sidebar->isVisible() && !onroad->isMapVisible());
} // uiState()->scene.map_open = onroad->isMapVisible();
// params.putBool("Sidebar", sidebar->isVisible());
// }
// CLEARPILOT - click ready shows home // CLEARPILOT - click ready shows home
if (!onroad->isVisible() && ready->isVisible()) { if (!onroad->isVisible() && ready->isVisible()) {
slayout->setCurrentWidget(home); slayout->setCurrentWidget(home);
} }
// Todo: widgets
if (onroad->isVisible()) {
emit openSettings();
}
} }
void HomeWindow::mouseDoubleClickEvent(QMouseEvent* e) { void HomeWindow::mouseDoubleClickEvent(QMouseEvent* e) {

View File

@@ -250,13 +250,16 @@ class Soundd:
11: "world_frog_day", 11: "world_frog_day",
} }
if current_holiday_theme != 0: # Clearpilot: Impl theme switcher
theme_name = holiday_theme_configuration.get(current_holiday_theme) # if current_holiday_theme != 0:
self.sound_directory = BASEDIR + ("/selfdrive/frogpilot/assets/holiday_themes/" + theme_name + "/sounds/") # theme_name = holiday_theme_configuration.get(current_holiday_theme)
self.goat_scream = False # self.sound_directory = BASEDIR + ("/selfdrive/frogpilot/assets/holiday_themes/" + theme_name + "/sounds/")
else: # self.goat_scream = False
theme_name = theme_configuration.get(custom_sounds) # else:
self.sound_directory = BASEDIR + ("/selfdrive/frogpilot/assets/custom_themes/" + theme_name + "/sounds/" if custom_sounds != 0 else "/selfdrive/assets/sounds/") # theme_name = theme_configuration.get(custom_sounds)
# self.sound_directory = BASEDIR + ("/selfdrive/clearpilot/theme/" + theme_name + "/sounds/" if custom_sounds != 0 else "/selfdrive/assets/sounds/")
self.sound_directory = BASEDIR + ("/selfdrive/clearpilot/theme/clearpilot/sounds/" if custom_sounds != 0 else "/selfdrive/assets/sounds/")
if self.sound_directory != self.previous_sound_directory: if self.sound_directory != self.previous_sound_directory:
self.load_sounds() self.load_sounds()