Commit 1b065b29 authored by Pierre Rossi's avatar Pierre Rossi
Browse files

cleaner content margins for the nested layouts

also remove QQUICKWEBENGINE env var
Showing with 13 additions and 4 deletions
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include "qwebcontentsview.h" #include "qwebcontentsview.h"
static const int margin = 1;
WidgetWindow::WidgetWindow() WidgetWindow::WidgetWindow()
: m_webView(new QWebContentsView) : m_webView(new QWebContentsView)
, addressLineEdit(0) , addressLineEdit(0)
...@@ -51,12 +53,14 @@ WidgetWindow::WidgetWindow() ...@@ -51,12 +53,14 @@ WidgetWindow::WidgetWindow()
if (QIcon::themeName().isEmpty()) if (QIcon::themeName().isEmpty())
QIcon::setThemeName("oxygen"); QIcon::setThemeName("oxygen");
setGeometry(0, 0, 1024, 768); setGeometry(0, 0, 800, 600);
QVBoxLayout* layout = new QVBoxLayout; QVBoxLayout* layout = new QVBoxLayout;
layout->setContentsMargins(margin, margin, margin, margin);
// Create a widget based address bar. // Create a widget based address bar.
QHBoxLayout* addressBar = new QHBoxLayout; QHBoxLayout* addressBar = new QHBoxLayout;
addressBar->setSpacing(margin); // Bigger buttons, less space between them
QToolButton* backButton = new QToolButton; QToolButton* backButton = new QToolButton;
backButton->setIcon(QIcon::fromTheme("go-previous")); backButton->setIcon(QIcon::fromTheme("go-previous"));
......
...@@ -71,6 +71,7 @@ QWebContentsView::QWebContentsView() ...@@ -71,6 +71,7 @@ QWebContentsView::QWebContentsView()
content::BrowserContext* browser_context = static_cast<ContentBrowserClientQt*>(content::GetContentClient()->browser())->browser_context(); 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())); d->webContentsDelegate.reset(WebContentsDelegateQt::CreateNewWindow(browser_context, NULL, MSG_ROUTING_NONE, gfx::Size()));
QVBoxLayout *layout = new QVBoxLayout; QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
setLayout(layout); setLayout(layout);
WebContentsViewQt* content_view = static_cast<WebContentsViewQt*>(d->webContentsDelegate->web_contents()->GetView()); WebContentsViewQt* content_view = static_cast<WebContentsViewQt*>(d->webContentsDelegate->web_contents()->GetView());
......
...@@ -15,7 +15,7 @@ public: ...@@ -15,7 +15,7 @@ public:
: m_embeddable(0) : m_embeddable(0)
, m_currentQQuickNativeView(0) , m_currentQQuickNativeView(0)
, m_currentQWidgetNativeView(0) , m_currentQWidgetNativeView(0)
, m_isQQuick(!qgetenv("QQUICKWEBENGINE").isNull()) , m_isQQuick(true)
{ {
} }
...@@ -34,8 +34,12 @@ public: ...@@ -34,8 +34,12 @@ public:
QVBoxLayout* widget() QVBoxLayout* widget()
{ {
if (!m_embeddable) if (!m_embeddable) {
m_embeddable = new QVBoxLayout; m_isQQuick = false;
QVBoxLayout *l = new QVBoxLayout;
l->setContentsMargins(0, 0, 0, 0);
m_embeddable = l;
}
return static_cast<QVBoxLayout*>(m_embeddable); return static_cast<QVBoxLayout*>(m_embeddable);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment