mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 04:36:34 +01:00
TabsOnTop: Fixed picking correct color for drawing line at the bottom of
navigation container.
This commit is contained in:
parent
b4b1ce03d6
commit
7fae03959d
@ -1580,6 +1580,9 @@ void QupZilla::triggerTabsOnTop(bool enable)
|
||||
m_mainLayout->insertWidget(0, m_navigationContainer);
|
||||
}
|
||||
|
||||
Settings settings;
|
||||
settings.setValue("Browser-Tabs-Settings/TabsOnTop", enable);
|
||||
|
||||
qzSettings->tabsOnTop = enable;
|
||||
}
|
||||
|
||||
|
@ -17,12 +17,13 @@
|
||||
* ============================================================ */
|
||||
#include "navigationcontainer.h"
|
||||
#include "qzsettings.h"
|
||||
#include "qupzilla.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QStyleOptionFrameV3>
|
||||
|
||||
NavigationContainer::NavigationContainer(QWidget* parent)
|
||||
NavigationContainer::NavigationContainer(QupZilla* parent)
|
||||
: QWidget(parent)
|
||||
, p_QupZilla(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -33,11 +34,9 @@ void NavigationContainer::paintEvent(QPaintEvent* 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));
|
||||
QColor c = p_QupZilla->palette().window().color().darker(125);
|
||||
p.fillRect(lineRect, c);
|
||||
}
|
||||
}
|
||||
|
@ -22,14 +22,18 @@
|
||||
|
||||
#include "qzsettings.h"
|
||||
|
||||
class QupZilla;
|
||||
|
||||
class QT_QUPZILLA_EXPORT NavigationContainer : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit NavigationContainer(QWidget* parent = 0);
|
||||
explicit NavigationContainer(QupZilla* parent = 0);
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent* event);
|
||||
|
||||
QupZilla* p_QupZilla;
|
||||
|
||||
};
|
||||
|
||||
#endif // NAVIGATIONCONTAINER_H
|
||||
|
@ -65,10 +65,6 @@ void QzSettings::saveSettings()
|
||||
settings.setValue("AutomaticallyOpenProtocols", autoOpenProtocols);
|
||||
settings.setValue("BlockOpeningProtocols", blockedProtocols);
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup("Browser-Tabs-Settings");
|
||||
settings.setValue("TabsOnTop", tabsOnTop);
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user