diff --git a/examples/widgets/widgetwindow.cpp b/examples/widgets/widgetwindow.cpp index 159952715913986b6bf31f313521723a5b3e003a..2cf2cfddd4f09ab02967d22c11b233ddcd061621 100644 --- a/examples/widgets/widgetwindow.cpp +++ b/examples/widgets/widgetwindow.cpp @@ -43,6 +43,8 @@ #include "qwebcontentsview.h" +static const int margin = 1; + WidgetWindow::WidgetWindow() : m_webView(new QWebContentsView) , addressLineEdit(0) @@ -51,12 +53,14 @@ WidgetWindow::WidgetWindow() if (QIcon::themeName().isEmpty()) QIcon::setThemeName("oxygen"); - setGeometry(0, 0, 1024, 768); + setGeometry(0, 0, 800, 600); QVBoxLayout* layout = new QVBoxLayout; + layout->setContentsMargins(margin, margin, margin, margin); // Create a widget based address bar. QHBoxLayout* addressBar = new QHBoxLayout; + addressBar->setSpacing(margin); // Bigger buttons, less space between them QToolButton* backButton = new QToolButton; backButton->setIcon(QIcon::fromTheme("go-previous")); diff --git a/lib/qwebcontentsview.cpp b/lib/qwebcontentsview.cpp index 5cff52ad40ab3bc005a06b2a592dfb4dff847460..3da4c727e6100adcbc8860e6db6b26269a31303c 100644 --- a/lib/qwebcontentsview.cpp +++ b/lib/qwebcontentsview.cpp @@ -71,6 +71,7 @@ QWebContentsView::QWebContentsView() content::BrowserContext* browser_context = static_cast<ContentBrowserClientQt*>(content::GetContentClient()->browser())->browser_context(); d->webContentsDelegate.reset(WebContentsDelegateQt::CreateNewWindow(browser_context, NULL, MSG_ROUTING_NONE, gfx::Size())); QVBoxLayout *layout = new QVBoxLayout; + layout->setContentsMargins(0, 0, 0, 0); setLayout(layout); WebContentsViewQt* content_view = static_cast<WebContentsViewQt*>(d->webContentsDelegate->web_contents()->GetView()); diff --git a/shared/native_view_container_qt.h b/shared/native_view_container_qt.h index fbb29ee85922f3540e9e63d8e50168f7b0248dd2..ce977ac196a0eb0fc94f783ecd7f0aaf9098e10d 100644 --- a/shared/native_view_container_qt.h +++ b/shared/native_view_container_qt.h @@ -15,7 +15,7 @@ public: : m_embeddable(0) , m_currentQQuickNativeView(0) , m_currentQWidgetNativeView(0) - , m_isQQuick(!qgetenv("QQUICKWEBENGINE").isNull()) + , m_isQQuick(true) { } @@ -34,8 +34,12 @@ public: QVBoxLayout* widget() { - if (!m_embeddable) - m_embeddable = new QVBoxLayout; + if (!m_embeddable) { + m_isQQuick = false; + QVBoxLayout *l = new QVBoxLayout; + l->setContentsMargins(0, 0, 0, 0); + m_embeddable = l; + } return static_cast<QVBoxLayout*>(m_embeddable); }