summaryrefslogtreecommitdiff
path: root/libopie2/opieui/big-screen/olayout.cpp
Unidiff
Diffstat (limited to 'libopie2/opieui/big-screen/olayout.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/olayout.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/libopie2/opieui/big-screen/olayout.cpp b/libopie2/opieui/big-screen/olayout.cpp
new file mode 100644
index 0000000..bbe6f6c
--- a/dev/null
+++ b/libopie2/opieui/big-screen/olayout.cpp
@@ -0,0 +1,83 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; version 2 of the License.
10     ._= =}       :
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "olayout.h"
30
31/* OPIE */
32#include <opie2/odebug.h>
33
34/* QT */
35#include <qapplication.h>
36
37namespace Opie {
38namespace Ui {
39
40OAutoBoxLayout::OAutoBoxLayout( QWidget *parent, int border, int space, const char *name )
41 :QBoxLayout( parent, LeftToRight, border, space, name )
42{
43 fixDirection();
44}
45
46
47OAutoBoxLayout::OAutoBoxLayout( QLayout *parentLayout, int space, const char *name )
48 :QBoxLayout( parentLayout, LeftToRight, space, name )
49{
50 fixDirection();
51}
52
53
54OAutoBoxLayout::OAutoBoxLayout( int space, const char *name )
55 :QBoxLayout( LeftToRight, space, name )
56{
57 fixDirection();
58}
59
60
61void OAutoBoxLayout::fixDirection()
62{
63 QWidget* desktop = QApplication::desktop();
64 int w = desktop->width();
65 int h = desktop->height();
66 if ( h > w )
67 {
68 odebug << "OAutoBoxLayout: h > w, setting orientation to TopToBottom" << oendl;
69 setDirection( TopToBottom );
70 }
71}
72
73
74OAutoBoxLayout::~OAutoBoxLayout()
75{
76}
77
78
79}; // namespace Ui
80}; // namespace Opie
81
82
83