00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "todaybase.h"
00032
00033 #include <opie2/oresource.h>
00034
00035 #include <qpe/applnk.h>
00036
00037 #include <qvbox.h>
00038 #include <qwhatsthis.h>
00039
00040 using namespace Opie::Ui;
00041 TodayBase::TodayBase( QWidget* parent, const char* name, WFlags )
00042 : QWidget( parent, name, WStyle_ContextHelp ) {
00043
00044 QPixmap logo = Opie::Core::OResource::loadPixmap( "today/today_logo" );
00045 QImage opiezillaimage = QImage( Opie::Core::OResource::loadImage( "logo/opielogo" ) );
00046 opiezillaimage = opiezillaimage.smoothScale( 45, 45 );
00047 QPixmap opiezilla;
00048 opiezilla.convertFromImage( opiezillaimage );
00049 QPixmap config = Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon );
00050
00051 layout = 0L;
00052
00053 QPalette pal = this->palette();
00054 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
00055 pal.setColor( QPalette::Active, QColorGroup::Button, col );
00056 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
00057 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
00058 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
00059 this->setPalette( pal );
00060
00061
00062 QPalette pal2;
00063 QColorGroup cg;
00064 cg.setColor( QColorGroup::Text, white );
00065 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) );
00066 pal2.setActive( cg );
00067
00068
00069 Frame = new QLabel( this, "Frame" );
00070 Frame->setPalette( pal2 );
00071 Frame->setFrameShape( QFrame::StyledPanel );
00072 Frame->setFrameShadow( QFrame::Raised );
00073 Frame->setLineWidth( 0 );
00074
00075 QHBoxLayout *frameLayout = new QHBoxLayout( Frame );
00076 QVBox *box1 = new QVBox( Frame );
00077
00078
00079 TodayLabel = new QLabel( box1, "TodayText" );
00080 QFont TodayLabel_font( TodayLabel->font() );
00081 TodayLabel_font.setBold( TRUE );
00082 TodayLabel_font.setPointSize( 40 );
00083 TodayLabel->setFont( TodayLabel_font );
00084 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
00085 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" );
00086
00087
00088 DateLabel = new QLabel( box1, "TextLabel1" );
00089 QFont DateLabel_font( DateLabel->font() );
00090 DateLabel_font.setBold( TRUE );
00091 DateLabel->setFont( DateLabel_font );
00092 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin );
00093 DateLabel->setTextFormat( RichText );
00094
00095
00096 Opiezilla = new QLabel( Frame, "OpieZilla" );
00097 Opiezilla->setPixmap( opiezilla );
00098 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Rei�" ) );
00099 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
00100
00101
00102
00103 OwnerField = new OClickableLabel( this , "Owner" );
00104 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) );
00105
00106
00107 ConfigButton = new OClickableLabel ( Frame, "PushButton1" );
00108 ConfigButton->setPixmap( config );
00109 QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) );
00110 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin );
00111
00112 frameLayout->addWidget( box1, 1 );
00113 frameLayout->addStretch( 1 );
00114 frameLayout->addWidget( ConfigButton, 0, AlignBottom );
00115 frameLayout->addWidget( Opiezilla );
00116 }
00117
00118
00122 TodayBase::~TodayBase() {
00123 }
00124