This commit is contained in:
Your Name
2024-05-10 00:58:07 -05:00
parent 05aab16504
commit 7d56c3fdbc
2 changed files with 25 additions and 17 deletions

View File

@@ -11,6 +11,8 @@
#include "selfdrive/ui/qt/widgets/prime.h"
#include "system/hardware/hw.h"
#include <QWebEngineView>
#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);
@@ -189,7 +192,12 @@ OffroadHome::OffroadHome(QWidget* parent) : QFrame(parent) {
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);

View File

@@ -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<wl_surface*>(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<wl_surface*>(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();