-rw-r--r-- | core/pim/today/todaybase.cpp | 48 | ||||
-rw-r--r-- | core/pim/today/todaybase.h | 2 |
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 | |||
@@ -49,14 +49,23 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 ) | 53 | QPalette 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 | |||
60 | QPalette pal = this->palette(); | ||
61 | QColor col = pal.color(QPalette::Active, QColorGroup::Background); | ||
62 | pal.setColor(QPalette::Active, QColorGroup::Button, col); | ||
63 | this->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 ); |
@@ -67,8 +76,9 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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" ); |
@@ -77,23 +87,17 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 ); |
@@ -106,9 +110,11 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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" ); |
@@ -118,22 +124,24 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 | 134 | ||
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" ); |
@@ -142,13 +150,17 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 | } |
@@ -157,7 +169,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
157 | * Destroys the object and frees any allocated resources | 169 | * Destroys the object and frees any allocated resources |
158 | */ | 170 | */ |
159 | TodayBase::~TodayBase() | 171 | TodayBase::~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 | |||
@@ -11,8 +11,9 @@ | |||
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 | ||
16 | class QVBoxLayout; | 17 | class QVBoxLayout; |
17 | class QHBoxLayout; | 18 | class QHBoxLayout; |
18 | class QGridLayout; | 19 | class QGridLayout; |
@@ -43,7 +44,8 @@ public: | |||
43 | QPushButton* getridoffuckingstrippeldlinesbutton; | 44 | QPushButton* getridoffuckingstrippeldlinesbutton; |
44 | 45 | ||
45 | protected: | 46 | protected: |
46 | 47 | ||
48 | |||
47 | }; | 49 | }; |
48 | 50 | ||
49 | #endif // TODAYBASE_H | 51 | #endif // TODAYBASE_H |