Diffstat (limited to 'core/pim/today/todaybase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/todaybase.cpp | 190 |
1 files changed, 43 insertions, 147 deletions
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index bc1651d..74f4fa0 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -1,10 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * todaybase.cpp * | 2 | * todaybase.cpp |
3 | * --------------------- | ||
4 | * | 3 | * |
5 | * begin : Sun 10 17:20:00 CEST 2002 | ||
6 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002 by Maximilian Reiß |
7 | * email : max.reiss@gmx.de | 5 | * email : harlekin@handhelds.org |
8 | * | 6 | * |
9 | */ | 7 | */ |
10 | /*************************************************************************** | 8 | /*************************************************************************** |
@@ -20,56 +18,35 @@ | |||
20 | 18 | ||
21 | #include <qframe.h> | 19 | #include <qframe.h> |
22 | #include <qlabel.h> | 20 | #include <qlabel.h> |
23 | #include <qpushbutton.h> | ||
24 | #include <qlayout.h> | ||
25 | #include <qvariant.h> | ||
26 | #include <qwhatsthis.h> | ||
27 | #include <qimage.h> | 21 | #include <qimage.h> |
28 | #include <qpixmap.h> | 22 | #include <qpixmap.h> |
29 | #include <qscrollview.h> | ||
30 | #include <qvbox.h> | ||
31 | #include <qapplication.h> | 23 | #include <qapplication.h> |
32 | 24 | ||
33 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
34 | 26 | ||
35 | /* | 27 | |
36 | * Constructs a TodayBase which is a child of 'parent', with the | ||
37 | * name 'name' and widget flags set to 'f' | ||
38 | */ | ||
39 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | 28 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) |
40 | : QWidget( parent, name, fl ) | 29 | : QWidget( parent, name, fl ) { |
41 | { | 30 | |
42 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo | 31 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo |
43 | QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook | ||
44 | QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo | ||
45 | QPixmap config = Resource::loadPixmap( "today/config" ); // config icon | ||
46 | QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon | ||
47 | QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla | 32 | QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla |
33 | QPixmap config = Resource::loadPixmap( "today/config" ); // config icon | ||
48 | 34 | ||
49 | QWidget *d = QApplication::desktop(); | 35 | layout = new QVBoxLayout( this ); |
50 | int w=d->width(); | ||
51 | int h=d->height(); | ||
52 | resize( w , h ); | ||
53 | |||
54 | // hehe, qt is ... | ||
55 | getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" ); | ||
56 | getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); | ||
57 | |||
58 | QVBoxLayout * layout = new QVBoxLayout(this); | ||
59 | 36 | ||
60 | QPalette pal = this->palette(); | 37 | QPalette pal = this->palette(); |
61 | QColor col = pal.color(QPalette::Active, QColorGroup::Background); | 38 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); |
62 | pal.setColor(QPalette::Active, QColorGroup::Button, col); | 39 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); |
63 | pal.setColor(QPalette::Inactive, QColorGroup::Button, col); | 40 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); |
64 | pal.setColor(QPalette::Normal, QColorGroup::Button, col); | 41 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); |
65 | pal.setColor(QPalette::Disabled, QColorGroup::Button, col); | 42 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); |
66 | this->setPalette(pal); | 43 | this->setPalette( pal ); |
67 | 44 | ||
68 | // --- logo Section --- | 45 | // --- logo Section --- |
69 | QPalette pal2; | 46 | QPalette pal2; |
70 | QColorGroup cg; | 47 | QColorGroup cg; |
71 | cg.setColor( QColorGroup::Text, white ); | 48 | cg.setColor( QColorGroup::Text, white ); |
72 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); | 49 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); |
73 | pal2.setActive( cg ); | 50 | pal2.setActive( cg ); |
74 | // today logo | 51 | // today logo |
75 | Frame = new QLabel( this, "Frame" ); | 52 | Frame = new QLabel( this, "Frame" ); |
@@ -77,135 +54,54 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
77 | Frame->setFrameShape( QFrame::StyledPanel ); | 54 | Frame->setFrameShape( QFrame::StyledPanel ); |
78 | Frame->setFrameShadow( QFrame::Raised ); | 55 | Frame->setFrameShadow( QFrame::Raised ); |
79 | Frame->setLineWidth( 0 ); | 56 | Frame->setLineWidth( 0 ); |
80 | Frame->setMaximumHeight(50); | 57 | Frame->setMaximumHeight( 50 ); |
81 | Frame->setMinimumHeight(50); | 58 | Frame->setMinimumHeight( 50 ); |
82 | 59 | ||
83 | // Today text | 60 | // Today text |
84 | QLabel* TodayLabel = new QLabel( Frame, "TodayText" ); | 61 | QLabel* TodayLabel = new QLabel( Frame, "TodayText" ); |
85 | TodayLabel->setGeometry( QRect( 10, 0, 168, 40 ) ); | 62 | TodayLabel->setGeometry( QRect( 10, 0, 168, 40 ) ); |
86 | QFont TodayLabel_font( TodayLabel->font() ); | 63 | QFont TodayLabel_font( TodayLabel->font() ); |
87 | TodayLabel_font.setBold( TRUE ); | 64 | TodayLabel_font.setBold( TRUE ); |
88 | TodayLabel_font.setPointSize(40); | 65 | TodayLabel_font.setPointSize( 40 ); |
89 | TodayLabel->setFont( TodayLabel_font ); | 66 | TodayLabel->setFont( TodayLabel_font ); |
90 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 67 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
91 | TodayLabel->setText("<font color=#FFFFFF>" + tr("Today") +"</font>"); | 68 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today²") +"</font>" ); |
69 | |||
70 | // date | ||
71 | DateLabel = new QLabel( Frame, "TextLabel1" ); | ||
72 | DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) ); | ||
73 | QFont DateLabel_font( DateLabel->font() ); | ||
74 | DateLabel_font.setBold( TRUE ); | ||
75 | DateLabel->setFont( DateLabel_font ); | ||
76 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | ||
77 | DateLabel->setTextFormat( RichText ); | ||
92 | 78 | ||
93 | // Opiezilla | 79 | // Opiezilla |
94 | QLabel* Opiezilla = new QLabel( Frame, "OpieZilla"); | 80 | QLabel* Opiezilla = new QLabel( Frame, "OpieZilla"); |
95 | Opiezilla->setPixmap( opiezilla ); | 81 | Opiezilla->setPixmap( opiezilla ); |
96 | Opiezilla->setGeometry( this->width()-50 ,1, 45, 47); | 82 | Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47); |
97 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); | 83 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); |
98 | 84 | ||
99 | // date | 85 | // Ownerfield |
100 | TextLabel1 = new QLabel( Frame, "TextLabel1" ); | 86 | OwnerField = new OClickableLabel( this , "Owner" ); |
101 | TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); | 87 | OwnerField->setGeometry( QRect( 0,0, this->width(), 12 )); |
102 | QFont TextLabel1_font( TextLabel1->font() ); | 88 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); |
103 | TextLabel1_font.setBold( TRUE ); | ||
104 | TextLabel1->setFont( TextLabel1_font ); | ||
105 | TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); | ||
106 | TextLabel1->setTextFormat( RichText ); | ||
107 | |||
108 | OwnerField = new OClickableLabel(this , "Owner" ); | ||
109 | OwnerField->setGeometry(QRect(0,0, this->width(), 12 )); | ||
110 | OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
111 | OwnerField->setMaximumHeight(12); | 89 | OwnerField->setMaximumHeight(12); |
112 | 90 | ||
113 | // --- dates section --- | 91 | // config |
114 | Frame4 = new QFrame( this, "Frame4" ); | 92 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); |
115 | // Frame4->setPalette( pal ); | 93 | ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 30, 25, 21 ) ); |
116 | Frame4->setFrameShape( QScrollView::StyledPanel ); | 94 | ConfigButton->setPixmap( config ); |
117 | Frame4->setFrameShadow( QScrollView::Sunken ); | 95 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); |
118 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); | ||
119 | Frame4->setFrameStyle( QFrame::NoFrame ); | ||
120 | Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) ); | ||
121 | |||
122 | sv1 = new QScrollView( Frame4 ); | ||
123 | sv1->setResizePolicy(QScrollView::AutoOneFit); | ||
124 | sv1->setHScrollBarMode( QScrollView::AlwaysOff ); | ||
125 | // need to find a better way!!! | ||
126 | sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); | ||
127 | sv1->setFrameShape(QFrame::NoFrame); | ||
128 | |||
129 | DatesButton = new QPushButton (Frame4, "DatesButton" ); | ||
130 | DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); | ||
131 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | ||
132 | DatesButton->setPalette( pal ); | ||
133 | DatesButton->setPixmap( datebook ); | ||
134 | DatesButton->setFlat( TRUE ); | ||
135 | |||
136 | // --- mail section ---) | ||
137 | MailFrame = new QFrame( this ,"MailFrame" ); | ||
138 | MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); | ||
139 | MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); | ||
140 | MailFrame->setFrameStyle( QFrame::NoFrame ); | ||
141 | |||
142 | QFrame* Line1 = new QFrame( MailFrame); | ||
143 | Line1->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); | ||
144 | Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken ); | ||
145 | |||
146 | MailButton = new QPushButton (MailFrame, "MailButton" ); | ||
147 | MailButton->setGeometry( QRect( 2, 3, 36, 19 ) ); | ||
148 | MailButton->setPalette( pal ); | ||
149 | MailButton->setPixmap( mail ); | ||
150 | MailButton->setFlat( TRUE ); | ||
151 | |||
152 | MailField = new QLabel( MailFrame, "MailField" ); | ||
153 | MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) ); | ||
154 | MailField->setText( tr( "Opiemail not installed" ) ); | ||
155 | MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
156 | MailField->setMaximumHeight(40); | ||
157 | MailField->setMinimumHeight(15); | ||
158 | |||
159 | // --- todo section -- | ||
160 | Frame15 = new QFrame( this, "Frame15" ); | ||
161 | Frame15->setFrameStyle( QFrame::NoFrame ); | ||
162 | Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); | ||
163 | |||
164 | QFrame* Line2 = new QFrame( Frame15); | ||
165 | Line2->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); | ||
166 | Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken ); | ||
167 | |||
168 | TodoButton = new QPushButton (Frame15, "TodoButton" ); | ||
169 | TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); | ||
170 | TodoButton->setPalette( pal ); | ||
171 | TodoButton->setPixmap( todo ); | ||
172 | TodoButton->setFlat( TRUE ); | ||
173 | |||
174 | QScrollView* sv2 = new QScrollView( Frame15 ); | ||
175 | sv2->setResizePolicy(QScrollView::AutoOneFit); | ||
176 | sv2->setHScrollBarMode( QScrollView::AlwaysOff ); | ||
177 | sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) ); | ||
178 | sv2->setFrameShape(QFrame::NoFrame); | ||
179 | |||
180 | TodoField = new QLabel( sv2->viewport(), "TodoField" ); | ||
181 | sv2->addChild(TodoField); | ||
182 | TodoField->setFrameShadow( QLabel::Plain ); | ||
183 | //TodoField->setText( tr( "No current todos" ) ); | ||
184 | TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
185 | |||
186 | PushButton1 = new QPushButton (Frame15, "PushButton1" ); | ||
187 | PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) ); | ||
188 | PushButton1->setPixmap( config ); | ||
189 | PushButton1->setPalette( pal ); | ||
190 | PushButton1->setAutoDefault( TRUE ); | ||
191 | PushButton1->setFlat( TRUE ); | ||
192 | 96 | ||
193 | // -- layout -- | 97 | // -- layout -- |
194 | layout->addWidget(Frame); | 98 | layout->addWidget( Frame ); |
195 | layout->addWidget(OwnerField); | 99 | layout->addWidget( OwnerField ); |
196 | layout->addWidget(Frame4); | ||
197 | layout->addWidget(MailFrame); | ||
198 | layout->addWidget(Frame15); | ||
199 | |||
200 | layout->setStretchFactor(Frame4,5); | ||
201 | layout->setStretchFactor(MailFrame,1); | ||
202 | layout->setStretchFactor(Frame15,4); | ||
203 | } | 100 | } |
204 | 101 | ||
205 | /* | 102 | /** |
206 | * Destroys the object and frees any allocated resources | 103 | * D' tor |
207 | */ | 104 | */ |
208 | TodayBase::~TodayBase() | 105 | TodayBase::~TodayBase() { |
209 | { | ||
210 | } | 106 | } |
211 | 107 | ||