QT GUI: add fullscreen mode

This commit is contained in:
Jean-Francois Dockes 2010-02-01 17:51:42 +01:00
parent 1351ba0fa2
commit 5569b5be7c
5 changed files with 55 additions and 3 deletions

View File

@ -46,6 +46,14 @@
<number>0</number>
</property>
<widget class="QRadioButton" name="allRDB">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>45</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>All</string>
</property>
@ -112,6 +120,8 @@
<addaction name="fileEraseDocHistoryAction"/>
<addaction name="showMissingHelpers_Action"/>
<addaction name="separator"/>
<addaction name="toggleFullScreenAction"/>
<addaction name="separator"/>
<addaction name="fileExitAction"/>
</widget>
<widget class="QMenu" name="toolsMenu">
@ -312,6 +322,20 @@
<cstring>extIdxAction</cstring>
</property>
</action>
<action name="toggleFullScreenAction">
<property name="text">
<string>&amp;Full Screen</string>
</property>
<property name="iconText">
<string>Full Screen</string>
</property>
<property name="shortcut">
<string>F11</string>
</property>
<property name="name" stdset="0">
<cstring>toggleFullScreenAction</cstring>
</property>
</action>
</widget>
<layoutdefault spacing="2" margin="2"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>

View File

@ -732,6 +732,7 @@ bool Preview::makeDocCurrent(const Rcl::Doc& doc, int docnum, bool sametab)
closeCurrentTab();
return false;
}
raise();
return true;
}

View File

@ -120,6 +120,8 @@
<action name="fileEraseDocHistoryAction"/>
<action name="showMissingHelpers_Action"/>
<separator/>
<action name="toggleFullScreenAction"/>
<separator/>
<action name="fileExitAction"/>
</item>
<item text="&amp;Tools" name="toolsMenu">
@ -366,6 +368,17 @@
<string>External index dialog</string>
</property>
</action>
<action>
<property name="name">
<cstring>toggleFullScreenAction</cstring>
</property>
<property name="menuText">
<string>&amp;Full Screen</string>
</property>
<property name="accel">
<string>F11</string>
</property>
</action>
</actions>
<pixmapinproject/>
<layoutdefaults spacing="2" margin="2"/>

View File

@ -284,6 +284,8 @@ void RclMain::init()
connect(extIdxAction, SIGNAL(activated()), this, SLOT(showExtIdxDialog()));
if (prefs.catgToolBar && catgCMB)
connect(catgCMB, SIGNAL(activated(int)), this, SLOT(catgFilter(int)));
connect(toggleFullScreenAction, SIGNAL(activated()),
this, SLOT(toggleFullScreen()));
connect(periodictimer, SIGNAL(timeout()), this, SLOT(periodic100()));
// Start timer on a slow period (used for checking ^C). Will be
// speeded up during indexing
@ -452,8 +454,11 @@ void RclMain::fileExit()
{
LOGDEB(("RclMain: fileExit\n"));
m_tempfiles.clear();
prefs.mainwidth = width();
prefs.mainheight = height();
// Don't save geometry if we're currently fullscreened
if (!isFullScreen()) {
prefs.mainwidth = width();
prefs.mainheight = height();
}
prefs.ssearchTyp = sSearch->searchTypCMB->currentItem();
if (asearchform)
delete asearchform;
@ -1239,6 +1244,14 @@ void RclMain::catgFilter(int id)
resList->setDocSource();
}
void RclMain::toggleFullScreen()
{
if (isFullScreen())
showNormal();
else
showFullScreen();
}
bool RclMain::eventFilter(QObject *, QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
@ -1253,7 +1266,7 @@ bool RclMain::eventFilter(QObject *, QEvent *event)
// Shift-Home -> first page of results
resList->resultPageFirst();
return true;
}
}
}
return false;
}

View File

@ -111,6 +111,7 @@ public slots:
virtual void adjustPrefsMenu();
virtual void catgFilter(int);
virtual void initDbOpen();
virtual void toggleFullScreen();
signals:
void stemLangChanged(const QString& lang);