mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Fixed changing TabsOnTop option when there are more than one window.
This commit is contained in:
parent
17a6879715
commit
7dbaf71f23
|
@ -126,6 +126,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
|
|||
, m_sideBarManager(new SideBarManager(this))
|
||||
, m_statusBarMessage(new StatusBarMessage(this))
|
||||
, m_usingTransparentBackground(false)
|
||||
, m_tabsOnTopState(-1)
|
||||
{
|
||||
setObjectName("mainwindow");
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
@ -919,7 +920,7 @@ Qz::BrowserWindow QupZilla::windowType() const
|
|||
|
||||
QWidget* QupZilla::navigationContainer() const
|
||||
{
|
||||
if (!qzSettings->tabsOnTop) {
|
||||
if (!tabsOnTop()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -938,6 +939,15 @@ bool QupZilla::isTransparentBackgroundAllowed()
|
|||
return m_usingTransparentBackground && !isFullScreen();
|
||||
}
|
||||
|
||||
bool QupZilla::tabsOnTop() const
|
||||
{
|
||||
if (m_tabsOnTopState == -1) {
|
||||
m_tabsOnTopState = qzSettings->tabsOnTop ? 1 : 0;
|
||||
}
|
||||
|
||||
return m_tabsOnTopState == 1;
|
||||
}
|
||||
|
||||
void QupZilla::setWindowTitle(const QString &t)
|
||||
{
|
||||
QString title = t;
|
||||
|
@ -1213,7 +1223,7 @@ void QupZilla::aboutToShowViewMenu()
|
|||
|
||||
m_actionShowStatusbar->setChecked(statusBar()->isVisible());
|
||||
m_actionShowBookmarksToolbar->setChecked(m_bookmarksToolbar->isVisible());
|
||||
m_actionTabsOnTop->setChecked(qzSettings->tabsOnTop);
|
||||
m_actionTabsOnTop->setChecked(tabsOnTop());
|
||||
|
||||
m_actionPageSource->setEnabled(true);
|
||||
|
||||
|
@ -1682,9 +1692,12 @@ void QupZilla::triggerTabsOnTop(bool enable)
|
|||
m_mainLayout->insertWidget(0, m_navigationContainer);
|
||||
}
|
||||
|
||||
m_tabsOnTopState = enable ? 1 : 0;
|
||||
if (enable != qzSettings->tabsOnTop) {
|
||||
Settings settings;
|
||||
settings.setValue("Browser-Tabs-Settings/TabsOnTop", enable);
|
||||
qzSettings->tabsOnTop = enable;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// workaround for changing TabsOnTop state when sidebar is visible
|
||||
|
@ -1778,7 +1791,7 @@ void QupZilla::webSearch()
|
|||
void QupZilla::searchOnPage()
|
||||
{
|
||||
SearchToolBar* toolBar = searchToolBar();
|
||||
const int searchPos = qzSettings->tabsOnTop ? 1 : 2;
|
||||
const int searchPos = tabsOnTop() ? 1 : 2;
|
||||
|
||||
if (!toolBar) {
|
||||
toolBar = new SearchToolBar(weView(), this);
|
||||
|
@ -2212,7 +2225,7 @@ void QupZilla::closeEvent(QCloseEvent* event)
|
|||
SearchToolBar* QupZilla::searchToolBar()
|
||||
{
|
||||
SearchToolBar* toolBar = 0;
|
||||
const int searchPos = qzSettings->tabsOnTop ? 1 : 2;
|
||||
const int searchPos = tabsOnTop() ? 1 : 2;
|
||||
|
||||
if (m_mainLayout->count() == searchPos + 1) {
|
||||
toolBar = qobject_cast<SearchToolBar*>(m_mainLayout->itemAt(searchPos)->widget());
|
||||
|
|
|
@ -114,6 +114,7 @@ public:
|
|||
QUrl homepageUrl() { return m_homepage; }
|
||||
|
||||
bool isTransparentBackgroundAllowed();
|
||||
bool tabsOnTop() const;
|
||||
|
||||
signals:
|
||||
void startingCompleted();
|
||||
|
@ -345,6 +346,7 @@ private:
|
|||
QTimer* m_hideNavigationTimer;
|
||||
|
||||
QList<QPointer<QWidget> > m_deleteOnCloseWidgets;
|
||||
mutable int m_tabsOnTopState;
|
||||
};
|
||||
|
||||
#endif // QUPZILLA_H
|
||||
|
|
|
@ -31,7 +31,7 @@ void NavigationContainer::paintEvent(QPaintEvent* event)
|
|||
{
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
if (qzSettings->tabsOnTop) {
|
||||
if (p_QupZilla->tabsOnTop()) {
|
||||
// Draw line at the bottom of navigation bar if tabs are on top
|
||||
// To visually distinguish navigation bar from the page
|
||||
QPainter p(this);
|
||||
|
|
|
@ -335,7 +335,7 @@ QPixmap WebTab::renderTabPreview()
|
|||
|
||||
void WebTab::showNotification(QWidget* notif)
|
||||
{
|
||||
const int notifPos = qzSettings->tabsOnTop ? 1 : 0;
|
||||
const int notifPos = p_QupZilla->tabsOnTop() ? 1 : 0;
|
||||
|
||||
if (m_layout->count() > notifPos + 1) {
|
||||
delete m_layout->itemAt(notifPos)->widget();
|
||||
|
@ -408,7 +408,7 @@ void WebTab::disconnectObjects()
|
|||
|
||||
void WebTab::hideNavigationBar()
|
||||
{
|
||||
if (m_navigationContainer && qzSettings->tabsOnTop) {
|
||||
if (m_navigationContainer && p_QupZilla->tabsOnTop()) {
|
||||
m_layout->removeWidget(m_navigationContainer);
|
||||
|
||||
// Needed to prevent flickering when closing tabs
|
||||
|
|
Loading…
Reference in New Issue
Block a user