mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Draw line at the bottom of navigation bar if tabs are on top.
To visually distinguish navigation bar from the page
This commit is contained in:
parent
3b4d2f5534
commit
8a1502c9cf
@ -59,6 +59,7 @@
|
||||
#include "qztools.h"
|
||||
#include "reloadstopbutton.h"
|
||||
#include "enhancedmenu.h"
|
||||
#include "navigationcontainer.h"
|
||||
#include "settings.h"
|
||||
#include "qzsettings.h"
|
||||
#include "webtab.h"
|
||||
@ -297,7 +298,7 @@ void QupZilla::setupUi()
|
||||
m_navigationBar->setSplitterSizes(locationBarWidth, websearchBarWidth);
|
||||
m_bookmarksToolbar = new BookmarksToolbar(this);
|
||||
|
||||
m_navigationContainer = new QWidget(this);
|
||||
m_navigationContainer = new NavigationContainer(this);
|
||||
QVBoxLayout* l = new QVBoxLayout(m_navigationContainer);
|
||||
l->setContentsMargins(0, 0, 0, 0);
|
||||
l->setSpacing(0);
|
||||
|
@ -212,7 +212,8 @@ SOURCES += \
|
||||
network/schemehandlers/ftpschemehandler.cpp \
|
||||
autofill/autofillicon.cpp \
|
||||
autofill/autofillwidget.cpp \
|
||||
tools/menubar.cpp
|
||||
tools/menubar.cpp \
|
||||
navigation/navigationcontainer.cpp
|
||||
|
||||
HEADERS += \
|
||||
webview/tabpreview.h \
|
||||
@ -379,7 +380,8 @@ HEADERS += \
|
||||
network/schemehandlers/ftpschemehandler.h \
|
||||
autofill/autofillicon.h \
|
||||
autofill/autofillwidget.h \
|
||||
tools/menubar.h
|
||||
tools/menubar.h \
|
||||
navigation/navigationcontainer.h
|
||||
|
||||
FORMS += \
|
||||
preferences/autofillmanager.ui \
|
||||
|
43
src/lib/navigation/navigationcontainer.cpp
Normal file
43
src/lib/navigation/navigationcontainer.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2013 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */
|
||||
#include "navigationcontainer.h"
|
||||
#include "qzsettings.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QStyleOptionFrameV3>
|
||||
|
||||
NavigationContainer::NavigationContainer(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void NavigationContainer::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
if (qzSettings->tabsOnTop) {
|
||||
// Draw line at the bottom of navigation bar if tabs are on top
|
||||
// To visually distinguish navigation bar from the page
|
||||
QStyleOptionFrameV3 option;
|
||||
option.initFrom(this);
|
||||
|
||||
QPainter p(this);
|
||||
QRect lineRect(0, height() - 1, width(), 1);
|
||||
p.fillRect(lineRect, option.palette.window().color().darker(150));
|
||||
}
|
||||
}
|
33
src/lib/navigation/navigationcontainer.h
Normal file
33
src/lib/navigation/navigationcontainer.h
Normal file
@ -0,0 +1,33 @@
|
||||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2013 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */
|
||||
#ifndef NAVIGATIONCONTAINER_H
|
||||
#define NAVIGATIONCONTAINER_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class NavigationContainer : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit NavigationContainer(QWidget* parent = 0);
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent* event);
|
||||
|
||||
};
|
||||
|
||||
#endif // NAVIGATIONCONTAINER_H
|
Loading…
Reference in New Issue
Block a user