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