mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
WebInspector: Remember height
This commit is contained in:
parent
a049f44757
commit
224207b8d6
@ -1,6 +1,6 @@
|
|||||||
/* ============================================================
|
/* ============================================================
|
||||||
* QupZilla - WebKit based browser
|
* QupZilla - Qt web browser
|
||||||
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
|
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,6 +18,7 @@
|
|||||||
#include "webinspector.h"
|
#include "webinspector.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "networkmanager.h"
|
#include "networkmanager.h"
|
||||||
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
@ -34,6 +35,8 @@ WebInspector::WebInspector(QWidget *parent)
|
|||||||
setObjectName(QSL("web-inspector"));
|
setObjectName(QSL("web-inspector"));
|
||||||
setMinimumHeight(80);
|
setMinimumHeight(80);
|
||||||
|
|
||||||
|
m_height = Settings().value(QSL("Web-Inspector/height"), 80).toInt();
|
||||||
|
|
||||||
registerView(this);
|
registerView(this);
|
||||||
|
|
||||||
connect(page(), &QWebEnginePage::windowCloseRequested, this, &WebInspector::deleteLater);
|
connect(page(), &QWebEnginePage::windowCloseRequested, this, &WebInspector::deleteLater);
|
||||||
@ -43,6 +46,8 @@ WebInspector::WebInspector(QWidget *parent)
|
|||||||
WebInspector::~WebInspector()
|
WebInspector::~WebInspector()
|
||||||
{
|
{
|
||||||
unregisterView(this);
|
unregisterView(this);
|
||||||
|
|
||||||
|
Settings().setValue(QSL("Web-Inspector/height"), height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebInspector::setView(QWebEngineView *view)
|
void WebInspector::setView(QWebEngineView *view)
|
||||||
@ -119,6 +124,13 @@ void WebInspector::loadFinished()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSize WebInspector::sizeHint() const
|
||||||
|
{
|
||||||
|
QSize s = QWebEngineView::sizeHint();
|
||||||
|
s.setHeight(m_height);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
void WebInspector::keyPressEvent(QKeyEvent *event)
|
void WebInspector::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event)
|
Q_UNUSED(event)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ============================================================
|
/* ============================================================
|
||||||
* QupZilla - WebKit based browser
|
* QupZilla - Qt web browser
|
||||||
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
|
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -44,11 +44,13 @@ private slots:
|
|||||||
void loadFinished();
|
void loadFinished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QSize sizeHint() const override;
|
||||||
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
|
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
|
||||||
void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
|
void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
static QList<QWebEngineView*> s_views;
|
static QList<QWebEngineView*> s_views;
|
||||||
|
|
||||||
|
int m_height;
|
||||||
bool m_inspectElement = false;
|
bool m_inspectElement = false;
|
||||||
QWebEngineView *m_view;
|
QWebEngineView *m_view;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user