summaryrefslogtreecommitdiff
path: root/libopie2/opieui/big-screen/owidgetstack.cpp
Unidiff
Diffstat (limited to 'libopie2/opieui/big-screen/owidgetstack.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/owidgetstack.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp
index 57e97e3..a0a6355 100644
--- a/libopie2/opieui/big-screen/owidgetstack.cpp
+++ b/libopie2/opieui/big-screen/owidgetstack.cpp
@@ -11,53 +11,53 @@
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that 12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with 21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "owidgetstack.h" 29#include "owidgetstack.h"
30 30
31/* QT */ 31/* QT */
32#include <qapplication.h> 32#include <qapplication.h>
33#include <qwidgetstack.h> 33#include <qwidgetstack.h>
34 34
35namespace { 35namespace Opie {
36namespace Ui {
36 const int mode_size = 330; 37 const int mode_size = 330;
37}
38 38
39using namespace Opie; 39
40 40
41/** 41/**
42 * This is the standard widget. For simple usage see the example. Normally this widget 42 * This is the standard widget. For simple usage see the example. Normally this widget
43 * is the central widget of a QMainWindow. 43 * is the central widget of a QMainWindow.
44 * Use removeWidget before you delete a widget yourself. OWidgetStack does not 44 * Use removeWidget before you delete a widget yourself. OWidgetStack does not
45 * yet recognize removal of children. 45 * yet recognize removal of children.
46 * 46 *
47 * @param parent The parent widget. It maybe 0 but then you need to take care of deletion. 47 * @param parent The parent widget. It maybe 0 but then you need to take care of deletion.
48 * Or you use QPEApplication::showMainWidget(). 48 * Or you use QPEApplication::showMainWidget().
49 * @param name Name will be passed on to QObject 49 * @param name Name will be passed on to QObject
50 * @param fl Additional window flags passed to QFrame. see @Qt::WFlags 50 * @param fl Additional window flags passed to QFrame. see @Qt::WFlags
51 */ 51 */
52OWidgetStack::OWidgetStack( QWidget* parent, const char* name, WFlags fl) 52OWidgetStack::OWidgetStack( QWidget* parent, const char* name, WFlags fl)
53 : QFrame( parent, name, fl ) 53 : QFrame( parent, name, fl )
54{ 54{
55 m_last = m_mWidget = 0; 55 m_last = m_mWidget = 0;
56 m_forced = false; 56 m_forced = false;
57 57
58 QApplication::desktop()->installEventFilter( this ); 58 QApplication::desktop()->installEventFilter( this );
59 setFontPropagation ( AllChildren ); 59 setFontPropagation ( AllChildren );
60 setPalettePropagation( AllChildren ); 60 setPalettePropagation( AllChildren );
61 61
62 /* sets m_mode and initializes more */ 62 /* sets m_mode and initializes more */
63 /* if you change this call change switchTop as well */ 63 /* if you change this call change switchTop as well */
@@ -412,24 +412,27 @@ void OWidgetStack::switchTop() {
412 /* this works because it is guaranteed that switchStack was called at least once*/ 412 /* this works because it is guaranteed that switchStack was called at least once*/
413 if (!m_stack && m_mWidget) { 413 if (!m_stack && m_mWidget) {
414 m_mWidget->setGeometry( frameRect() ); 414 m_mWidget->setGeometry( frameRect() );
415 return; 415 return;
416 }else if (!m_stack) 416 }else if (!m_stack)
417 return; 417 return;
418 418
419 if (!m_list.isEmpty() ) { 419 if (!m_list.isEmpty() ) {
420 QMap<int, QWidget*>::Iterator it = m_list.begin(); 420 QMap<int, QWidget*>::Iterator it = m_list.begin();
421 for ( ; it != m_list.end(); ++it ) { 421 for ( ; it != m_list.end(); ++it ) {
422 /* better than reparenting twice */ 422 /* better than reparenting twice */
423 if ( it.data() == m_mWidget ) { 423 if ( it.data() == m_mWidget ) {
424 m_mWidget->reparent(this, 0, frameRect().topLeft() ); 424 m_mWidget->reparent(this, 0, frameRect().topLeft() );
425 m_mWidget->setGeometry( frameRect() ); 425 m_mWidget->setGeometry( frameRect() );
426 m_mWidget->show(); 426 m_mWidget->show();
427 }else 427 }else
428 /* ### FIXME we need to place the widget better */ 428 /* ### FIXME we need to place the widget better */
429 it.data()->reparent(0, WType_TopLevel, QPoint(10, 10) ); 429 it.data()->reparent(0, WType_TopLevel, QPoint(10, 10) );
430 } 430 }
431 } 431 }
432 432
433 delete m_stack; 433 delete m_stack;
434 m_stack = 0; 434 m_stack = 0;
435} 435}
436
437}
438} \ No newline at end of file