diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 4dcb41c..689a57f 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -11,6 +11,8 @@ #include "selfdrive/ui/qt/widgets/prime.h" #include "system/hardware/hw.h" +#include + #ifdef ENABLE_MAPS #include "selfdrive/ui/qt/maps/map_settings.h" #endif @@ -88,6 +90,7 @@ void HomeWindow::offroadTransition(bool offroad) { if (offroad) { sidebar->setVisible(false); slayout->setCurrentWidget(ready); + // slayout->setCurrentWidget(home); // this->showDriverView(true, true); // Temp } else { sidebar->setVisible(false); @@ -188,8 +191,13 @@ OffroadHome::OffroadHome(QWidget* parent) : QFrame(parent) { QHBoxLayout *home_layout = new QHBoxLayout(home_widget); home_layout->setContentsMargins(0, 0, 0, 0); home_layout->setSpacing(30); - - // Clearpilot: removed home ui widgets + + // // Create a QWebEngineView + QWebEngineView *web_view = new QWebEngineView(); + web_view->load(QUrl("http://fark.com")); + + // Add the QWebEngineView to the layout + home_layout->addWidget(web_view); } center_layout->addWidget(home_widget); diff --git a/system/clearpilot/tools/qt_webview.cc b/system/clearpilot/tools/qt_webview.cc index 6484ffc..3e3a7c0 100644 --- a/system/clearpilot/tools/qt_webview.cc +++ b/system/clearpilot/tools/qt_webview.cc @@ -35,23 +35,23 @@ int main(int argc, char *argv[]) { window.setStyleSheet("background-color: black;"); window.showFullScreen(); - auto windowHandle = window.windowHandle(); - if (!windowHandle) { - fprintf(stderr, "Error: Unable to obtain window handle.\n"); - return 1; - } + // auto windowHandle = window.windowHandle(); + // if (!windowHandle) { + // fprintf(stderr, "Error: Unable to obtain window handle.\n"); + // return 1; + // } - QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); - auto *s = static_cast(native->nativeResourceForWindow("surface", windowHandle)); - if (!s) { - fprintf(stderr, "Error: Unable to obtain native Wayland surface.\n"); - return 1; - } + // QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); + // auto *s = static_cast(native->nativeResourceForWindow("surface", windowHandle)); + // if (!s) { + // fprintf(stderr, "Error: Unable to obtain native Wayland surface.\n"); + // return 1; + // } - wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); - wl_surface_commit(s); + // wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); + // wl_surface_commit(s); - window.setFixedSize(2160, 1080); + // window.setFixedSize(2160, 1080); QVBoxLayout *layout = new QVBoxLayout(&window); layout->setSpacing(0); @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) { // QString url = args.first(); QWebEngineView *web_view = new QWebEngineView(); - web_view->load(QUrl("http://www.fark.com/")); + web_view->load(QUrl(argv[1]))); layout->addWidget(web_view); return app.exec();