From 0cc9692f63a53aea09fba181938119ff76da7987 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sun, 22 Jan 2017 14:43:22 +0100 Subject: [PATCH] PopupWindow: Fix showing custom scrollbars --- src/lib/popupwindow/popupwebview.cpp | 6 +++--- src/lib/popupwindow/popupwindow.cpp | 14 +++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/lib/popupwindow/popupwebview.cpp b/src/lib/popupwindow/popupwebview.cpp index a87f5ad96..3cf0accef 100644 --- a/src/lib/popupwindow/popupwebview.cpp +++ b/src/lib/popupwindow/popupwebview.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2010-2016 David Rosca +* QupZilla - Qt web browser +* Copyright (C) 2010-2017 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ PopupWebView::PopupWebView(QWidget* parent) QWidget* PopupWebView::overlayWidget() { - return this; + return parentWidget(); } void PopupWebView::loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position) diff --git a/src/lib/popupwindow/popupwindow.cpp b/src/lib/popupwindow/popupwindow.cpp index 298a498ab..025c8d894 100644 --- a/src/lib/popupwindow/popupwindow.cpp +++ b/src/lib/popupwindow/popupwindow.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2010-2016 David Rosca +* QupZilla - Qt web browser +* Copyright (C) 2010-2017 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,9 +97,17 @@ PopupWindow::PopupWindow(PopupWebView* view) addAction(action); } + QVBoxLayout *l = new QVBoxLayout(); + l->setContentsMargins(0, 0, 0, 0); + l->setSpacing(0); + l->addWidget(m_view); + + QWidget *viewWidget = new QWidget(this); + viewWidget->setLayout(l); + m_layout->insertWidget(0, m_menuBar); m_layout->addWidget(m_locationBar); - m_layout->addWidget(m_view); + m_layout->addWidget(viewWidget); m_layout->addWidget(m_statusBar); setLayout(m_layout);