summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/todaybase.cpp48
-rw-r--r--core/pim/today/todaybase.h2
2 files changed, 32 insertions, 18 deletions
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index 9331ee3..b0de1bf 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -1,163 +1,175 @@
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 <qtooltip.h> 26#include <qtooltip.h>
27#include <qwhatsthis.h> 27#include <qwhatsthis.h>
28#include <qimage.h> 28#include <qimage.h>
29#include <qpixmap.h> 29#include <qpixmap.h>
30//#include <qscrollview.h> 30//#include <qscrollview.h>
31 31
32#include <qpe/resource.h> 32#include <qpe/resource.h>
33 33
34/* 34/*
35 * Constructs a TodayBase which is a child of 'parent', with the 35 * Constructs a TodayBase which is a child of 'parent', with the
36 * name 'name' and widget flags set to 'f' 36 * name 'name' and widget flags set to 'f'
37 */ 37 */
38TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 38TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
39 : QWidget( parent, name, fl ) 39 : QWidget( parent, name, fl )
40{ 40{
41 // logo 41 // logo
42 QPixmap logo = Resource::loadPixmap( "today/today_logo"); 42 QPixmap logo = Resource::loadPixmap( "today/today_logo");
43 // datebook 43 // datebook
44 QPixmap datebook = Resource::loadPixmap("DateBook"); 44 QPixmap datebook = Resource::loadPixmap("DateBook");
45 // todo 45 // todo
46 QPixmap todo = Resource::loadPixmap( "TodoList" ); 46 QPixmap todo = Resource::loadPixmap( "TodoList" );
47 // config icon 47 // config icon
48 QPixmap config = Resource::loadPixmap( "today/config" ); 48 QPixmap config = Resource::loadPixmap( "today/config" );
49 // mail icon 49 // mail icon
50 QPixmap mail = Resource::loadPixmap( "today/mail" ); 50 QPixmap mail = Resource::loadPixmap( "today/mail" );
51 51
52 52
53 //if ( !name ) 53QPalette pal2;
54 // setName( "TodayBase" ); 54 QColorGroup cg;
55 //resize( 223, 307 ); 55 cg.setColor( QColorGroup::Text, white );
56 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) );
57 pal2.setActive( cg );
58
59
60QPalette pal = this->palette();
61QColor col = pal.color(QPalette::Active, QColorGroup::Background);
62pal.setColor(QPalette::Active, QColorGroup::Button, col);
63this->setPalette(pal);
56 64
57 QVBoxLayout * layout = new QVBoxLayout(this); 65 QVBoxLayout * layout = new QVBoxLayout(this);
58 66
67
59 Frame4 = new QFrame( this, "Frame4" ); 68 Frame4 = new QFrame( this, "Frame4" );
60 Frame4->setFrameShape( QScrollView::StyledPanel ); 69 Frame4->setFrameShape( QScrollView::StyledPanel );
61 Frame4->setFrameShadow( QScrollView::Sunken ); 70 Frame4->setFrameShadow( QScrollView::Sunken );
62 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); 71 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin );
63 72
64 // hehe, qt is ... 73 // hehe, qt is ...
65 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); 74 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" );
66 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); 75 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) );
67 76
68 DatesButton = new QPushButton (Frame4, "DatesButton" ); 77 DatesButton = new QPushButton (Frame4, "DatesButton" );
69 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 78 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) );
70 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 79 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
80 DatesButton->setPalette( pal );
71 DatesButton->setPixmap( datebook ); 81 DatesButton->setPixmap( datebook );
72 DatesButton->setFlat( TRUE ); 82 DatesButton->setFlat( TRUE );
73 83
74 DatesField = new QLabel( Frame4, "DatesField" ); 84 DatesField = new QLabel( Frame4, "DatesField" );
75 DatesField->setGeometry( QRect( 40, 4, 203, 120 ) ); 85 DatesField->setGeometry( QRect( 40, 4, 203, 120 ) );
76 DatesField->setText( tr( "No appointments today" ) ); 86 DatesField->setText( tr( "No appointments today" ) );
77 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 87 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
78 88
79 // today logo 89 // today logo
80 Frame = new QLabel( this, "Frame" ); 90 Frame = new QLabel( this, "Frame" );
81 QPalette pal; 91 Frame->setPalette( pal2 );
82 QColorGroup cg;
83 cg.setColor( QColorGroup::Text, white );
84 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) );
85 pal.setActive( cg );
86
87 Frame->setPalette( pal );
88 Frame->setFrameShape( QFrame::StyledPanel ); 92 Frame->setFrameShape( QFrame::StyledPanel );
89 Frame->setFrameShadow( QFrame::Raised ); 93 Frame->setFrameShadow( QFrame::Raised );
90 Frame->setLineWidth( 0 ); 94 Frame->setLineWidth( 0 );
91 Frame->setMaximumHeight(50); 95 Frame->setMaximumHeight(50);
92 Frame->setMinimumHeight(50); 96 Frame->setMinimumHeight(50);
97
93 // date 98 // date
94 TextLabel1 = new QLabel( Frame, "TextLabel1" ); 99 TextLabel1 = new QLabel( Frame, "TextLabel1" );
95 TextLabel1->setPalette( pal );
96 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); 100 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) );
97 QFont TextLabel1_font( TextLabel1->font() ); 101 QFont TextLabel1_font( TextLabel1->font() );
98 TextLabel1_font.setBold( TRUE ); 102 TextLabel1_font.setBold( TRUE );
99 TextLabel1->setFont( TextLabel1_font ); 103 TextLabel1->setFont( TextLabel1_font );
100 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); 104 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin );
101 TextLabel1->setTextFormat( QLabel::AutoText ); 105 TextLabel1->setTextFormat( QLabel::AutoText );
102 106
103 // todo 107 // todo
104 Frame15 = new QFrame( this, "Frame15" ); 108 Frame15 = new QFrame( this, "Frame15" );
105 Frame15->setFrameShape( QFrame::StyledPanel ); 109 Frame15->setFrameShape( QFrame::StyledPanel );
106 Frame15->setFrameShadow( QFrame::Sunken ); 110 Frame15->setFrameShadow( QFrame::Sunken );
107 111
108 TodoButton = new QPushButton (Frame15, "TodoButton" ); 112 TodoButton = new QPushButton (Frame15, "TodoButton" );
109 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 113 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) );
110 TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 114 //TodoButton->setBackgroundMode(NoBackground);
115 TodoButton->setPalette( pal );
116 //TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
111 TodoButton->setPixmap( todo ); 117 TodoButton->setPixmap( todo );
112 TodoButton->setFlat( TRUE ); 118 TodoButton->setFlat( TRUE );
113 119
114 TodoField = new QLabel( Frame15, "TodoField" ); 120 TodoField = new QLabel( Frame15, "TodoField" );
115 TodoField->setGeometry( QRect( 40, 4, 196, 120 ) ); 121 TodoField->setGeometry( QRect( 40, 4, 196, 120 ) );
116 TodoField->setFrameShadow( QLabel::Plain ); 122 TodoField->setFrameShadow( QLabel::Plain );
117 TodoField->setText( tr( "No current todos" ) ); 123 TodoField->setText( tr( "No current todos" ) );
118 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 124 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
119 125
120 PushButton1 = new QPushButton (Frame15, "PushButton1" ); 126 PushButton1 = new QPushButton (Frame15, "PushButton1" );
121 PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) ); 127 PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) );
122 PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin ); 128 //PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin );
123 PushButton1->setPixmap( config ); 129 PushButton1->setPixmap( config );
130 PushButton1->setPalette( pal );
124 PushButton1->setAutoDefault( TRUE ); 131 PushButton1->setAutoDefault( TRUE );
125 PushButton1->setFlat( TRUE ); 132 PushButton1->setFlat( TRUE );
126 133
127 // mail 134 // mail
128 MailFrame = new QFrame( this, "MailFrame" ); 135 MailFrame = new QFrame( this ,"MailFrame" );
129 MailFrame->setFrameShape( QScrollView::StyledPanel ); 136 MailFrame->setFrameShape( QScrollView::StyledPanel );
130 MailFrame->setFrameShadow( QScrollView::Sunken ); 137 MailFrame->setFrameShadow( QScrollView::Sunken );
131 MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); 138 //MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin );
132 139
133 MailButton = new QPushButton (MailFrame, "MailButton" ); 140 MailButton = new QPushButton (MailFrame, "MailButton" );
134 MailButton->setGeometry( QRect( 2, 10, 36, 19 ) ); 141 MailButton->setGeometry( QRect( 2, 10, 36, 19 ) );
135 MailButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 142 //MailButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
143 MailButton->setPalette( pal );
136 MailButton->setPixmap( mail ); 144 MailButton->setPixmap( mail );
137 MailButton->setFlat( TRUE ); 145 MailButton->setFlat( TRUE );
138 146
139 MailField = new QLabel( MailFrame, "DatesField" ); 147 MailField = new QLabel( MailFrame, "DatesField" );
140 MailField->setGeometry( QRect( 40, 10, 203, 120 ) ); 148 MailField->setGeometry( QRect( 40, 10, 203, 120 ) );
141 MailField->setText( tr( "Opiemail not installed" ) ); 149 MailField->setText( tr( "Opiemail not installed" ) );
142 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 150 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
143 MailField->setMaximumHeight(15); 151 MailField->setMaximumHeight(15);
144 MailField->setMinimumHeight(10); 152 MailField->setMinimumHeight(10);
145 153
154
155
156
146 layout->addWidget(Frame); 157 layout->addWidget(Frame);
147 layout->addWidget(Frame4); 158 layout->addWidget(Frame4);
148 layout->addWidget(MailFrame); 159 layout->addWidget(MailFrame);
149 layout->addWidget(Frame15); 160 layout->addWidget(Frame15);
150 161 //layout->addWidget(split);
162
151 layout->setStretchFactor(Frame4,4); 163 layout->setStretchFactor(Frame4,4);
152 layout->setStretchFactor(MailFrame,1); 164 layout->setStretchFactor(MailFrame,1);
153 layout->setStretchFactor(Frame15,3); 165 layout->setStretchFactor(Frame15,3);
154} 166}
155 167
156/* 168/*
157 * Destroys the object and frees any allocated resources 169 * Destroys the object and frees any allocated resources
158 */ 170 */
159TodayBase::~TodayBase() 171TodayBase::~TodayBase()
160{ 172{
161 // no need to delete child widgets, Qt does it all for us 173
162} 174}
163 175
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index 15f021a..c84cc67 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -1,49 +1,51 @@
1/**************************************************************************** 1/****************************************************************************
2** Form interface generated from reading ui file 'todaybase.ui' 2** Form interface generated from reading ui file 'todaybase.ui'
3** 3**
4** Created: Wed Feb 13 19:36:45 2002 4** Created: Wed Feb 13 19:36:45 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#ifndef TODAYBASE_H 9#ifndef TODAYBASE_H
10#define TODAYBASE_H 10#define TODAYBASE_H
11 11
12#include <qvariant.h> 12#include <qvariant.h>
13#include <qwidget.h> 13#include <qwidget.h>
14#include <qscrollview.h> 14#include <qscrollview.h>
15#include <qsplitter.h>
15 16
16class QVBoxLayout; 17class QVBoxLayout;
17class QHBoxLayout; 18class QHBoxLayout;
18class QGridLayout; 19class QGridLayout;
19class QFrame; 20class QFrame;
20class QLabel; 21class QLabel;
21class QPushButton; 22class QPushButton;
22 23
23class TodayBase : public QWidget 24class TodayBase : public QWidget
24{ 25{
25 Q_OBJECT 26 Q_OBJECT
26 27
27public: 28public:
28 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 29 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
29 ~TodayBase(); 30 ~TodayBase();
30 31
31 QFrame* Frame4; 32 QFrame* Frame4;
32 QPushButton* DatesButton; 33 QPushButton* DatesButton;
33 QLabel* DatesField; 34 QLabel* DatesField;
34 QLabel* Frame; 35 QLabel* Frame;
35 QFrame* MailFrame; 36 QFrame* MailFrame;
36 QLabel* TextLabel1; 37 QLabel* TextLabel1;
37 QFrame* Frame15; 38 QFrame* Frame15;
38 QLabel* TodoField; 39 QLabel* TodoField;
39 QLabel* MailField; 40 QLabel* MailField;
40 QPushButton* PushButton1; 41 QPushButton* PushButton1;
41 QPushButton* TodoButton; 42 QPushButton* TodoButton;
42 QPushButton* MailButton; 43 QPushButton* MailButton;
43 QPushButton* getridoffuckingstrippeldlinesbutton; 44 QPushButton* getridoffuckingstrippeldlinesbutton;
44 45
45protected: 46protected:
46 47
48
47}; 49};
48 50
49#endif // TODAYBASE_H 51#endif // TODAYBASE_H