summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-02-16 17:27:51 (UTC)
committer harlekin <harlekin>2002-02-16 17:27:51 (UTC)
commit91842bea503d3d214b919c888124c652435a27a6 (patch) (unidiff)
tree5f0c698eadf78b07607ac95339d0033e5858aefc
parent58a0e33d4b79c7c47006fdf9d4c75e08395fd8d9 (diff)
downloadopie-91842bea503d3d214b919c888124c652435a27a6.zip
opie-91842bea503d3d214b919c888124c652435a27a6.tar.gz
opie-91842bea503d3d214b919c888124c652435a27a6.tar.bz2
started to make the gui a qvbox layout
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/todaybase.cpp34
-rw-r--r--core/pim/today/todaybase.h3
2 files changed, 23 insertions, 14 deletions
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index a44f598..b60c915 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -1,131 +1,139 @@
1/* 1/*
2 * todaybase.cpp * 2 * todaybase.cpp *
3 * --------------------- 3 * ---------------------
4 * 4 *
5 * begin : Sun 10 17:20:00 CEST 2002 5 * begin : Sun 10 17:20:00 CEST 2002
6 * copyright : (c) 2002 by Maximilian Reiß 6 * copyright : (c) 2002 by Maximilian Reiß
7 * email : max.reiss@gmx.de 7 * email : max.reiss@gmx.de
8 * 8 *
9 */ 9 */
10/*************************************************************************** 10/***************************************************************************
11 * * 11 * *
12 * This program is free software; you can redistribute it and/or modify * 12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by * 13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or * 14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. * 15 * (at your option) any later version. *
16 * * 16 * *
17 ***************************************************************************/ 17 ***************************************************************************/
18 18
19#include "todaybase.h" 19#include "todaybase.h"
20 20
21#include <qframe.h> 21#include <qframe.h>
22#include <qlabel.h> 22#include <qlabel.h>
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qvariant.h> 25#include <qvariant.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qwhatsthis.h> 27#include <qwhatsthis.h>
28#include <qimage.h> 28#include <qimage.h>
29#include <qpixmap.h> 29#include <qpixmap.h>
30#include <qscrollview.h> 30//#include <qscrollview.h>
31 31
32#include <qpe/resource.h> 32#include <qpe/resource.h>
33 33
34/* 34/*
35 * Constructs a TodayBase which is a child of 'parent', with the 35 * Constructs a TodayBase which is a child of 'parent', with the
36 * name 'name' and widget flags set to 'f' 36 * name 'name' and widget flags set to 'f'
37 */ 37 */
38TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 38TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
39 : QWidget( parent, name, fl ) 39 : QWidget( parent, name, fl )
40{ 40{
41 // logo 41 // logo
42 QPixmap logo = Resource::loadPixmap( "today/today_logo"); 42 QPixmap logo = Resource::loadPixmap( "today/today_logo");
43 // datebook 43 // datebook
44 QPixmap datebook = Resource::loadPixmap("DateBook"); 44 QPixmap datebook = Resource::loadPixmap("DateBook");
45 // todo 45 // todo
46 QPixmap todo = Resource::loadPixmap( "TodoList" ); 46 QPixmap todo = Resource::loadPixmap( "TodoList" );
47 // config icon 47 // config icon
48 QPixmap config = Resource::loadPixmap( "today/config" ); 48 QPixmap config = Resource::loadPixmap( "today/config" );
49 49
50 if ( !name ) 50 if ( !name )
51 setName( "TodayBase" ); 51 setName( "TodayBase" );
52 resize( 223, 307 ); 52 resize( 223, 307 );
53 53
54 QVBoxLayout * layout = new QVBoxLayout(this);
55
54 Frame4 = new QFrame( this, "Frame4" ); 56 Frame4 = new QFrame( this, "Frame4" );
55 Frame4->setGeometry( QRect( -9, 50, 250, 150 ) );
56 Frame4->setFrameShape( QScrollView::StyledPanel ); 57 Frame4->setFrameShape( QScrollView::StyledPanel );
57 Frame4->setFrameShadow( QScrollView::Sunken ); 58 Frame4->setFrameShadow( QScrollView::Sunken );
58 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); 59 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin );
59 60
60 // hehe, qt is ... 61 // hehe, qt is ...
61 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); 62 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" );
62 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( 2, 10, 0, 0 ) ); 63 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) );
63 64
64 DatesButton = new QPushButton (Frame4, "DatesButton" ); 65 DatesButton = new QPushButton (Frame4, "DatesButton" );
65 DatesButton->setGeometry( QRect( 10, 10, 36, 32 ) ); 66 DatesButton->setGeometry( QRect( 2, 10, 36, 32 ) );
66 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 67 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
67 DatesButton->setPixmap( datebook ); 68 DatesButton->setPixmap( datebook );
68 DatesButton->setFlat( TRUE ); 69 DatesButton->setFlat( TRUE );
69 70
70 DatesField = new QLabel( Frame4, "DatesField" ); 71 DatesField = new QLabel( Frame4, "DatesField" );
71 DatesField->setGeometry( QRect( 47, 10, 203, 120 ) ); 72 DatesField->setGeometry( QRect( 40, 10, 203, 120 ) );
72 DatesField->setText( tr( "No appointments today" ) ); 73 DatesField->setText( tr( "No appointments today" ) );
73 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 74 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
74 75
76 // today logo
75 Frame = new QLabel( this, "Frame" ); 77 Frame = new QLabel( this, "Frame" );
76 Frame->setGeometry( QRect( 0, 0, 240, 50 ) );
77 QPalette pal; 78 QPalette pal;
78 QColorGroup cg; 79 QColorGroup cg;
79 cg.setColor( QColorGroup::Text, white ); 80 cg.setColor( QColorGroup::Text, white );
80 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); 81 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) );
81 pal.setActive( cg ); 82 pal.setActive( cg );
82 83
83 Frame->setPalette( pal ); 84 Frame->setPalette( pal );
84 Frame->setFrameShape( QFrame::StyledPanel ); 85 Frame->setFrameShape( QFrame::StyledPanel );
85 Frame->setFrameShadow( QFrame::Raised ); 86 Frame->setFrameShadow( QFrame::Raised );
86 Frame->setLineWidth( 0 ); 87 Frame->setLineWidth( 0 );
87 88 Frame->setMaximumHeight(50);
88 // datum 89 Frame->setMinimumHeight(50);
90 // date
89 TextLabel1 = new QLabel( Frame, "TextLabel1" ); 91 TextLabel1 = new QLabel( Frame, "TextLabel1" );
90 TextLabel1->setPalette( pal ); 92 TextLabel1->setPalette( pal );
91 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); 93 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) );
92 QFont TextLabel1_font( TextLabel1->font() ); 94 QFont TextLabel1_font( TextLabel1->font() );
93 TextLabel1_font.setBold( TRUE ); 95 TextLabel1_font.setBold( TRUE );
94 TextLabel1->setFont( TextLabel1_font ); 96 TextLabel1->setFont( TextLabel1_font );
95 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); 97 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin );
96 TextLabel1->setTextFormat( QLabel::AutoText ); 98 TextLabel1->setTextFormat( QLabel::AutoText );
97 99
98 // todo 100 // todo
99 Frame15 = new QFrame( this, "Frame15" ); 101 Frame15 = new QFrame( this, "Frame15" );
100 Frame15->setGeometry( QRect( -9, 200, 250, 130 ) );
101 Frame15->setFrameShape( QFrame::StyledPanel ); 102 Frame15->setFrameShape( QFrame::StyledPanel );
102 Frame15->setFrameShadow( QFrame::Sunken ); 103 Frame15->setFrameShadow( QFrame::Sunken );
103 104
104 TodoButton = new QPushButton (Frame15, "TodoButton" ); 105 TodoButton = new QPushButton (Frame15, "TodoButton" );
105 TodoButton->setGeometry( QRect( 10, 4, 36, 32 ) ); 106 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) );
106 TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 107 TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
107 TodoButton->setPixmap( todo ); 108 TodoButton->setPixmap( todo );
108 TodoButton->setFlat( TRUE ); 109 TodoButton->setFlat( TRUE );
109 110
110 TodoField = new QLabel( Frame15, "TodoField" ); 111 TodoField = new QLabel( Frame15, "TodoField" );
111 TodoField->setGeometry( QRect( 47, 10, 196, 120 ) ); 112 TodoField->setGeometry( QRect( 40, 10, 196, 120 ) );
112 TodoField->setFrameShadow( QLabel::Plain ); 113 TodoField->setFrameShadow( QLabel::Plain );
113 TodoField->setText( tr( "No current todos" ) ); 114 TodoField->setText( tr( "No current todos" ) );
114 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 115 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
115 116
116 PushButton1 = new QPushButton (Frame15, "PushButton1" ); 117 PushButton1 = new QPushButton (Frame15, "PushButton1" );
117 PushButton1->setGeometry( QRect( 225, 68, 25, 21 ) ); 118 PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) );
118 PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin ); 119 PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin );
119 PushButton1->setPixmap( config ); 120 PushButton1->setPixmap( config );
120 PushButton1->setAutoDefault( TRUE ); 121 PushButton1->setAutoDefault( TRUE );
121 PushButton1->setFlat( TRUE ); 122 PushButton1->setFlat( TRUE );
123
124 layout->addWidget(Frame);
125 layout->addWidget(Frame4);
126 layout->addWidget(Frame15);
127
128 layout->setStretchFactor(Frame4,3);
129 layout->setStretchFactor(Frame15,2);
122} 130}
123 131
124/* 132/*
125 * Destroys the object and frees any allocated resources 133 * Destroys the object and frees any allocated resources
126 */ 134 */
127TodayBase::~TodayBase() 135TodayBase::~TodayBase()
128{ 136{
129 // no need to delete child widgets, Qt does it all for us 137 // no need to delete child widgets, Qt does it all for us
130} 138}
131 139
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index 947efc5..69c6363 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -1,46 +1,47 @@
1/**************************************************************************** 1/****************************************************************************
2** Form interface generated from reading ui file 'todaybase.ui' 2** Form interface generated from reading ui file 'todaybase.ui'
3** 3**
4** Created: Wed Feb 13 19:36:45 2002 4** Created: Wed Feb 13 19:36:45 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#ifndef TODAYBASE_H 9#ifndef TODAYBASE_H
10#define TODAYBASE_H 10#define TODAYBASE_H
11 11
12#include <qvariant.h> 12#include <qvariant.h>
13#include <qwidget.h> 13#include <qwidget.h>
14#include <qscrollview.h> 14#include <qscrollview.h>
15 15
16class QVBoxLayout; 16class QVBoxLayout;
17class QHBoxLayout; 17class QHBoxLayout;
18class QGridLayout; 18class QGridLayout;
19class QFrame; 19class QFrame;
20class QLabel; 20class QLabel;
21class QPushButton; 21class QPushButton;
22 22
23class TodayBase : public QWidget 23class TodayBase : public QWidget
24{ 24{
25 Q_OBJECT 25 Q_OBJECT
26 26
27public: 27public:
28 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 28 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
29 ~TodayBase(); 29 ~TodayBase();
30 30
31 QFrame* Frame4; 31 QFrame* Frame4;
32 QPushButton* DatesButton; 32 QPushButton* DatesButton;
33 QLabel* DatesField; 33 QLabel* DatesField;
34 QFrame* Frame; 34 QLabel* Frame;
35 //QFrame* Frame;
35 QLabel* TextLabel1; 36 QLabel* TextLabel1;
36 QFrame* Frame15; 37 QFrame* Frame15;
37 QLabel* TodoField; 38 QLabel* TodoField;
38 QPushButton* PushButton1; 39 QPushButton* PushButton1;
39 QPushButton* TodoButton; 40 QPushButton* TodoButton;
40 QPushButton* getridoffuckingstrippeldlinesbutton; 41 QPushButton* getridoffuckingstrippeldlinesbutton;
41 42
42protected: 43protected:
43 44
44}; 45};
45 46
46#endif // TODAYBASE_H 47#endif // TODAYBASE_H