From 9dd42008cd6dea68520c58a569874a7cc8230eb0 Mon Sep 17 00:00:00 2001 From: harlekin Date: Mon, 08 Apr 2002 19:58:35 +0000 Subject: updated buttons --- 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,5 +1,6 @@ 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 @@ -32,9 +32,9 @@ #include -/* - * 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 ) @@ -44,18 +44,21 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 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 ) ); @@ -78,18 +81,18 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 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 ); @@ -97,28 +100,28 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 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 ); @@ -130,7 +133,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 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); @@ -139,7 +142,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) // --- 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 ) ); @@ -154,7 +157,7 @@ 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" ); @@ -164,7 +167,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 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 ); @@ -182,7 +185,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) layout->setStretchFactor(Frame15,4); } -/* +/* * Destroys the object and frees any allocated resources */ TodayBase::~TodayBase() -- cgit v0.9.0.2