[Kstars-devel] Full screen mode

Heiko Evermann Heiko.Evermann at gmx.de
Sat Feb 14 23:37:57 CET 2004


Hi everyone,

Recently we talked about a full screen mode for kstars. So I had a look 
at other programs that implement a full screen mode.

I have found:
1) konqueror
2) kdeedu/kig

For KIG this is implemented in kig_view.cpp as:
<code>
void KigView::toggleFullScreen()
{
  mrealwidget->setFullScreen( ! mrealwidget->isFullScreen() );
  if ( mrealwidget->isFullScreen() )
    topLevelWidget()->showFullScreen();
  else
    topLevelWidget()->showNormal();
}
</code>

topLevelWidget is inherited from QT and should work for all 
QWidgets.Then a top level QWidget knows how to switch to full screen 
mode. (See http://doc.trolltech.com/3.3/qwidget.html and look for void 
QWidget::showFullScreen)

So I just gave it a quick try and mapped it to the tip of the day:

//Help Menu
void KStars::slotTipOfDay() {
    topLevelWidget()->showFullScreen();
    //KTipDialog::showTip("kstars/tips", true);
}

This seemed to work fine. So we would need:
* a boolean flag, whether full screen mode is on, so that we can toggle it
* a menu item plus its mapping.

A quick grep shows
kig_part.cpp:  a = KStdAction::fullScreen( m_widget, SLOT( 
toggleFullScreen() ), actionCollection(), 0 );
kig_part.cpp:    m_widget, SLOT( toggleFullScreen() ),

that we even have a standard action for this (konquerer and kig use the 
same symbol), so it would not even break strings in KDE_3_2_BRANCH.

How do we go on from here? Shall I implement the full screen mode or is 
anyone else working on some central files anyway? It seems to be a 
question of just a few lines of code.

It would be nice, if there was also some way of changing the background 
colors of the menu and status bar. Then we might have an easy way to a 
full screen night vision. (But so far I do not know how to do that...)

Regards,

Heiko



More information about the Kstars-devel mailing list