-rw-r--r-- | core/pim/today/todaybase.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index 41daa7d..feb9a84 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -1,108 +1,106 @@ | |||
1 | /* | 1 | /* |
2 | * todaybase.cpp | 2 | * todaybase.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002, 2003 by Maximilian Reiß | 4 | * copyright : (c) 2002, 2003 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #include "todaybase.h" | 17 | #include "todaybase.h" |
18 | 18 | ||
19 | #include <qvbox.h> | 19 | #include <qvbox.h> |
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qwhatsthis.h> | 21 | #include <qwhatsthis.h> |
22 | 22 | ||
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | 24 | ||
25 | 25 | ||
26 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) | 26 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) |
27 | : QWidget( parent, name, WStyle_ContextHelp ) { | 27 | : QWidget( parent, name, WStyle_ContextHelp ) { |
28 | 28 | ||
29 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo | 29 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo |
30 | QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla | 30 | QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla |
31 | QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon | 31 | QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon |
32 | 32 | ||
33 | layout = 0L; | 33 | layout = 0L; |
34 | 34 | ||
35 | QPalette pal = this->palette(); | 35 | QPalette pal = this->palette(); |
36 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); | 36 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); |
37 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); | 37 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); |
38 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); | 38 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); |
39 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); | 39 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); |
40 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); | 40 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); |
41 | this->setPalette( pal ); | 41 | this->setPalette( pal ); |
42 | 42 | ||
43 | // --- logo Section --- | 43 | // --- logo Section --- |
44 | QPalette pal2; | 44 | QPalette pal2; |
45 | QColorGroup cg; | 45 | QColorGroup cg; |
46 | cg.setColor( QColorGroup::Text, white ); | 46 | cg.setColor( QColorGroup::Text, white ); |
47 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); | 47 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); |
48 | pal2.setActive( cg ); | 48 | pal2.setActive( cg ); |
49 | 49 | ||
50 | // today logo | 50 | // today logo |
51 | Frame = new QLabel( this, "Frame" ); | 51 | Frame = new QLabel( this, "Frame" ); |
52 | Frame->setPalette( pal2 ); | 52 | Frame->setPalette( pal2 ); |
53 | Frame->setFrameShape( QFrame::StyledPanel ); | 53 | Frame->setFrameShape( QFrame::StyledPanel ); |
54 | Frame->setFrameShadow( QFrame::Raised ); | 54 | Frame->setFrameShadow( QFrame::Raised ); |
55 | Frame->setLineWidth( 0 ); | 55 | Frame->setLineWidth( 0 ); |
56 | 56 | ||
57 | QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); | 57 | QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); |
58 | QVBox *box1 = new QVBox( Frame ); | 58 | QVBox *box1 = new QVBox( Frame ); |
59 | box1->setMinimumWidth( 100 ); | 59 | |
60 | // Today text | 60 | // Today text |
61 | TodayLabel = new QLabel( box1, "TodayText" ); | 61 | TodayLabel = new QLabel( box1, "TodayText" ); |
62 | QFont TodayLabel_font( TodayLabel->font() ); | 62 | QFont TodayLabel_font( TodayLabel->font() ); |
63 | TodayLabel_font.setBold( TRUE ); | 63 | TodayLabel_font.setBold( TRUE ); |
64 | TodayLabel_font.setPointSize( 40 ); | 64 | TodayLabel_font.setPointSize( 40 ); |
65 | TodayLabel->setFont( TodayLabel_font ); | 65 | TodayLabel->setFont( TodayLabel_font ); |
66 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 66 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
67 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); | 67 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); |
68 | 68 | ||
69 | // date | 69 | // date |
70 | DateLabel = new QLabel( box1, "TextLabel1" ); | 70 | DateLabel = new QLabel( box1, "TextLabel1" ); |
71 | QFont DateLabel_font( DateLabel->font() ); | 71 | QFont DateLabel_font( DateLabel->font() ); |
72 | DateLabel_font.setBold( TRUE ); | 72 | DateLabel_font.setBold( TRUE ); |
73 | DateLabel->setFont( DateLabel_font ); | 73 | DateLabel->setFont( DateLabel_font ); |
74 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 74 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
75 | DateLabel->setTextFormat( RichText ); | 75 | DateLabel->setTextFormat( RichText ); |
76 | 76 | ||
77 | // Opiezilla | 77 | // Opiezilla |
78 | Opiezilla = new QLabel( Frame, "OpieZilla" ); | 78 | Opiezilla = new QLabel( Frame, "OpieZilla" ); |
79 | Opiezilla->setPixmap( opiezilla ); | 79 | Opiezilla->setPixmap( opiezilla ); |
80 | QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); | 80 | QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); |
81 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); | 81 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); |
82 | 82 | ||
83 | 83 | ||
84 | // Ownerfield | 84 | // Ownerfield |
85 | OwnerField = new OClickableLabel( this , "Owner" ); | 85 | OwnerField = new OClickableLabel( this , "Owner" ); |
86 | OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); | ||
87 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); | 86 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); |
88 | OwnerField->setMaximumHeight(12); | ||
89 | 87 | ||
90 | // config | 88 | // config |
91 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); | 89 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); |
92 | ConfigButton->setPixmap( config ); | 90 | ConfigButton->setPixmap( config ); |
93 | QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); | 91 | QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); |
94 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); | 92 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); |
95 | 93 | ||
96 | frameLayout->addWidget( box1 ); | 94 | frameLayout->addWidget( box1, 1 ); |
97 | frameLayout->addStretch( 2 ); | 95 | frameLayout->addStretch( 1 ); |
98 | frameLayout->addWidget( ConfigButton, 0, AlignBottom ); | 96 | frameLayout->addWidget( ConfigButton, 0, AlignBottom ); |
99 | frameLayout->addWidget( Opiezilla ); | 97 | frameLayout->addWidget( Opiezilla ); |
100 | } | 98 | } |
101 | 99 | ||
102 | 100 | ||
103 | /** | 101 | /** |
104 | * D' tor | 102 | * D' tor |
105 | */ | 103 | */ |
106 | TodayBase::~TodayBase() { | 104 | TodayBase::~TodayBase() { |
107 | } | 105 | } |
108 | 106 | ||