[system/khelpcenter] /: Add the full screen mode

Albert Astals Cid null at kde.org
Sun Apr 25 11:28:16 BST 2021


Git commit 9b681f6bbef323597c27b3f8cfd4340518a8231e by Albert Astals Cid, on behalf of Yuri Chornoivan.
Committed on 25/04/2021 at 10:28.
Pushed by aacid into branch 'master'.

Add the full screen mode

BUG: 119582

M  +14   -0    doc/khelpcenter/index.docbook
M  +2    -1    khelpcenterui.rc
M  +15   -0    mainwindow.cpp
M  +2    -0    mainwindow.h

https://invent.kde.org/system/khelpcenter/commit/9b681f6bbef323597c27b3f8cfd4340518a8231e

diff --git a/doc/khelpcenter/index.docbook b/doc/khelpcenter/index.docbook
index d1568307..42d329c0 100644
--- a/doc/khelpcenter/index.docbook
+++ b/doc/khelpcenter/index.docbook
@@ -686,6 +686,20 @@ you may need to choose a specific encoding in this menu.
 </para>
 </listitem>
 </varlistentry>
+<varlistentry>
+<term><menuchoice><guimenu>View</guimenu>
+<guisubmenu>Full Screen Mode</guisubmenu>
+</menuchoice>
+</term>
+<listitem>
+<para>
+Changes &khelpcenter; to full screen mode, in which the &khelpcenter; window
+takes up the whole screen, and does not have the usual window decorations. To
+exit full screen mode, press <keycombo action="simul">&Ctrl;&Shift;
+<keycap>F</keycap></keycombo>.
+</para>
+</listitem>
+</varlistentry>
 </variablelist>
 </listitem>
 </varlistentry>
diff --git a/khelpcenterui.rc b/khelpcenterui.rc
index 1de3fba3..5f7adc74 100644
--- a/khelpcenterui.rc
+++ b/khelpcenterui.rc
@@ -1,5 +1,5 @@
 <!DOCTYPE gui SYSTEM "kpartgui.dtd">
-<gui name="khelpcenter" version="18">
+<gui name="khelpcenter" version="19">
 <MenuBar>
  <Menu name="edit" noMerge="1">
   <text>&Edit</text>
@@ -13,6 +13,7 @@
   <text>&View</text>
   <Action name="viewDocumentSource" />
   <Action name="setEncoding" />
+  <Action name="fullscreen" />
  </Menu>
  <Menu name="go">
   <text>&Go</text>
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 055ab9d8..c3bd180f 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -37,6 +37,7 @@
 #include <QDir>
 #include <QIcon>
 #include <QList>
+#include <QMenuBar>
 #include <QMimeDatabase>
 #include <QPushButton>
 #include <QSplitter>
@@ -55,6 +56,7 @@
 #include <KHTMLView>
 #include <KStandardAction>
 #include <KStartupInfo>
+#include <KToolBar>
 #include <KWindowConfig>
 
 #include <kio_version.h>
@@ -234,6 +236,8 @@ void MainWindow::setupActions()
     nextPage->setWhatsThis( i18n( "Moves to the next page of the document" ) );
     connect( nextPage, &QAction::triggered, mDoc, &View::nextPage );
 
+    KStandardAction::fullScreen( this, SLOT( slotFullScreen() ), this, actionCollection() );
+
     QAction *home = KStandardAction::home( this, SLOT(slotShowHome()), this );
     actionCollection()->addAction( home->objectName(), home );
     home->setText(i18n("Table of &Contents"));
@@ -518,5 +522,16 @@ void MainWindow::slotConfigureFonts()
   }
 }
 
+void MainWindow::slotFullScreen()
+{
+  if (!mFullScreen) {
+    KToggleFullScreenAction::setFullScreen(this, true);
+    mFullScreen = true;
+  } else {
+    KToggleFullScreenAction::setFullScreen(this, false);
+    mFullScreen = false;
+  }
+}
+
 
 // vim:ts=2:sw=2:et
diff --git a/mainwindow.h b/mainwindow.h
index ca833995..16eb967e 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -63,6 +63,7 @@ class MainWindow : public KXmlGuiWindow
     void statusBarMessage(const QString &m);
     void slotShowHome();
     void slotLastSearch();
+    void slotFullScreen();
     void showSearchStderr();
     /**
       Show document corresponding to given URL in viewer part.
@@ -125,6 +126,7 @@ private:
     QAction *mLastSearchAction = nullptr;
     QAction *mCopyText = nullptr;
     LogDialog *mLogDialog = nullptr;
+    bool mFullScreen = false;
 };
 
 }


More information about the kde-doc-english mailing list