mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Plugins: Hook key events in TabWidget
This commit is contained in:
parent
25d70e557a
commit
0bf881c168
@ -89,6 +89,7 @@ enum CommandLineAction {
|
|||||||
enum ObjectName {
|
enum ObjectName {
|
||||||
ON_WebView,
|
ON_WebView,
|
||||||
ON_TabBar,
|
ON_TabBar,
|
||||||
|
ON_TabWidget,
|
||||||
ON_BrowserWindow
|
ON_BrowserWindow
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "qzsettings.h"
|
#include "qzsettings.h"
|
||||||
#include "qztools.h"
|
#include "qztools.h"
|
||||||
#include "tabicon.h"
|
#include "tabicon.h"
|
||||||
|
#include "pluginproxy.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -196,6 +197,24 @@ void TabWidget::updateClosedTabsButton()
|
|||||||
m_buttonClosedTabs->setVisible(m_showClosedTabsButton && canRestoreTab());
|
m_buttonClosedTabs->setVisible(m_showClosedTabsButton && canRestoreTab());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabWidget::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
if (mApp->plugins()->processKeyPress(Qz::ON_TabWidget, this, event)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TabStackedWidget::keyPressEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TabWidget::keyReleaseEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
if (mApp->plugins()->processKeyRelease(Qz::ON_TabWidget, this, event)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TabStackedWidget::keyReleaseEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
bool TabWidget::isCurrentTabFresh() const
|
bool TabWidget::isCurrentTabFresh() const
|
||||||
{
|
{
|
||||||
return m_currentTabFresh;
|
return m_currentTabFresh;
|
||||||
|
@ -151,6 +151,9 @@ private:
|
|||||||
bool validIndex(int index) const;
|
bool validIndex(int index) const;
|
||||||
void updateClosedTabsButton();
|
void updateClosedTabsButton();
|
||||||
|
|
||||||
|
void keyPressEvent(QKeyEvent *event) override;
|
||||||
|
void keyReleaseEvent(QKeyEvent *event) override;
|
||||||
|
|
||||||
BrowserWindow* m_window;
|
BrowserWindow* m_window;
|
||||||
TabBar* m_tabBar;
|
TabBar* m_tabBar;
|
||||||
QStackedWidget* m_locationBars;
|
QStackedWidget* m_locationBars;
|
||||||
|
Loading…
Reference in New Issue
Block a user