diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index f5126fa..d6abfba 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -476,10 +476,14 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi if (this->oldGUIStyle) { if (this->wallpaperClassicDayFileExists) { this->setStyleSheet("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }"); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); } } else { if (this->wallpaperDayFileExists) { this->setStyleSheet("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }"); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); } } ui_->pushButtonDay->hide(); @@ -490,10 +494,14 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi if (this->oldGUIStyle) { if (this->wallpaperClassicNightFileExists) { this->setStyleSheet("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }"); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); } } else { if (this->wallpaperNightFileExists) { this->setStyleSheet("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }"); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); } } ui_->pushButtonNight->hide(); @@ -944,20 +952,28 @@ void f1x::openauto::autoapp::ui::MainWindow::toggleGUI() if (this->oldGUIStyle) { if (this->wallpaperClassicDayFileExists) { this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }") ); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); } } else { if (this->wallpaperDayFileExists) { this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }") ); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); } } } else { if (this->oldGUIStyle) { if (this->wallpaperClassicNightFileExists) { this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }") ); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); } } else { if (this->wallpaperNightFileExists) { this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }") ); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); } } } @@ -1003,6 +1019,45 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime() } } + // check if custom command needs black background + QFileInfo blackFile("/tmp/blackscreen"); + if (blackFile.exists()) { + if (ui_->centralWidget->isVisible() == true) { + ui_->centralWidget->hide(); + this->setStyleSheet("QMainWindow {background-color: rgb(0,0,0);}"); + } + } else { + if (!this->nightModeEnabled) { + if (this->oldGUIStyle) { + if (this->wallpaperClassicDayFileExists) { + this->setStyleSheet("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }"); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); + } + } else { + if (this->wallpaperDayFileExists) { + this->setStyleSheet("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }"); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); + } + } + } else { + if (this->oldGUIStyle) { + if (this->wallpaperClassicNightFileExists) { + this->setStyleSheet("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }"); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); + } + } else { + if (this->wallpaperNightFileExists) { + this->setStyleSheet("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }"); + } else { + this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); + } + } + } + } + // check if phone is conencted to usb QFileInfo phoneConnectedFile("/tmp/android_device"); if (phoneConnectedFile.exists()) { diff --git a/src/autoapp/UI/mainwindow.ui b/src/autoapp/UI/mainwindow.ui index db64329..ca72f51 100644 --- a/src/autoapp/UI/mainwindow.ui +++ b/src/autoapp/UI/mainwindow.ui @@ -31,7 +31,7 @@ MainWindow - color: rgb(255, 255, 255); + color: rgb(0, 0, 0);