summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-04-08 19:58:35 (UTC)
committer harlekin <harlekin>2002-04-08 19:58:35 (UTC)
commit9dd42008cd6dea68520c58a569874a7cc8230eb0 (patch) (unidiff)
treed12285c8f697b85c59740d3a6f4c89cd2b86798d
parentd30a329f104fd7abb20521c8abfe389d9cd76c99 (diff)
downloadopie-9dd42008cd6dea68520c58a569874a7cc8230eb0.zip
opie-9dd42008cd6dea68520c58a569874a7cc8230eb0.tar.gz
opie-9dd42008cd6dea68520c58a569874a7cc8230eb0.tar.bz2
updated buttons
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/changelog1
-rw-r--r--core/pim/today/todaybase.cpp51
2 files changed, 28 insertions, 24 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index 2270551..b3da1fb 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1,26 +1,27 @@
10.3.1 10.3.1
2 2
3* fixed the wrong color of the buttons
3* better translation (thanks carsten and others) 4* better translation (thanks carsten and others)
4* fixes memory leaks 5* fixes memory leaks
5* bugfixes in calendar part, now location and note are working again. 6* bugfixes in calendar part, now location and note are working again.
6 7
70.3.0 80.3.0
8 9
9* today uses now tododb from libopie. So major changes in the todo part: 10* today uses now tododb from libopie. So major changes in the todo part:
10 - overdue items on top 11 - overdue items on top
11 - then sorted by date, then by priority 12 - then sorted by date, then by priority
12* some cleanups 13* some cleanups
13* speed optimisations 14* speed optimisations
14 15
150.2.9 160.2.9
16 17
17* Many bugfixes. 18* Many bugfixes.
18* Today now apparently sorts the dates _allways_ right, i would assume it 19* Today now apparently sorts the dates _allways_ right, i would assume it
19to be a qt bug 20to be a qt bug
20 21
210.2.8 220.2.8
22 23
23* Appointments are now clickable (connection to datebook still missing) 24* Appointments are now clickable (connection to datebook still missing)
24* autostart support (opie only) 25* autostart support (opie only)
25 26
260.2.7 270.2.7
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index dfcc34e..755c860 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -11,181 +11,184 @@
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 */
39TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 39TodayBase::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 47
48 QPalette pal = this->palette(); 48 QPalette pal = this->palette();
49 QColor col = pal.color(QPalette::Active, QColorGroup::Background); 49 QColor col = pal.color(QPalette::Active, QColorGroup::Background);
50 pal.setColor(QPalette::Active, QColorGroup::Button, col); 50 pal.setColor(QPalette::Active, QColorGroup::Button, col);
51 pal.setColor(QPalette::Inactive, QColorGroup::Button, col);
52 pal.setColor(QPalette::Normal, QColorGroup::Button, col);
53 pal.setColor(QPalette::Disabled, QColorGroup::Button, col);
51 this->setPalette(pal); 54 this->setPalette(pal);
52 55
53 56
54 QWidget *d = QApplication::desktop(); 57 QWidget *d = QApplication::desktop();
55 int w=d->width(); 58 int w=d->width();
56 int h=d->height(); 59 int h=d->height();
57 resize( w , h ); 60 resize( w , h );
58 61
59 // hehe, qt is ... 62 // hehe, qt is ...
60 getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" ); 63 getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" );
61 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); 64 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) );
62 65
63 QVBoxLayout * layout = new QVBoxLayout(this); 66 QVBoxLayout * layout = new QVBoxLayout(this);
64 67
65 // --- logo Section --- 68 // --- logo Section ---
66 QPalette pal2; 69 QPalette pal2;
67 QColorGroup cg; 70 QColorGroup cg;
68 cg.setColor( QColorGroup::Text, white ); 71 cg.setColor( QColorGroup::Text, white );
69 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); 72 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) );
70 pal2.setActive( cg ); 73 pal2.setActive( cg );
71 // today logo 74 // today logo
72 Frame = new QLabel( this, "Frame" ); 75 Frame = new QLabel( this, "Frame" );
73 Frame->setPalette( pal2 ); 76 Frame->setPalette( pal2 );
74 Frame->setFrameShape( QFrame::StyledPanel ); 77 Frame->setFrameShape( QFrame::StyledPanel );
75 Frame->setFrameShadow( QFrame::Raised ); 78 Frame->setFrameShadow( QFrame::Raised );
76 Frame->setLineWidth( 0 ); 79 Frame->setLineWidth( 0 );
77 Frame->setMaximumHeight(50); 80 Frame->setMaximumHeight(50);
78 Frame->setMinimumHeight(50); 81 Frame->setMinimumHeight(50);
79 // date 82 // date
80 TextLabel1 = new QLabel( Frame, "TextLabel1" ); 83 TextLabel1 = new QLabel( Frame, "TextLabel1" );
81 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); 84 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) );
82 QFont TextLabel1_font( TextLabel1->font() ); 85 QFont TextLabel1_font( TextLabel1->font() );
83 TextLabel1_font.setBold( TRUE ); 86 TextLabel1_font.setBold( TRUE );
84 TextLabel1->setFont( TextLabel1_font ); 87 TextLabel1->setFont( TextLabel1_font );
85 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); 88 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin );
86 TextLabel1->setTextFormat( RichText ); 89 TextLabel1->setTextFormat( RichText );
87 90
88 OwnerField = new QLabel(this , "Owner" ); 91 OwnerField = new QLabel(this , "Owner" );
89 OwnerField->setGeometry(QRect(0,0, this->width(), 12 )); 92 OwnerField->setGeometry(QRect(0,0, this->width(), 12 ));
90 OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) ); 93 OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) );
91 OwnerField->setMaximumHeight(12); 94 OwnerField->setMaximumHeight(12);
92 95
93 // --- dates section --- 96 // --- dates section ---
94 Frame4 = new QFrame( this, "Frame4" ); 97 Frame4 = new QFrame( this, "Frame4" );
95 Frame4->setPalette( pal ); 98 Frame4->setPalette( pal );
96 Frame4->setFrameShape( QScrollView::StyledPanel ); 99 Frame4->setFrameShape( QScrollView::StyledPanel );
97 Frame4->setFrameShadow( QScrollView::Sunken ); 100 Frame4->setFrameShadow( QScrollView::Sunken );
98 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); 101 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin );
99 Frame4->setFrameStyle( QFrame::NoFrame ); 102 Frame4->setFrameStyle( QFrame::NoFrame );
100 Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) ); 103 Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) );
101 104
102 sv1 = new QScrollView( Frame4 ); 105 sv1 = new QScrollView( Frame4 );
103 sv1->setResizePolicy(QScrollView::AutoOneFit); 106 sv1->setResizePolicy(QScrollView::AutoOneFit);
104 sv1->setHScrollBarMode( QScrollView::AlwaysOff ); 107 sv1->setHScrollBarMode( QScrollView::AlwaysOff );
105 // need to find a better way!!! 108 // need to find a better way!!!
106 sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); 109 sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) );
107 sv1->setFrameShape(QFrame::NoFrame); 110 sv1->setFrameShape(QFrame::NoFrame);
108 111
109 DatesButton = new QPushButton (Frame4, "DatesButton" ); 112 DatesButton = new QPushButton (Frame4, "DatesButton" );
110 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 113 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) );
111 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 114 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
112 DatesButton->setPalette( pal ); 115 DatesButton->setPalette( pal );
113 DatesButton->setPixmap( datebook ); 116 DatesButton->setPixmap( datebook );
114 DatesButton->setFlat( TRUE ); 117 DatesButton->setFlat( TRUE );
115 118
116 // --- mail section ---) 119 // --- mail section ---)
117 MailFrame = new QFrame( this ,"MailFrame" ); 120 MailFrame = new QFrame( this ,"MailFrame" );
118 MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); 121 MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin );
119 MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); 122 MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) );
120 MailFrame->setFrameStyle( QFrame::NoFrame ); 123 MailFrame->setFrameStyle( QFrame::NoFrame );
121 124
122 QFrame* Line1 = new QFrame( MailFrame); 125 QFrame* Line1 = new QFrame( MailFrame);
123 Line1->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); 126 Line1->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) );
124 Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 127 Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken );
125 128
126 MailButton = new QPushButton (MailFrame, "MailButton" ); 129 MailButton = new QPushButton (MailFrame, "MailButton" );
127 MailButton->setGeometry( QRect( 2, 3, 36, 19 ) ); 130 MailButton->setGeometry( QRect( 2, 3, 36, 19 ) );
128 MailButton->setPalette( pal ); 131 MailButton->setPalette( pal );
129 MailButton->setPixmap( mail ); 132 MailButton->setPixmap( mail );
130 MailButton->setFlat( TRUE ); 133 MailButton->setFlat( TRUE );
131 134
132 MailField = new QLabel( MailFrame, "MailField" ); 135 MailField = new QLabel( MailFrame, "MailField" );
133 MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) ); 136 MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) );
134 MailField->setText( tr( "Opiemail not installed" ) ); 137 MailField->setText( tr( "Opiemail not installed" ) );
135 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 138 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
136 MailField->setMaximumHeight(40); 139 MailField->setMaximumHeight(40);
137 MailField->setMinimumHeight(15); 140 MailField->setMinimumHeight(15);
138 141
139 // --- todo section -- 142 // --- todo section --
140 Frame15 = new QFrame( this, "Frame15" ); 143 Frame15 = new QFrame( this, "Frame15" );
141 Frame15->setFrameStyle( QFrame::NoFrame ); 144 Frame15->setFrameStyle( QFrame::NoFrame );
142 Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); 145 Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) );
143 146
144 QFrame* Line2 = new QFrame( Frame15); 147 QFrame* Line2 = new QFrame( Frame15);
145 Line2->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); 148 Line2->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) );
146 Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 149 Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken );
147 150
148 TodoButton = new QPushButton (Frame15, "TodoButton" ); 151 TodoButton = new QPushButton (Frame15, "TodoButton" );
149 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 152 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) );
150 TodoButton->setPalette( pal ); 153 TodoButton->setPalette( pal );
151 TodoButton->setPixmap( todo ); 154 TodoButton->setPixmap( todo );
152 TodoButton->setFlat( TRUE ); 155 TodoButton->setFlat( TRUE );
153 156
154 QScrollView* sv2 = new QScrollView( Frame15 ); 157 QScrollView* sv2 = new QScrollView( Frame15 );
155 sv2->setResizePolicy(QScrollView::AutoOneFit); 158 sv2->setResizePolicy(QScrollView::AutoOneFit);
156 sv2->setHScrollBarMode( QScrollView::AlwaysOff ); 159 sv2->setHScrollBarMode( QScrollView::AlwaysOff );
157 sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) ); 160 sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) );
158 sv2->setFrameShape(QFrame::NoFrame); 161 sv2->setFrameShape(QFrame::NoFrame);
159 162
160 TodoField = new QLabel( sv2->viewport(), "TodoField" ); 163 TodoField = new QLabel( sv2->viewport(), "TodoField" );
161 sv2->addChild(TodoField); 164 sv2->addChild(TodoField);
162 TodoField->setFrameShadow( QLabel::Plain ); 165 TodoField->setFrameShadow( QLabel::Plain );
163 //TodoField->setText( tr( "No current todos" ) ); 166 //TodoField->setText( tr( "No current todos" ) );
164 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 167 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
165 168
166 PushButton1 = new QPushButton (Frame15, "PushButton1" ); 169 PushButton1 = new QPushButton (Frame15, "PushButton1" );
167 PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) ); 170 PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) );
168 PushButton1->setPixmap( config ); 171 PushButton1->setPixmap( config );
169 PushButton1->setPalette( pal ); 172 PushButton1->setPalette( pal );
170 PushButton1->setAutoDefault( TRUE ); 173 PushButton1->setAutoDefault( TRUE );
171 PushButton1->setFlat( TRUE ); 174 PushButton1->setFlat( TRUE );
172 175
173 // -- layout -- 176 // -- layout --
174 layout->addWidget(Frame); 177 layout->addWidget(Frame);
175 layout->addWidget(OwnerField); 178 layout->addWidget(OwnerField);
176 layout->addWidget(Frame4); 179 layout->addWidget(Frame4);
177 layout->addWidget(MailFrame); 180 layout->addWidget(MailFrame);
178 layout->addWidget(Frame15); 181 layout->addWidget(Frame15);
179 182
180 layout->setStretchFactor(Frame4,5); 183 layout->setStretchFactor(Frame4,5);
181 layout->setStretchFactor(MailFrame,1); 184 layout->setStretchFactor(MailFrame,1);
182 layout->setStretchFactor(Frame15,4); 185 layout->setStretchFactor(Frame15,4);
183} 186}
184 187
185/* 188/*
186 * Destroys the object and frees any allocated resources 189 * Destroys the object and frees any allocated resources
187 */ 190 */
188TodayBase::~TodayBase() 191TodayBase::~TodayBase()
189{ 192{
190} 193}
191 194