From e653923eb660a9882af88990c579f83825ba75d7 Mon Sep 17 00:00:00 2001 From: hawkeyexp Date: Sun, 6 Jan 2019 11:09:32 +0100 Subject: [PATCH] Fixes / Apply alpha to old style menu --- src/autoapp/UI/MainWindow.cpp | 36 +- src/autoapp/UI/SettingsWindow.cpp | 11 + src/autoapp/UI/mainwindow.ui | 1045 +++++++++++++++-------------- src/autoapp/UI/settingswindow.ui | 160 +++-- 4 files changed, 680 insertions(+), 572 deletions(-) diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index 6bf5987..a3a47d7 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -475,6 +475,9 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi ui_->pushButtonBrightness->hide(); ui_->pushButtonBrightness2->hide(); ui_->BrightnessSliderControl->hide(); + // also hide volume button cause not needed if brightness not visible + ui_->pushButtonVolume->hide(); + ui_->pushButtonVolume2->hide(); } // init alpha values @@ -488,6 +491,9 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi ui_->pushButtonNight2->hide(); ui_->pushButtonBrightness->hide(); ui_->pushButtonBrightness2->hide(); + // hide also volume cause not needed without brightness + ui_->pushButtonVolume->hide(); + ui_->pushButtonVolume2->hide(); } // Hide recordings button @@ -780,6 +786,25 @@ void f1x::openauto::autoapp::ui::MainWindow::updateAlpha() ui_->pushButtonAndroidAuto->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);"); ui_->pushButtonNoDevice->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);"); ui_->pushButtonNoWiFiDevice->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);"); + // old style + ui_->pushButtonSettings2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonLock2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonMusic2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonBrightness2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonToggleGUI2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonExit2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonShutdown2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonReboot2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonCancel2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonAndroidAuto2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonNoDevice2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonWifi2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonNoWiFiDevice2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonDay2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonNight2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonCameraShow2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonVolume2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); + ui_->pushButtonDebug2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none;"); } } @@ -791,6 +816,7 @@ void f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight() ui_->pushButtonDay2->show(); ui_->pushButtonNight->hide(); ui_->pushButtonNight2->hide(); + ui_->BrightnessSliderControl->hide(); if (ui_->mediaWidget->isVisible() == true) { ui_->VolumeSliderControl->hide(); } @@ -804,6 +830,7 @@ void f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay() ui_->pushButtonNight2->show(); ui_->pushButtonDay->hide(); ui_->pushButtonDay2->hide(); + ui_->BrightnessSliderControl->hide(); if (ui_->mediaWidget->isVisible() == true) { ui_->VolumeSliderControl->hide(); } @@ -1677,7 +1704,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() } // Hide auto day/night if needed - if (this->lightsensor) { + if (this->lightsensor || std::ifstream("/tmp/daynight_gpio")) { ui_->pushButtonDay->hide(); ui_->pushButtonNight->hide(); ui_->pushButtonDay2->hide(); @@ -1739,6 +1766,9 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() ui_->pushButtonBrightness->hide(); ui_->pushButtonBrightness2->hide(); ui_->BrightnessSliderControl->hide(); + // also hide volume button if brightness hidden + ui_->pushButtonVolume->hide(); + ui_->pushButtonVolume2->hide(); if (ui_->mediaWidget->isVisible() == false) { ui_->VolumeSliderControl->show(); } @@ -1748,6 +1778,10 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() if ((ui_->pushButtonBrightness->isVisible() == false) || (ui_->pushButtonBrightness->isVisible() == false)) { ui_->pushButtonBrightness->show(); ui_->pushButtonBrightness2->show(); + // also show volume button if brightness visible + ui_->pushButtonVolume->show(); + ui_->pushButtonVolume2->show(); + ui_->BrightnessSliderControl->hide(); } } } diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index 3eed7cd..bafd80e 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -116,6 +116,7 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat ui_->spinBoxHour->setValue((time_text_hour).toInt()); ui_->spinBoxMinute->setValue((time_text_minute).toInt()); ui_->label_modeswitchprogress->setText("Ok"); + ui_->label_notavailable->hide(); if (std::ifstream("/tmp/hotspot_active")) { ui_->radioButtonClient->setChecked(0); @@ -124,6 +125,8 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat ui_->lineEditPassword->show(); ui_->label_password->show(); ui_->lineEditPassword->setText("1234567890"); + ui_->clientNetworkSelect->hide(); + ui_->label_notavailable->show(); } else { ui_->radioButtonClient->setChecked(1); ui_->radioButtonHotspot->setChecked(0); @@ -131,6 +134,8 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat ui_->lineEditPassword->hide(); ui_->label_password->hide(); ui_->lineEditPassword->setText(""); + ui_->clientNetworkSelect->hide(); + ui_->label_notavailable->show(); } } @@ -1002,6 +1007,8 @@ void SettingsWindow::onShowBindings() void SettingsWindow::onStartHotspot() { ui_->label_modeswitchprogress->setText("Wait ..."); + ui_->clientNetworkSelect->hide(); + ui_->label_notavailable->show(); ui_->radioButtonClient->setEnabled(0); ui_->radioButtonHotspot->setEnabled(0); ui_->lineEdit_wlan0->setText(""); @@ -1016,6 +1023,8 @@ void SettingsWindow::onStartHotspot() void SettingsWindow::onStopHotspot() { ui_->label_modeswitchprogress->setText("Wait ..."); + ui_->clientNetworkSelect->hide(); + ui_->label_notavailable->show(); ui_->radioButtonClient->setEnabled(0); ui_->radioButtonHotspot->setEnabled(0); ui_->lineEdit_wlan0->setText(""); @@ -1216,6 +1225,8 @@ void f1x::openauto::autoapp::ui::SettingsWindow::updateNetworkInfo() ui_->lineEditPassword->hide(); ui_->label_password->hide(); ui_->lineEditPassword->setText(""); + ui_->clientNetworkSelect->show(); + ui_->label_notavailable->hide(); } } diff --git a/src/autoapp/UI/mainwindow.ui b/src/autoapp/UI/mainwindow.ui index 1ede504..be77935 100644 --- a/src/autoapp/UI/mainwindow.ui +++ b/src/autoapp/UI/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 929 - 1529 + 1511 @@ -761,510 +761,6 @@ color: rgb(255, 255, 255); - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - background-color: rgba(0, 0, 0, 0); - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Horizontal - - - - 10 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 75 - true - - - - background-color: rgba(0, 0, 0, 0); -color: rgb(196, 160, 0); - - - SSID: - - - - - - - - 0 - 0 - - - - - 130 - 24 - - - - - 130 - 24 - - - - - 75 - true - - - - background-color: rgba(0, 0, 0, 0); -color: rgb(196, 160, 0); - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 75 - true - - - - background-color: rgba(0, 0, 0, 0); -color: rgb(196, 160, 0); - - - IP: - - - - - - - - 0 - 0 - - - - - 130 - 24 - - - - - 130 - 24 - - - - - 75 - true - - - - background-color: rgba(0, 0, 0, 0); -color: rgb(196, 160, 0); - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 75 - true - - - - background-color: rgba(0, 0, 0, 0); -color: rgb(196, 160, 0); - - - Mask: - - - - - - - - 0 - 0 - - - - - 130 - 24 - - - - - 130 - 24 - - - - - 75 - true - - - - background-color: rgba(0, 0, 0, 0); -color: rgb(196, 160, 0); - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 75 - true - - - - background-color: rgba(0, 0, 0, 0); -color: rgb(196, 160, 0); - - - GW: - - - - - - - - 0 - 0 - - - - - 130 - 24 - - - - - 130 - 24 - - - - - 75 - true - - - - background-color: rgba(0, 0, 0, 0); -color: rgb(196, 160, 0); - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - - Qt::Horizontal - - - - 10 - 20 - - - - - - - @@ -1290,6 +786,509 @@ color: rgb(196, 160, 0); + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + background-color: rgba(0, 0, 0, 0); +border-radius: 0px; +border: 2px solid rgba(255,255,255,0.5); +outline: none; + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 10 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + border: no-border; + + + + 0 + + + 0 + + + 20 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + + 75 + true + + + + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); +border: no-border; + + + SSID: + + + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); +border: no-border; + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + border: no-border; + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + + 75 + true + + + + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); +border: no-border; + + + IP: + + + + + + + + 0 + 0 + + + + + 130 + 24 + + + + + 130 + 24 + + + + + 75 + true + + + + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); +border: no-border; + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + border: no-border; + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + + 75 + true + + + + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); +border: no-border; + + + Mask: + + + + + + + + 0 + 0 + + + + + 130 + 24 + + + + + 130 + 24 + + + + + 75 + true + + + + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); +border: no-border; + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + 0 + 0 + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + border: no-border; + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 16777215 + 24 + + + + + 75 + true + + + + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); +border: no-border; + + + GW: + + + + + + + + 0 + 0 + + + + + 120 + 16777215 + + + + + 75 + true + + + + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); +border: no-border; + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + Qt::Horizontal + + + + 10 + 20 + + + + + + + @@ -2315,6 +2314,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2355,6 +2356,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2395,6 +2398,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2435,6 +2440,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2475,6 +2482,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2515,6 +2524,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2579,6 +2590,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2619,6 +2632,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2659,6 +2674,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2780,6 +2797,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2827,6 +2846,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); color: rgb(255, 255, 255); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2882,6 +2903,8 @@ Device background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2929,6 +2952,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); color: rgb(255, 255, 255); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -2963,6 +2988,8 @@ Device background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -3003,6 +3030,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -3043,6 +3072,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -3083,6 +3114,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -3123,6 +3156,8 @@ outline: none; background-color: rgba(136, 138, 133, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); outline: none; diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui index 948f583..cd0a36e 100644 --- a/src/autoapp/UI/settingswindow.ui +++ b/src/autoapp/UI/settingswindow.ui @@ -445,7 +445,7 @@ outline: none; - Transparency Tile GUI + Transparency GUI @@ -3406,114 +3406,142 @@ outline: none; - 9 + 0 0 - 9 + 0 2 - + - + 0 0 - 120 - 0 + 0 + 24 - 120 - 16777215 + 16777215 + 24 - - - 75 - true - - - - background-color: rgb(117, 80, 123); -outline: none; - - Config 1 + not available + + + Qt::AlignCenter - + - + 0 0 - 120 - 0 + 0 + 24 - 120 - 16777215 + 16777215 + 24 - - - 75 - true - - - - background-color: rgb(117, 80, 123); + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgb(117, 80, 123); outline: none; - - - Config 2 - - - - - - - - 0 - 0 - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - background-color: rgb(78, 154, 6); + + + Default + + + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgb(117, 80, 123); outline: none; - - - Auto - + + + Phone Hotspot + + + + + + + + 0 + 0 + + + + background-color: rgb(78, 154, 6); +outline: none; + + + Auto + + + +