1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

PopupWindow: Add margins around locationbar and line between webview

This commit is contained in:
David Rosca 2018-01-04 17:38:41 +01:00
parent fa4fba5f49
commit d1d99e3b71

View File

@ -1,6 +1,6 @@
/* ============================================================
* Falkon - Qt web browser
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
*
* 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
@ -39,11 +39,17 @@ PopupWindow::PopupWindow(PopupWebView* view)
{
m_layout = new QVBoxLayout(this);
m_layout->setContentsMargins(0, 0, 0, 0);
m_layout->setSpacing(2);
m_layout->setSpacing(0);
m_locationBar = new PopupLocationBar(this);
m_locationBar->setView(m_view);
QWidget *locationWidget = new QWidget(this);
QVBoxLayout *llayout = new QVBoxLayout();
llayout->setContentsMargins(3, 3, 3, 5);
llayout->addWidget(m_locationBar);
locationWidget->setLayout(llayout);
m_statusBar = new QStatusBar(this);
m_statusBar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
@ -65,6 +71,13 @@ PopupWindow::PopupWindow(PopupWebView* view)
nlayout->setContentsMargins(0, 0, 0, 0);
nlayout->setSpacing(1);
QWidget *viewSpacer = new QWidget(this);
pal = viewSpacer->palette();
pal.setColor(QPalette::Background, pal.window().color().darker(125));
viewSpacer->setPalette(pal);
viewSpacer->setFixedHeight(1);
viewSpacer->setAutoFillBackground(true);
m_menuBar = new QMenuBar(this);
QMenu* menuFile = new QMenu(tr("File"));
@ -117,7 +130,8 @@ PopupWindow::PopupWindow(PopupWebView* view)
viewWidget->setLayout(l);
m_layout->insertWidget(0, m_menuBar);
m_layout->addWidget(m_locationBar);
m_layout->addWidget(locationWidget);
m_layout->addWidget(viewSpacer);
m_layout->addWidget(viewWidget);
m_layout->addWidget(m_statusBar);
setLayout(m_layout);