Added fullscreen mode.
This commit is contained in:
parent
6e53714da1
commit
3dce1b7a07
@ -78,6 +78,15 @@ void FormMain::quit() {
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
void FormMain::switchFullscreenMode(bool turn_fullscreen_on) {
|
||||
if (turn_fullscreen_on) {
|
||||
showFullScreen();
|
||||
} else {
|
||||
|
||||
showNormal();
|
||||
}
|
||||
}
|
||||
|
||||
void FormMain::switchVisibility() {
|
||||
if (isVisible()) {
|
||||
hide();
|
||||
@ -122,6 +131,7 @@ void FormMain::setupIcons() {
|
||||
m_ui->m_actionAboutGuard->setIcon(ThemeFactory::fromTheme("help-about"));
|
||||
m_ui->m_actionImport->setIcon(ThemeFactory::fromTheme("document-import"));
|
||||
m_ui->m_actionExport->setIcon(ThemeFactory::fromTheme("document-export"));
|
||||
m_ui->m_actionFullscreen->setIcon(ThemeFactory::fromTheme("view-fullscreen"));
|
||||
|
||||
// Setup icons for underlying components: opened web browsers...
|
||||
foreach (WebBrowser *browser, WebBrowser::runningWebBrowsers()) {
|
||||
@ -133,6 +143,9 @@ void FormMain::createConnections() {
|
||||
// Menu "File" connections.
|
||||
connect(m_ui->m_actionQuit, &QAction::triggered, this, &FormMain::quit);
|
||||
|
||||
// Menu "View" connections.
|
||||
connect(m_ui->m_actionFullscreen, &QAction::triggered, this, &FormMain::switchFullscreenMode);
|
||||
|
||||
// Menu "Tools" connections.
|
||||
connect(m_ui->m_actionSettings, &QAction::triggered, this, &FormMain::showSettings);
|
||||
|
||||
|
@ -48,10 +48,17 @@ class FormMain : public QMainWindow {
|
||||
|
||||
// Displays window on top or switches its visibility.
|
||||
void display();
|
||||
|
||||
// Switches visibility of main window.
|
||||
void switchVisibility();
|
||||
|
||||
// Turns on/off fullscreen mode
|
||||
void switchFullscreenMode(bool turn_fullscreen_on);
|
||||
|
||||
protected slots:
|
||||
void cleanupResources();
|
||||
|
||||
// Displays various dialogs.
|
||||
void showSettings();
|
||||
void showAbout();
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>21</height>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="m_menuFile">
|
||||
@ -97,6 +97,7 @@
|
||||
<property name="title">
|
||||
<string>&View</string>
|
||||
</property>
|
||||
<addaction name="m_actionFullscreen"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="m_menuTools">
|
||||
<property name="title">
|
||||
@ -147,6 +148,17 @@
|
||||
<string>&About RSS Guard</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="m_actionFullscreen">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Fullscreen mode</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Shift+F</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user