mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
[CommandLineOptions] New option to toggle fullscreen.
This commit is contained in:
parent
a1a0764101
commit
a1f9b784d7
@ -51,7 +51,8 @@ void CommandLineOptions::showHelp()
|
|||||||
" -nw or --new-window open new window\n"
|
" -nw or --new-window open new window\n"
|
||||||
" -pb or --private-browsing start private browsing\n"
|
" -pb or --private-browsing start private browsing\n"
|
||||||
" -dm or --download-manager show download manager\n"
|
" -dm or --download-manager show download manager\n"
|
||||||
" -nr or --no-remote open new instance\n"
|
" -fs or --fullscreen toggle fullscreen\n"
|
||||||
|
" -nr or --no-remote open new browser instance\n"
|
||||||
" -ct=URL or --current-tab=URL open URL in current tab\n"
|
" -ct=URL or --current-tab=URL open URL in current tab\n"
|
||||||
" -ow=URL or --open-window=URL open URL in new window\n"
|
" -ow=URL or --open-window=URL open URL in new window\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -156,6 +157,12 @@ void CommandLineOptions::parseActions()
|
|||||||
m_actions.append(pair);
|
m_actions.append(pair);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arg.startsWith(QLatin1String("-fs")) || arg.startsWith(QLatin1String("--fullscreen"))) {
|
||||||
|
ActionPair pair;
|
||||||
|
pair.action = Qz::CL_ToggleFullScreen;
|
||||||
|
m_actions.append(pair);
|
||||||
|
}
|
||||||
|
|
||||||
if (arg.startsWith(QLatin1String("-ct")) || arg.startsWith(QLatin1String("--current-tab"))) {
|
if (arg.startsWith(QLatin1String("-ct")) || arg.startsWith(QLatin1String("--current-tab"))) {
|
||||||
int index = arg.indexOf(QLatin1Char('='));
|
int index = arg.indexOf(QLatin1Char('='));
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
|
@ -170,6 +170,10 @@ MainApplication::MainApplication(int &argc, char** argv)
|
|||||||
case Qz::CL_NewWindow:
|
case Qz::CL_NewWindow:
|
||||||
messages.append(QLatin1String("ACTION:NewWindow"));
|
messages.append(QLatin1String("ACTION:NewWindow"));
|
||||||
break;
|
break;
|
||||||
|
case Qz::CL_ToggleFullScreen:
|
||||||
|
messages.append(QLatin1String("ACTION:ToggleFullScreen"));
|
||||||
|
m_postLaunchActions.append(ToggleFullScreen);
|
||||||
|
break;
|
||||||
case Qz::CL_ShowDownloadManager:
|
case Qz::CL_ShowDownloadManager:
|
||||||
messages.append(QLatin1String("ACTION:ShowDownloadManager"));
|
messages.append(QLatin1String("ACTION:ShowDownloadManager"));
|
||||||
m_postLaunchActions.append(OpenDownloadManager);
|
m_postLaunchActions.append(OpenDownloadManager);
|
||||||
@ -320,6 +324,10 @@ void MainApplication::postLaunch()
|
|||||||
getWindow()->tabWidget()->addView(QUrl(), Qz::NT_SelectedNewEmptyTab);
|
getWindow()->tabWidget()->addView(QUrl(), Qz::NT_SelectedNewEmptyTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_postLaunchActions.contains(ToggleFullScreen)) {
|
||||||
|
getWindow()->toggleFullScreen();
|
||||||
|
}
|
||||||
|
|
||||||
AutoSaver* saver = new AutoSaver();
|
AutoSaver* saver = new AutoSaver();
|
||||||
connect(saver, SIGNAL(saveApp()), this, SLOT(saveStateSlot()));
|
connect(saver, SIGNAL(saveApp()), this, SLOT(saveStateSlot()));
|
||||||
|
|
||||||
@ -560,6 +568,10 @@ void MainApplication::receiveAppMessage(QString message)
|
|||||||
downManager()->show();
|
downManager()->show();
|
||||||
actWin = downManager();
|
actWin = downManager();
|
||||||
}
|
}
|
||||||
|
else if (text == QLatin1String("ToggleFullScreen") && actWin) {
|
||||||
|
QupZilla* qz = static_cast<QupZilla*>(actWin);
|
||||||
|
qz->toggleFullScreen();
|
||||||
|
}
|
||||||
else if (text.startsWith(QLatin1String("OpenUrlInCurrentTab"))) {
|
else if (text.startsWith(QLatin1String("OpenUrlInCurrentTab"))) {
|
||||||
actUrl = QUrl::fromUserInput(text.mid(19));
|
actUrl = QUrl::fromUserInput(text.mid(19));
|
||||||
}
|
}
|
||||||
@ -577,13 +589,13 @@ void MainApplication::receiveAppMessage(QString message)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QupZilla* qz = qobject_cast<QupZilla*>(actWin);
|
|
||||||
|
|
||||||
actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized);
|
actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized);
|
||||||
actWin->raise();
|
actWin->raise();
|
||||||
actWin->activateWindow();
|
actWin->activateWindow();
|
||||||
actWin->setFocus();
|
actWin->setFocus();
|
||||||
|
|
||||||
|
QupZilla* qz = qobject_cast<QupZilla*>(actWin);
|
||||||
|
|
||||||
if (qz && !actUrl.isEmpty()) {
|
if (qz && !actUrl.isEmpty()) {
|
||||||
qz->loadAddress(actUrl);
|
qz->loadAddress(actUrl);
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ private slots:
|
|||||||
void saveSettings();
|
void saveSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum PostLaunchAction { OpenDownloadManager, OpenNewTab };
|
enum PostLaunchAction { OpenDownloadManager, OpenNewTab, ToggleFullScreen };
|
||||||
|
|
||||||
void loadTheme(const QString &name);
|
void loadTheme(const QString &name);
|
||||||
void translateApp();
|
void translateApp();
|
||||||
|
@ -485,7 +485,7 @@ void QupZilla::setupMenu()
|
|||||||
#else
|
#else
|
||||||
m_actionShowFullScreen->setShortcut(QKeySequence("Ctrl+F11"));
|
m_actionShowFullScreen->setShortcut(QKeySequence("Ctrl+F11"));
|
||||||
#endif
|
#endif
|
||||||
connect(m_actionShowFullScreen, SIGNAL(triggered(bool)), MENU_RECEIVER, SLOT(toggleFullScreen(bool)));
|
connect(m_actionShowFullScreen, SIGNAL(triggered(bool)), MENU_RECEIVER, SLOT(toggleFullScreen()));
|
||||||
m_actionStop = new QAction(qIconProvider->standardIcon(QStyle::SP_BrowserStop), tr("&Stop"), MENU_RECEIVER);
|
m_actionStop = new QAction(qIconProvider->standardIcon(QStyle::SP_BrowserStop), tr("&Stop"), MENU_RECEIVER);
|
||||||
connect(m_actionStop, SIGNAL(triggered()), MENU_RECEIVER, SLOT(stop()));
|
connect(m_actionStop, SIGNAL(triggered()), MENU_RECEIVER, SLOT(stop()));
|
||||||
m_actionStop->setShortcut(QKeySequence("Esc"));
|
m_actionStop->setShortcut(QKeySequence("Esc"));
|
||||||
@ -1930,13 +1930,13 @@ bool QupZilla::event(QEvent* event)
|
|||||||
return QMainWindow::event(event);
|
return QMainWindow::event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QupZilla::toggleFullScreen(bool make)
|
void QupZilla::toggleFullScreen()
|
||||||
{
|
{
|
||||||
if (make) {
|
if (isFullScreen()) {
|
||||||
showFullScreen();
|
showNormal();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
showNormal();
|
showFullScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,6 +122,7 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setWindowTitle(const QString &t);
|
void setWindowTitle(const QString &t);
|
||||||
|
void toggleFullScreen();
|
||||||
|
|
||||||
void showWebInspector(bool toggle = true);
|
void showWebInspector(bool toggle = true);
|
||||||
void showBookmarksToolbar();
|
void showBookmarksToolbar();
|
||||||
@ -200,7 +201,6 @@ private slots:
|
|||||||
void zoomIn();
|
void zoomIn();
|
||||||
void zoomOut();
|
void zoomOut();
|
||||||
void zoomReset();
|
void zoomReset();
|
||||||
void toggleFullScreen(bool make);
|
|
||||||
void changeEncoding(QObject* obj = 0);
|
void changeEncoding(QObject* obj = 0);
|
||||||
|
|
||||||
void triggerCaretBrowsing();
|
void triggerCaretBrowsing();
|
||||||
|
@ -68,6 +68,7 @@ enum CommandLineAction {
|
|||||||
CL_NewTab,
|
CL_NewTab,
|
||||||
CL_NewWindow,
|
CL_NewWindow,
|
||||||
CL_ShowDownloadManager,
|
CL_ShowDownloadManager,
|
||||||
|
CL_ToggleFullScreen,
|
||||||
CL_StartPrivateBrowsing,
|
CL_StartPrivateBrowsing,
|
||||||
CL_StartNewInstance,
|
CL_StartNewInstance,
|
||||||
CL_ExitAction
|
CL_ExitAction
|
||||||
|
@ -183,7 +183,7 @@ NavigationBar::NavigationBar(QupZilla* mainClass)
|
|||||||
connect(m_buttonHome, SIGNAL(controlClicked()), p_QupZilla, SLOT(goHomeInNewTab()));
|
connect(m_buttonHome, SIGNAL(controlClicked()), p_QupZilla, SLOT(goHomeInNewTab()));
|
||||||
connect(m_buttonAddTab, SIGNAL(clicked()), p_QupZilla, SLOT(addTab()));
|
connect(m_buttonAddTab, SIGNAL(clicked()), p_QupZilla, SLOT(addTab()));
|
||||||
connect(m_buttonAddTab, SIGNAL(middleMouseClicked()), p_QupZilla->tabWidget(), SLOT(addTabFromClipboard()));
|
connect(m_buttonAddTab, SIGNAL(middleMouseClicked()), p_QupZilla->tabWidget(), SLOT(addTabFromClipboard()));
|
||||||
connect(m_exitFullscreen, SIGNAL(clicked(bool)), p_QupZilla, SLOT(toggleFullScreen(bool)));
|
connect(m_exitFullscreen, SIGNAL(clicked(bool)), p_QupZilla, SLOT(toggleFullScreen()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationBar::setSplitterSizes(int locationBar, int websearchBar)
|
void NavigationBar::setSplitterSizes(int locationBar, int websearchBar)
|
||||||
|
Loading…
Reference in New Issue
Block a user