author | drw <drw> | 2005-03-04 20:06:47 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-04 20:06:47 (UTC) |
commit | 4cd082939b03ec1891911c76cbd5aa12f84eb1f1 (patch) (unidiff) | |
tree | 3e9cca0534499acae17ebe14b254d6b9955fc1f6 | |
parent | 9d5079d82dc2821e719e70c0111e5f2ddc30eb37 (diff) | |
download | opie-4cd082939b03ec1891911c76cbd5aa12f84eb1f1.zip opie-4cd082939b03ec1891911c76cbd5aa12f84eb1f1.tar.gz opie-4cd082939b03ec1891911c76cbd5aa12f84eb1f1.tar.bz2 |
Scale icons appropriately
-rw-r--r-- | core/pim/today/todaybase.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index cb809d3..a89f454 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -1,97 +1,99 @@ | |||
1 | /* | 1 | /* |
2 | * todaybase.cpp | 2 | * todaybase.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß | 4 | * copyright : (c) 2002, 2003, 2004 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 <qpe/applnk.h> | ||
19 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
20 | 21 | ||
21 | #include <qvbox.h> | 22 | #include <qvbox.h> |
22 | #include <qwhatsthis.h> | 23 | #include <qwhatsthis.h> |
23 | 24 | ||
24 | using namespace Opie::Ui; | 25 | using namespace Opie::Ui; |
25 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) | 26 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) |
26 | : QWidget( parent, name, WStyle_ContextHelp ) { | 27 | : QWidget( parent, name, WStyle_ContextHelp ) { |
27 | 28 | ||
28 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo | 29 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo |
29 | QImage opiezillaimage = QImage( Resource::loadImage("logo/opielogo" ) ); | 30 | QImage opiezillaimage = QImage( Resource::loadImage("logo/opielogo" ) ); |
30 | opiezillaimage = opiezillaimage.smoothScale( 45, 45 ); | 31 | opiezillaimage = opiezillaimage.smoothScale( 45, 45 ); |
31 | QPixmap opiezilla; //the opiezilla | 32 | QPixmap opiezilla; //the opiezilla |
32 | opiezilla.convertFromImage( opiezillaimage ); | 33 | opiezilla.convertFromImage( opiezillaimage ); |
33 | QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon | 34 | QPixmap config; |
35 | config.convertFromImage( Resource::loadImage( "SettingsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
34 | 36 | ||
35 | layout = 0L; | 37 | layout = 0L; |
36 | 38 | ||
37 | QPalette pal = this->palette(); | 39 | QPalette pal = this->palette(); |
38 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); | 40 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); |
39 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); | 41 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); |
40 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); | 42 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); |
41 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); | 43 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); |
42 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); | 44 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); |
43 | this->setPalette( pal ); | 45 | this->setPalette( pal ); |
44 | 46 | ||
45 | // --- logo Section --- | 47 | // --- logo Section --- |
46 | QPalette pal2; | 48 | QPalette pal2; |
47 | QColorGroup cg; | 49 | QColorGroup cg; |
48 | cg.setColor( QColorGroup::Text, white ); | 50 | cg.setColor( QColorGroup::Text, white ); |
49 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); | 51 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); |
50 | pal2.setActive( cg ); | 52 | pal2.setActive( cg ); |
51 | 53 | ||
52 | // today logo | 54 | // today logo |
53 | Frame = new QLabel( this, "Frame" ); | 55 | Frame = new QLabel( this, "Frame" ); |
54 | Frame->setPalette( pal2 ); | 56 | Frame->setPalette( pal2 ); |
55 | Frame->setFrameShape( QFrame::StyledPanel ); | 57 | Frame->setFrameShape( QFrame::StyledPanel ); |
56 | Frame->setFrameShadow( QFrame::Raised ); | 58 | Frame->setFrameShadow( QFrame::Raised ); |
57 | Frame->setLineWidth( 0 ); | 59 | Frame->setLineWidth( 0 ); |
58 | 60 | ||
59 | QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); | 61 | QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); |
60 | QVBox *box1 = new QVBox( Frame ); | 62 | QVBox *box1 = new QVBox( Frame ); |
61 | 63 | ||
62 | // Today text | 64 | // Today text |
63 | TodayLabel = new QLabel( box1, "TodayText" ); | 65 | TodayLabel = new QLabel( box1, "TodayText" ); |
64 | QFont TodayLabel_font( TodayLabel->font() ); | 66 | QFont TodayLabel_font( TodayLabel->font() ); |
65 | TodayLabel_font.setBold( TRUE ); | 67 | TodayLabel_font.setBold( TRUE ); |
66 | TodayLabel_font.setPointSize( 40 ); | 68 | TodayLabel_font.setPointSize( 40 ); |
67 | TodayLabel->setFont( TodayLabel_font ); | 69 | TodayLabel->setFont( TodayLabel_font ); |
68 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 70 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
69 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); | 71 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); |
70 | 72 | ||
71 | // date | 73 | // date |
72 | DateLabel = new QLabel( box1, "TextLabel1" ); | 74 | DateLabel = new QLabel( box1, "TextLabel1" ); |
73 | QFont DateLabel_font( DateLabel->font() ); | 75 | QFont DateLabel_font( DateLabel->font() ); |
74 | DateLabel_font.setBold( TRUE ); | 76 | DateLabel_font.setBold( TRUE ); |
75 | DateLabel->setFont( DateLabel_font ); | 77 | DateLabel->setFont( DateLabel_font ); |
76 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 78 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
77 | DateLabel->setTextFormat( RichText ); | 79 | DateLabel->setTextFormat( RichText ); |
78 | 80 | ||
79 | // Opiezilla | 81 | // Opiezilla |
80 | Opiezilla = new QLabel( Frame, "OpieZilla" ); | 82 | Opiezilla = new QLabel( Frame, "OpieZilla" ); |
81 | Opiezilla->setPixmap( opiezilla ); | 83 | Opiezilla->setPixmap( opiezilla ); |
82 | QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); | 84 | QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); |
83 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); | 85 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); |
84 | 86 | ||
85 | 87 | ||
86 | // Ownerfield | 88 | // Ownerfield |
87 | OwnerField = new OClickableLabel( this , "Owner" ); | 89 | OwnerField = new OClickableLabel( this , "Owner" ); |
88 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); | 90 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); |
89 | 91 | ||
90 | // config | 92 | // config |
91 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); | 93 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); |
92 | ConfigButton->setPixmap( config ); | 94 | ConfigButton->setPixmap( config ); |
93 | QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); | 95 | QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); |
94 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); | 96 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); |
95 | 97 | ||
96 | frameLayout->addWidget( box1, 1 ); | 98 | frameLayout->addWidget( box1, 1 ); |
97 | frameLayout->addStretch( 1 ); | 99 | frameLayout->addStretch( 1 ); |