author | umopapisdn <umopapisdn> | 2003-03-24 09:58:20 (UTC) |
---|---|---|
committer | umopapisdn <umopapisdn> | 2003-03-24 09:58:20 (UTC) |
commit | 90eeb65c389f3c5deab32e3cc9ee084e89770563 (patch) (unidiff) | |
tree | c325a2cc17d5ba86b732667a1e9a6ba46e9e9d76 /core/pim/datebook/datebookweeklstheader.cpp | |
parent | 1471e2c49d27b352682448e2653e59073b556abc (diff) | |
download | opie-90eeb65c389f3c5deab32e3cc9ee084e89770563.zip opie-90eeb65c389f3c5deab32e3cc9ee084e89770563.tar.gz opie-90eeb65c389f3c5deab32e3cc9ee084e89770563.tar.bz2 |
Userinterface update. Use same icons in weeklistview as other views for navigating back/forward.
Diffstat (limited to 'core/pim/datebook/datebookweeklstheader.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookweeklstheader.cpp | 206 |
1 files changed, 206 insertions, 0 deletions
diff --git a/core/pim/datebook/datebookweeklstheader.cpp b/core/pim/datebook/datebookweeklstheader.cpp new file mode 100644 index 0000000..582dc96 --- a/dev/null +++ b/core/pim/datebook/datebookweeklstheader.cpp | |||
@@ -0,0 +1,206 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'datebookweeklstheader.ui' | ||
3 | ** | ||
4 | ** Created: Mon Mar 10 20:50:34 2003 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "datebookweeklstheader.h" | ||
10 | |||
11 | #include <qlabel.h> | ||
12 | #include <qpushbutton.h> | ||
13 | #include <qtoolbutton.h> | ||
14 | #include <qlayout.h> | ||
15 | #include <qvariant.h> | ||
16 | #include <qtooltip.h> | ||
17 | #include <qwhatsthis.h> | ||
18 | #include <qimage.h> | ||
19 | #include <qpixmap.h> | ||
20 | |||
21 | #include <qpe/resource.h> | ||
22 | |||
23 | static const char* const image0_data[] = { | ||
24 | "14 14 19 1", | ||
25 | ". c None", | ||
26 | "# c #000000", | ||
27 | "c c #202420", | ||
28 | "a c #202429", | ||
29 | "f c #525052", | ||
30 | "o c #52595a", | ||
31 | "m c #5a5d5a", | ||
32 | "l c #cdcacd", | ||
33 | "k c #cdcecd", | ||
34 | "q c #d5d6d5", | ||
35 | "i c #ded6de", | ||
36 | "j c #e6dee6", | ||
37 | "p c #eeeaee", | ||
38 | "h c #f6eef6", | ||
39 | "n c #f6f2f6", | ||
40 | "e c #f6f6f6", | ||
41 | "g c #fff6ff", | ||
42 | "d c #fffaff", | ||
43 | "b c #ffffff", | ||
44 | "..............", | ||
45 | ".......##.....", | ||
46 | "......ab#.....", | ||
47 | ".....cbb##....", | ||
48 | "....abbd####..", | ||
49 | "...cbbbbbbe#..", | ||
50 | "..fbbbbgdhi##.", | ||
51 | "...abbejkll##.", | ||
52 | "...maenk#####.", | ||
53 | "....oapk####..", | ||
54 | ".....oaq##....", | ||
55 | "......o###....", | ||
56 | "..............", | ||
57 | ".............."}; | ||
58 | |||
59 | static const char* const image1_data[] = { | ||
60 | "14 14 22 1", | ||
61 | ". c None", | ||
62 | "# c #000000", | ||
63 | "c c #202020", | ||
64 | "g c #202420", | ||
65 | "q c #414041", | ||
66 | "k c #4a484a", | ||
67 | "e c #5a5d62", | ||
68 | "d c #5a6162", | ||
69 | "a c #62696a", | ||
70 | "p c #cdcacd", | ||
71 | "s c #d5ced5", | ||
72 | "o c #d5d2d5", | ||
73 | "j c #ded6de", | ||
74 | "r c #dedade", | ||
75 | "l c #e6e2e6", | ||
76 | "m c #eeeaee", | ||
77 | "h c #f6eef6", | ||
78 | "i c #f6f2f6", | ||
79 | "t c #f6f6f6", | ||
80 | "f c #fff6ff", | ||
81 | "n c #fffaff", | ||
82 | "b c #ffffff", | ||
83 | "..............", | ||
84 | ".....##a......", | ||
85 | ".....#bcd.....", | ||
86 | ".....#bbce....", | ||
87 | "..####bbfge...", | ||
88 | "..#bbbbbfhce..", | ||
89 | "..#bbbbbijjk..", | ||
90 | "..#flmniopcq..", | ||
91 | "..####nrsgq#..", | ||
92 | "....##tpcq#...", | ||
93 | ".....#hgq#....", | ||
94 | ".....##q#.....", | ||
95 | "..............", | ||
96 | ".............."}; | ||
97 | |||
98 | |||
99 | /* | ||
100 | * Constructs a DateBookWeekLstHeaderBase which is a child of 'parent', with the | ||
101 | * name 'name' and widget flags set to 'f' | ||
102 | */ | ||
103 | DateBookWeekLstHeaderBase::DateBookWeekLstHeaderBase( QWidget* parent, const char* name, WFlags fl ) | ||
104 | : QWidget( parent, name, fl ) | ||
105 | { | ||
106 | QPixmap image0( ( const char** ) image0_data ); | ||
107 | QPixmap image1( ( const char** ) image1_data ); | ||
108 | if ( !name ) | ||
109 | setName( "DateBookWeekLstHeaderBase" ); | ||
110 | resize( 447, 45 ); | ||
111 | setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, sizePolicy().hasHeightForWidth() ) ); | ||
112 | DateBookWeekLstHeaderBaseLayout = new QHBoxLayout( this ); | ||
113 | DateBookWeekLstHeaderBaseLayout->setSpacing( 6 ); | ||
114 | DateBookWeekLstHeaderBaseLayout->setMargin( 11 ); | ||
115 | |||
116 | back = new QToolButton( this, "back" ); | ||
117 | back->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, back->sizePolicy().hasHeightForWidth() ) ); | ||
118 | back->setText( tr( "" ) ); | ||
119 | back->setPixmap( image0 ); | ||
120 | back->setPixmap( Resource::loadPixmap( "back" ) ); | ||
121 | back->setToggleButton( FALSE ); | ||
122 | back->setAutoRepeat( TRUE ); | ||
123 | back->setAutoRaise( TRUE ); | ||
124 | back->setToggleButton( FALSE ); | ||
125 | QToolTip::add( back, tr( "" ) ); | ||
126 | DateBookWeekLstHeaderBaseLayout->addWidget( back ); | ||
127 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
128 | DateBookWeekLstHeaderBaseLayout->addItem( spacer ); | ||
129 | |||
130 | labelWeek = new QToolButton( this, "labelWeek" ); | ||
131 | labelWeek->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, labelWeek->sizePolicy().hasHeightForWidth() ) ); | ||
132 | QFont labelWeek_font( labelWeek->font() ); | ||
133 | labelWeek_font.setBold( TRUE ); | ||
134 | labelWeek->setFont( labelWeek_font ); | ||
135 | labelWeek->setText( tr( "W: 00,00" ) ); | ||
136 | labelWeek->setToggleButton( FALSE ); | ||
137 | labelWeek->setAutoRaise( FALSE ); | ||
138 | labelWeek->setToggleButton( FALSE ); | ||
139 | QToolTip::add( labelWeek, tr( "" ) ); | ||
140 | DateBookWeekLstHeaderBaseLayout->addWidget( labelWeek ); | ||
141 | QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
142 | DateBookWeekLstHeaderBaseLayout->addItem( spacer_2 ); | ||
143 | |||
144 | dbl = new QToolButton( this, "dbl" ); | ||
145 | dbl->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, dbl->sizePolicy().hasHeightForWidth() ) ); | ||
146 | QFont dbl_font( dbl->font() ); | ||
147 | dbl_font.setBold( TRUE ); | ||
148 | dbl->setFont( dbl_font ); | ||
149 | dbl->setText( tr( "2" ) ); | ||
150 | dbl->setToggleButton( TRUE ); | ||
151 | dbl->setAutoRaise( FALSE ); | ||
152 | dbl->setToggleButton( TRUE ); | ||
153 | QToolTip::add( dbl, tr( "" ) ); | ||
154 | DateBookWeekLstHeaderBaseLayout->addWidget( dbl ); | ||
155 | QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
156 | DateBookWeekLstHeaderBaseLayout->addItem( spacer_3 ); | ||
157 | |||
158 | labelDate = new QLabel( this, "labelDate" ); | ||
159 | labelDate->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)7, labelDate->sizePolicy().hasHeightForWidth() ) ); | ||
160 | QFont labelDate_font( labelDate->font() ); | ||
161 | labelDate_font.setBold( TRUE ); | ||
162 | labelDate->setFont( labelDate_font ); | ||
163 | labelDate->setText( tr( "00 Jan-00 Jan" ) ); | ||
164 | DateBookWeekLstHeaderBaseLayout->addWidget( labelDate ); | ||
165 | QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
166 | DateBookWeekLstHeaderBaseLayout->addItem( spacer_4 ); | ||
167 | |||
168 | forward = new QToolButton( this, "forward" ); | ||
169 | forward->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, forward->sizePolicy().hasHeightForWidth() ) ); | ||
170 | forward->setText( tr( "" ) ); | ||
171 | forward->setPixmap( image1 ); | ||
172 | forward->setPixmap( Resource::loadPixmap( "forward" ) ); | ||
173 | forward->setAutoRepeat( TRUE ); | ||
174 | forward->setAutoRaise( TRUE ); | ||
175 | DateBookWeekLstHeaderBaseLayout->addWidget( forward ); | ||
176 | } | ||
177 | |||
178 | /* | ||
179 | * Destroys the object and frees any allocated resources | ||
180 | */ | ||
181 | DateBookWeekLstHeaderBase::~DateBookWeekLstHeaderBase() | ||
182 | { | ||
183 | // no need to delete child widgets, Qt does it all for us | ||
184 | } | ||
185 | |||
186 | /* | ||
187 | * Main event handler. Reimplemented to handle application | ||
188 | * font changes | ||
189 | */ | ||
190 | bool DateBookWeekLstHeaderBase::event( QEvent* ev ) | ||
191 | { | ||
192 | bool ret = QWidget::event( ev ); | ||
193 | if ( ev->type() == QEvent::ApplicationFontChange ) { | ||
194 | QFont labelWeek_font( labelWeek->font() ); | ||
195 | labelWeek_font.setBold( TRUE ); | ||
196 | labelWeek->setFont( labelWeek_font ); | ||
197 | QFont dbl_font( dbl->font() ); | ||
198 | dbl_font.setBold( TRUE ); | ||
199 | dbl->setFont( dbl_font ); | ||
200 | QFont labelDate_font( labelDate->font() ); | ||
201 | labelDate_font.setBold( TRUE ); | ||
202 | labelDate->setFont( labelDate_font ); | ||
203 | } | ||
204 | return ret; | ||
205 | } | ||
206 | |||