mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Fixed text in locationbar on HTTPS sites when using dark theme.
- added WheelEvent as another event in Plugin API
This commit is contained in:
parent
5ea084c09d
commit
b5db8a21c9
|
@ -117,6 +117,7 @@
|
|||
|
||||
#locationbar[secured="true"]
|
||||
{
|
||||
color: black;
|
||||
background-color: #ffffbc;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@ public:
|
|||
virtual bool mouseRelease(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event) { Q_UNUSED(type) Q_UNUSED(obj) Q_UNUSED(event) return false; }
|
||||
virtual bool mouseMove(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event) { Q_UNUSED(type) Q_UNUSED(obj) Q_UNUSED(event) return false; }
|
||||
|
||||
virtual bool wheelEvent(const Qz::ObjectName &type, QObject* obj, QWheelEvent* event) { Q_UNUSED(type) Q_UNUSED(obj) Q_UNUSED(event) return false; }
|
||||
|
||||
virtual bool keyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event) { Q_UNUSED(type) Q_UNUSED(obj) Q_UNUSED(event) return false; }
|
||||
virtual bool keyRelease(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event) { Q_UNUSED(type) Q_UNUSED(obj) Q_UNUSED(event) return false; }
|
||||
};
|
||||
|
|
|
@ -78,6 +78,12 @@ void PluginProxy::registerAppEventHandler(const PluginProxy::EventHandlerType &t
|
|||
}
|
||||
break;
|
||||
|
||||
case WheelEventHandler:
|
||||
if (!m_wheelEventHandlers.contains(obj)) {
|
||||
m_wheelEventHandlers.append(obj);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
qWarning("PluginProxy::registerAppEventHandler registering unknown event handler type");
|
||||
break;
|
||||
|
@ -154,6 +160,19 @@ bool PluginProxy::processMouseMove(const Qz::ObjectName &type, QObject* obj, QMo
|
|||
return accepted;
|
||||
}
|
||||
|
||||
bool PluginProxy::processWheelEvent(const Qz::ObjectName &type, QObject *obj, QWheelEvent *event)
|
||||
{
|
||||
bool accepted = false;
|
||||
|
||||
foreach(PluginInterface * iPlugin, m_wheelEventHandlers) {
|
||||
if (iPlugin->wheelEvent(type, obj, event)) {
|
||||
accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
return accepted;
|
||||
}
|
||||
|
||||
bool PluginProxy::processKeyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event)
|
||||
{
|
||||
bool accepted = false;
|
||||
|
|
|
@ -26,7 +26,9 @@ class QT_QUPZILLA_EXPORT PluginProxy : public Plugins
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum EventHandlerType { MouseDoubleClickHandler, MousePressHandler, MouseReleaseHandler, MouseMoveHandler, KeyPressHandler, KeyReleaseHandler };
|
||||
enum EventHandlerType { MouseDoubleClickHandler, MousePressHandler, MouseReleaseHandler,
|
||||
MouseMoveHandler, KeyPressHandler, KeyReleaseHandler,
|
||||
WheelEventHandler};
|
||||
|
||||
explicit PluginProxy();
|
||||
|
||||
|
@ -37,11 +39,13 @@ public:
|
|||
|
||||
bool processMouseDoubleClick(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event);
|
||||
bool processMousePress(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event);
|
||||
bool processMouseRelease(const Qz::ObjectName &object, QObject* obj, QMouseEvent* event);
|
||||
bool processMouseMove(const Qz::ObjectName &object, QObject* obj, QMouseEvent* event);
|
||||
bool processMouseRelease(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event);
|
||||
bool processMouseMove(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event);
|
||||
|
||||
bool processKeyPress(const Qz::ObjectName &object, QObject* obj, QKeyEvent* event);
|
||||
bool processKeyRelease(const Qz::ObjectName &object, QObject* obj, QKeyEvent* event);
|
||||
bool processWheelEvent(const Qz::ObjectName &type, QObject* obj, QWheelEvent* event);
|
||||
|
||||
bool processKeyPress(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event);
|
||||
bool processKeyRelease(const Qz::ObjectName &type, QObject* obj, QKeyEvent* event);
|
||||
|
||||
void emitWebViewCreated(WebView* view);
|
||||
void emitWebViewDeleted(WebView* view);
|
||||
|
@ -62,6 +66,8 @@ private:
|
|||
QList<PluginInterface*> m_mouseReleaseHandlers;
|
||||
QList<PluginInterface*> m_mouseMoveHandlers;
|
||||
|
||||
QList<PluginInterface*> m_wheelEventHandlers;
|
||||
|
||||
QList<PluginInterface*> m_keyPressHandlers;
|
||||
QList<PluginInterface*> m_keyReleaseHandlers;
|
||||
};
|
||||
|
|
|
@ -50,9 +50,12 @@ bool Plugins::loadPlugin(Plugins::Plugin* plugin)
|
|||
return false;
|
||||
}
|
||||
|
||||
m_availablePlugins.removeOne(*plugin);
|
||||
plugin->instance = initPlugin(iPlugin, plugin->pluginLoader);
|
||||
m_availablePlugins.append(*plugin);
|
||||
int index = m_availablePlugins.indexOf(*plugin);
|
||||
if (index == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_availablePlugins[index].instance = initPlugin(iPlugin, plugin->pluginLoader);
|
||||
|
||||
refreshLoadedPlugins();
|
||||
|
||||
|
|
|
@ -780,6 +780,10 @@ void WebView::muteMedia()
|
|||
|
||||
void WebView::wheelEvent(QWheelEvent* event)
|
||||
{
|
||||
if (mApp->plugins()->processWheelEvent(Qz::ON_WebView, this, event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
int numDegrees = event->delta() / 8;
|
||||
int numSteps = numDegrees / 15;
|
||||
|
|
Loading…
Reference in New Issue
Block a user