author | harlekin <harlekin> | 2002-02-21 16:16:13 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-02-21 16:16:13 (UTC) |
commit | 4c965fa187f642cb3db4cd32d70a68cfa8c41022 (patch) (unidiff) | |
tree | f1f65a4b0b332b838fef9f0fda95c92dfc93247e | |
parent | 17e96f64d6b66fac5f0e206492149d461e2ad900 (diff) | |
download | opie-4c965fa187f642cb3db4cd32d70a68cfa8c41022.zip opie-4c965fa187f642cb3db4cd32d70a68cfa8c41022.tar.gz opie-4c965fa187f642cb3db4cd32d70a68cfa8c41022.tar.bz2 |
added scrollbars to dates and todo
-rw-r--r-- | core/pim/today/today.cpp | 6 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 165 |
2 files changed, 103 insertions, 68 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index bed3a74..9e5c27e 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -152,3 +152,2 @@ void Today::startConfig() | |||
152 | 152 | ||
153 | |||
154 | /* | 153 | /* |
@@ -178,7 +177,5 @@ void Today::getDates() | |||
178 | { | 177 | { |
179 | //only get events past current time (start or end??) | ||
180 | //cout << time.toString() << endl; | 178 | //cout << time.toString() << endl; |
181 | //cout << TimeString::dateString((*it).event().end()) << endl; | 179 | //cout << TimeString::dateString((*it).event().end()) << endl; |
182 | // still some bug in here, 1 h off | 180 | |
183 | |||
184 | // decide if to get all day or only later appointments | 181 | // decide if to get all day or only later appointments |
@@ -197,2 +194,3 @@ void Today::getDates() | |||
197 | msg += "<BR>" | 194 | msg += "<BR>" |
195 | |||
198 | // start time of event | 196 | // start time of event |
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index 32b45f7..ff6001a 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -31,2 +31,3 @@ | |||
31 | #include <qvbox.h> | 31 | #include <qvbox.h> |
32 | #include <qapplication.h> | ||
32 | 33 | ||
@@ -41,20 +42,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
41 | { | 42 | { |
42 | // logo | 43 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo |
43 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); | 44 | QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook |
44 | // datebook | 45 | QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo |
45 | QPixmap datebook = Resource::loadPixmap("DateBook"); | 46 | QPixmap config = Resource::loadPixmap( "today/config" ); // config icon |
46 | // todo | 47 | QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon |
47 | QPixmap todo = Resource::loadPixmap( "TodoList" ); | ||
48 | // config icon | ||
49 | QPixmap config = Resource::loadPixmap( "today/config" ); | ||
50 | // mail icon | ||
51 | QPixmap mail = Resource::loadPixmap( "today/mail" ); | ||
52 | |||
53 | |||
54 | QPalette pal2; | ||
55 | QColorGroup cg; | ||
56 | cg.setColor( QColorGroup::Text, white ); | ||
57 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); | ||
58 | pal2.setActive( cg ); | ||
59 | |||
60 | 48 | ||
@@ -65,26 +53,23 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
65 | 53 | ||
66 | QVBoxLayout * layout = new QVBoxLayout(this); | 54 | QWidget *d = QApplication::desktop(); |
55 | int w=d->width(); | ||
56 | int h=d->height(); | ||
57 | resize( w , h ); // not good, what happens on rotation | ||
67 | 58 | ||
68 | Frame4 = new QFrame( this, "Frame4" ); | ||
69 | Frame4->setPalette( pal ); | ||
70 | Frame4->setFrameShape( QScrollView::StyledPanel ); | ||
71 | Frame4->setFrameShadow( QScrollView::Sunken ); | ||
72 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); | ||
73 | |||
74 | // hehe, qt is ... | 59 | // hehe, qt is ... |
75 | getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); | 60 | getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" ); |
76 | getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); | 61 | getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); |
77 | 62 | ||
78 | DatesButton = new QPushButton (Frame4, "DatesButton" ); | ||
79 | DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); | ||
80 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | ||
81 | DatesButton->setPalette( pal ); | ||
82 | DatesButton->setPixmap( datebook ); | ||
83 | DatesButton->setFlat( TRUE ); | ||
84 | 63 | ||
85 | DatesField = new QLabel( Frame4, "DatesField" ); | ||
86 | DatesField->setGeometry( QRect( 40, 4, 203, 120 ) ); | ||
87 | DatesField->setText( tr( "No appointments today" ) ); | ||
88 | DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
89 | 64 | ||
65 | QVBoxLayout * layout = new QVBoxLayout(this); | ||
66 | |||
67 | |||
68 | |||
69 | // --- logo Section --- | ||
70 | QPalette pal2; | ||
71 | QColorGroup cg; | ||
72 | cg.setColor( QColorGroup::Text, white ); | ||
73 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); | ||
74 | pal2.setActive( cg ); | ||
90 | // today logo | 75 | // today logo |
@@ -97,3 +82,2 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
97 | Frame->setMinimumHeight(50); | 82 | Frame->setMinimumHeight(50); |
98 | |||
99 | // date | 83 | // date |
@@ -106,32 +90,46 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
106 | TextLabel1->setTextFormat( RichText ); | 90 | TextLabel1->setTextFormat( RichText ); |
107 | 91 | ||
108 | // todo | 92 | |
109 | Frame15 = new QFrame( this, "Frame15" ); | 93 | // --- dates section --- |
110 | Frame15->setFrameShape( QFrame::StyledPanel ); | 94 | Frame4 = new QFrame( this, "Frame4" ); |
111 | Frame15->setFrameShadow( QFrame::Sunken ); | 95 | Frame4->setPalette( pal ); |
96 | Frame4->setFrameShape( QScrollView::StyledPanel ); | ||
97 | Frame4->setFrameShadow( QScrollView::Sunken ); | ||
98 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); | ||
99 | Frame4->setFrameStyle( QFrame::NoFrame ); | ||
100 | Frame4->setGeometry (QRect( 0, 0, this->width() , this->height()) ); | ||
112 | 101 | ||
113 | TodoButton = new QPushButton (Frame15, "TodoButton" ); | 102 | QScrollView* sv1 = new QScrollView( Frame4 ); |
114 | TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); | 103 | sv1->setResizePolicy(QScrollView::AutoOneFit); |
115 | TodoButton->setPalette( pal ); | 104 | sv1->setHScrollBarMode( QScrollView::AlwaysOff ); |
116 | TodoButton->setPixmap( todo ); | 105 | // need to find a better way!!! |
117 | TodoButton->setFlat( TRUE ); | 106 | sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); |
107 | sv1->setFrameShape(QFrame::NoFrame); | ||
108 | |||
109 | DatesButton = new QPushButton (Frame4, "DatesButton" ); | ||
110 | DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); | ||
111 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | ||
112 | DatesButton->setPalette( pal ); | ||
113 | DatesButton->setPixmap( datebook ); | ||
114 | DatesButton->setFlat( TRUE ); | ||
118 | 115 | ||
119 | TodoField = new QLabel( Frame15, "TodoField" ); | 116 | DatesField = new QLabel( sv1->viewport(), "DatesField" ); |
120 | TodoField->setGeometry( QRect( 40, 4, 196, 120 ) ); | 117 | sv1->addChild(DatesField); |
121 | TodoField->setFrameShadow( QLabel::Plain ); | 118 | DatesField->setText( tr( "No appointments today" ) ); |
122 | TodoField->setText( tr( "No current todos" ) ); | 119 | DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); |
123 | TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
124 | 120 | ||
125 | PushButton1 = new QPushButton (Frame15, "PushButton1" ); | ||
126 | PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) ); | ||
127 | PushButton1->setPixmap( config ); | ||
128 | PushButton1->setPalette( pal ); | ||
129 | PushButton1->setAutoDefault( TRUE ); | ||
130 | PushButton1->setFlat( TRUE ); | ||
131 | 121 | ||
132 | 122 | // --- mail section --- | |
133 | MailFrame = new QFrame( this ,"MailFrame" ); | 123 | MailFrame = new QFrame( this ,"MailFrame" ); |
134 | MailFrame->setFrameShape( QScrollView::StyledPanel ); | 124 | //MailFrame->setPalette( pal ); |
135 | MailFrame->setFrameShadow( QScrollView::Sunken ); | 125 | MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); |
126 | //MailFrame->setFrameShape( QScrollView::StyledPanel ); | ||
127 | //MailFrame->setFrameShadow( QScrollView::Sunken ); | ||
128 | MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); | ||
129 | MailFrame->setFrameStyle( QFrame::NoFrame ); | ||
136 | 130 | ||
131 | QFrame* Line1 = new QFrame( MailFrame); | ||
132 | Line1->setGeometry( QRect( 0, 0, MailFrame->width(), 5 ) ); | ||
133 | Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken ); | ||
134 | |||
137 | MailButton = new QPushButton (MailFrame, "MailButton" ); | 135 | MailButton = new QPushButton (MailFrame, "MailButton" ); |
@@ -142,4 +140,4 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
142 | 140 | ||
143 | MailField = new QLabel( MailFrame, "DatesField" ); | 141 | MailField = new QLabel( MailFrame, "MailField" ); |
144 | MailField->setGeometry( QRect( 40, 4, 203, 120 ) ); | 142 | MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) ); |
145 | MailField->setText( tr( "Opiemail not installed" ) ); | 143 | MailField->setText( tr( "Opiemail not installed" ) ); |
@@ -147,4 +145,43 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
147 | MailField->setMaximumHeight(40); | 145 | MailField->setMaximumHeight(40); |
148 | MailField->setMinimumHeight(30); | 146 | MailField->setMinimumHeight(15); |
147 | |||
148 | |||
149 | // --- todo section -- | ||
150 | Frame15 = new QFrame( this, "Frame15" ); | ||
151 | //Frame15->setFrameShape( QFrame::StyledPanel ); | ||
152 | //Frame15->setFrameShadow( QFrame::Sunken ); | ||
153 | Frame15->setFrameStyle( QFrame::NoFrame ); | ||
154 | Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); | ||
155 | |||
156 | QFrame* Line2 = new QFrame( Frame15); | ||
157 | Line2->setGeometry( QRect( 0, 0, MailFrame->width(), 5 ) ); | ||
158 | Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken ); | ||
159 | |||
160 | TodoButton = new QPushButton (Frame15, "TodoButton" ); | ||
161 | TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); | ||
162 | TodoButton->setPalette( pal ); | ||
163 | TodoButton->setPixmap( todo ); | ||
164 | TodoButton->setFlat( TRUE ); | ||
165 | |||
166 | QScrollView* sv2 = new QScrollView( Frame15 ); | ||
167 | sv2->setResizePolicy(QScrollView::AutoOneFit); | ||
168 | sv2->setHScrollBarMode( QScrollView::AlwaysOff ); | ||
169 | sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) ); | ||
170 | sv2->setFrameShape(QFrame::NoFrame); | ||
171 | |||
172 | TodoField = new QLabel( sv2->viewport(), "TodoField" ); | ||
173 | sv2->addChild(TodoField); | ||
174 | //TodoField->setGeometry( QRect( 40, 4, 196, 120 ) ); | ||
175 | TodoField->setFrameShadow( QLabel::Plain ); | ||
176 | //TodoField->setText( tr( "No current todos" ) ); | ||
177 | TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
178 | |||
179 | PushButton1 = new QPushButton (Frame15, "PushButton1" ); | ||
180 | PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) ); | ||
181 | PushButton1->setPixmap( config ); | ||
182 | PushButton1->setPalette( pal ); | ||
183 | PushButton1->setAutoDefault( TRUE ); | ||
184 | PushButton1->setFlat( TRUE ); | ||
149 | 185 | ||
186 | // -- layout -- | ||
150 | layout->addWidget(Frame); | 187 | layout->addWidget(Frame); |