-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 | |||
@@ -50,12 +50,21 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 ); |
@@ -68,6 +77,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
@@ -78,21 +88,15 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 ); |
@@ -107,7 +111,9 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
@@ -119,20 +125,22 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
@@ -143,11 +151,15 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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); |
@@ -158,6 +170,6 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 | |||
@@ -12,6 +12,7 @@ | |||
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; |
@@ -44,6 +45,7 @@ public: | |||
44 | 45 | ||
45 | protected: | 46 | protected: |
46 | 47 | ||
48 | |||
47 | }; | 49 | }; |
48 | 50 | ||
49 | #endif // TODAYBASE_H | 51 | #endif // TODAYBASE_H |