mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 12:46:35 +01:00
[MouseGestures] Honor to user settings for 'New Tab' url,
- Closes #1380
This commit is contained in:
parent
59b893075a
commit
0af8f45a5f
@ -75,6 +75,18 @@ void PopupWebView::loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags
|
||||
}
|
||||
}
|
||||
|
||||
void PopupWebView::openNewTab(Qz::NewTabPositionFlags position)
|
||||
{
|
||||
Q_UNUSED(position)
|
||||
|
||||
BrowserWindow* window = mApp->getWindow();
|
||||
|
||||
if (window) {
|
||||
window->tabWidget()->addView(QUrl(), Qz::NT_SelectedTab);
|
||||
window->raise();
|
||||
}
|
||||
}
|
||||
|
||||
void PopupWebView::closeView()
|
||||
{
|
||||
parentWidget()->close();
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
|
||||
QWidget* overlayWidget();
|
||||
void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position);
|
||||
void openNewTab(Qz::NewTabPositionFlags position);
|
||||
|
||||
signals:
|
||||
|
||||
|
@ -107,7 +107,7 @@ public slots:
|
||||
void openUrlInNewTab(const QUrl &url, Qz::NewTabPositionFlags position);
|
||||
|
||||
virtual void closeView() = 0;
|
||||
virtual void openNewTab() { }
|
||||
virtual void openNewTab(Qz::NewTabPositionFlags position) { Q_UNUSED(position) }
|
||||
virtual void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position) = 0;
|
||||
|
||||
protected slots:
|
||||
|
@ -214,10 +214,10 @@ void TabbedWebView::closeView()
|
||||
emit wantsCloseTab(tabIndex());
|
||||
}
|
||||
|
||||
void TabbedWebView::openNewTab()
|
||||
void TabbedWebView::openNewTab(Qz::NewTabPositionFlags position)
|
||||
{
|
||||
if (m_window) {
|
||||
m_window->tabWidget()->addView(QUrl());
|
||||
m_window->tabWidget()->addView(QUrl(), position);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ public slots:
|
||||
void userLoadAction(const LoadRequest &req);
|
||||
|
||||
void closeView();
|
||||
void openNewTab();
|
||||
void openNewTab(Qz::NewTabPositionFlags position);
|
||||
void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position);
|
||||
|
||||
private slots:
|
||||
|
@ -170,7 +170,7 @@ int main(int argc, char* argv[])
|
||||
// Hack to fix QT_STYLE_OVERRIDE with QProxyStyle
|
||||
const QByteArray style = qgetenv("QT_STYLE_OVERRIDE");
|
||||
if (!style.isEmpty()) {
|
||||
char **args = (char**) malloc(sizeof(char*) * (argc + 1));
|
||||
char** args = (char**) malloc(sizeof(char*) * (argc + 1));
|
||||
for (int i = 0; i < argc; ++i)
|
||||
args[i] = argv[i];
|
||||
|
||||
|
@ -183,7 +183,7 @@ void MouseGestures::downGestured()
|
||||
return;
|
||||
}
|
||||
|
||||
m_view.data()->openUrlInNewTab(QUrl(), Qz::NT_SelectedNewEmptyTab);
|
||||
m_view.data()->openNewTab(Qz::NT_SelectedNewEmptyTab);
|
||||
}
|
||||
|
||||
void MouseGestures::leftGestured()
|
||||
|
Loading…
Reference in New Issue
Block a user