author | harlekin <harlekin> | 2002-04-08 19:58:35 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-04-08 19:58:35 (UTC) |
commit | 9dd42008cd6dea68520c58a569874a7cc8230eb0 (patch) (side-by-side diff) | |
tree | d12285c8f697b85c59740d3a6f4c89cd2b86798d /core | |
parent | d30a329f104fd7abb20521c8abfe389d9cd76c99 (diff) | |
download | opie-9dd42008cd6dea68520c58a569874a7cc8230eb0.zip opie-9dd42008cd6dea68520c58a569874a7cc8230eb0.tar.gz opie-9dd42008cd6dea68520c58a569874a7cc8230eb0.tar.bz2 |
updated buttons
-rw-r--r-- | core/pim/today/changelog | 1 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 51 |
2 files changed, 28 insertions, 24 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog index 2270551..b3da1fb 100644 --- a/core/pim/today/changelog +++ b/core/pim/today/changelog @@ -1,6 +1,7 @@ 0.3.1 +* fixed the wrong color of the buttons * better translation (thanks carsten and others) * fixes memory leaks * bugfixes in calendar part, now location and note are working again. diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index dfcc34e..755c860 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp @@ -31,11 +31,11 @@ #include <qapplication.h> #include <qpe/resource.h> -/* - * Constructs a TodayBase which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' +/* + * Constructs a TodayBase which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' */ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { @@ -43,20 +43,23 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo QPixmap config = Resource::loadPixmap( "today/config" ); // config icon QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon - + QPalette pal = this->palette(); QColor col = pal.color(QPalette::Active, QColorGroup::Background); pal.setColor(QPalette::Active, QColorGroup::Button, col); + pal.setColor(QPalette::Inactive, QColorGroup::Button, col); + pal.setColor(QPalette::Normal, QColorGroup::Button, col); + pal.setColor(QPalette::Disabled, QColorGroup::Button, col); this->setPalette(pal); QWidget *d = QApplication::desktop(); - int w=d->width(); - int h=d->height(); - resize( w , h ); - + int w=d->width(); + int h=d->height(); + resize( w , h ); + // hehe, qt is ... getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" ); getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); @@ -77,49 +80,49 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) Frame->setMaximumHeight(50); Frame->setMinimumHeight(50); // date TextLabel1 = new QLabel( Frame, "TextLabel1" ); - TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); + TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); QFont TextLabel1_font( TextLabel1->font() ); TextLabel1_font.setBold( TRUE ); - TextLabel1->setFont( TextLabel1_font ); + TextLabel1->setFont( TextLabel1_font ); TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); TextLabel1->setTextFormat( RichText ); - + OwnerField = new QLabel(this , "Owner" ); OwnerField->setGeometry(QRect(0,0, this->width(), 12 )); OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) ); OwnerField->setMaximumHeight(12); - + // --- dates section --- Frame4 = new QFrame( this, "Frame4" ); Frame4->setPalette( pal ); Frame4->setFrameShape( QScrollView::StyledPanel ); Frame4->setFrameShadow( QScrollView::Sunken ); Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); Frame4->setFrameStyle( QFrame::NoFrame ); - Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) ); - + Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) ); + sv1 = new QScrollView( Frame4 ); sv1->setResizePolicy(QScrollView::AutoOneFit); sv1->setHScrollBarMode( QScrollView::AlwaysOff ); // need to find a better way!!! - sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); + sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); sv1->setFrameShape(QFrame::NoFrame); - + DatesButton = new QPushButton (Frame4, "DatesButton" ); DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); DatesButton->setPalette( pal ); DatesButton->setPixmap( datebook ); DatesButton->setFlat( TRUE ); - + // --- mail section ---) MailFrame = new QFrame( this ,"MailFrame" ); MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); - MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); + MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); MailFrame->setFrameStyle( QFrame::NoFrame ); - + QFrame* Line1 = new QFrame( MailFrame); Line1->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken ); @@ -129,18 +132,18 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) MailButton->setPixmap( mail ); MailButton->setFlat( TRUE ); MailField = new QLabel( MailFrame, "MailField" ); - MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) ); + MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) ); MailField->setText( tr( "Opiemail not installed" ) ); MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); MailField->setMaximumHeight(40); MailField->setMinimumHeight(15); // --- todo section -- Frame15 = new QFrame( this, "Frame15" ); Frame15->setFrameStyle( QFrame::NoFrame ); - Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); + Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); QFrame* Line2 = new QFrame( Frame15); Line2->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken ); @@ -153,9 +156,9 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) QScrollView* sv2 = new QScrollView( Frame15 ); sv2->setResizePolicy(QScrollView::AutoOneFit); sv2->setHScrollBarMode( QScrollView::AlwaysOff ); - sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) ); + sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) ); sv2->setFrameShape(QFrame::NoFrame); TodoField = new QLabel( sv2->viewport(), "TodoField" ); sv2->addChild(TodoField); @@ -163,9 +166,9 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) //TodoField->setText( tr( "No current todos" ) ); TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); PushButton1 = new QPushButton (Frame15, "PushButton1" ); - PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) ); + PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) ); PushButton1->setPixmap( config ); PushButton1->setPalette( pal ); PushButton1->setAutoDefault( TRUE ); PushButton1->setFlat( TRUE ); @@ -181,9 +184,9 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) layout->setStretchFactor(MailFrame,1); layout->setStretchFactor(Frame15,4); } -/* +/* * Destroys the object and frees any allocated resources */ TodayBase::~TodayBase() { |