add FullScreen toolbar button

Add shortcut FullScreen (F11) in vnote.ini.
This commit is contained in:
Le Tan 2018-01-22 20:29:40 +08:00
parent b510dc976b
commit ebf4173b88
5 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="512px" height="512px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<path style="fill:#000000" d="M496,384V96H16v288h175v16h-64v16h257v-16h-64v-16H496z M32,112h448v256H32V112z"/>
</svg>

After

Width:  |  Height:  |  Size: 595 B

View File

@ -259,6 +259,8 @@ ActivatePreviousTab=Ctrl+Shift+Tab
FlashPage=Ctrl+Alt+L
; Open via system's default program
OpenViaDefaultProgram=F12
; Full screen
FullScreen=F11
[captain_mode_shortcuts]
; Define shortcuts in Captain mode here.

View File

@ -428,6 +428,32 @@ void VMainWindow::initViewToolBar(QSize p_iconSize)
});
viewToolBar->addAction(expandViewAct);
m_fullScreenAct = new QAction(VIconUtils::toolButtonIcon(":/resources/icons/fullscreen.svg"),
tr("Full Screen"),
this);
QString keySeq = g_config->getShortcutKeySequence("FullScreen");
QKeySequence seq(keySeq);
if (!seq.isEmpty()) {
m_fullScreenAct->setText(tr("Full Screen\t%1").arg(VUtils::getShortcutText(keySeq)));
m_fullScreenAct->setShortcut(seq);
}
m_fullScreenAct->setStatusTip(tr("Toggle full screen"));
connect(m_fullScreenAct, &QAction::triggered,
this, [this]() {
if (windowState() & Qt::WindowFullScreen) {
if (m_windowOldState & Qt::WindowMaximized) {
showMaximized();
} else {
showNormal();
}
} else {
showFullScreen();
}
});
viewToolBar->addAction(m_fullScreenAct);
}
// Enable/disable all actions of @p_widget.

View File

@ -334,12 +334,19 @@ private:
QAction *saveNoteAct;
QAction *saveExitAct;
QAction *discardExitAct;
QAction *expandViewAct;
QAction *m_fullScreenAct;
QAction *m_importNoteAct;
QAction *m_printAct;
QAction *m_exportAsPDFAct;
QAction *m_findReplaceAct;
QAction *m_findNextAct;
QAction *m_findPreviousAct;
QAction *m_replaceAct;

View File

@ -237,5 +237,6 @@
<file>resources/icons/clear_cart.svg</file>
<file>resources/icons/cart.svg</file>
<file>resources/icons/delete_cart_item.svg</file>
<file>resources/icons/fullscreen.svg</file>
</qresource>
</RCC>