summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-07-09 11:21:22 (UTC)
committer zautrix <zautrix>2005-07-09 11:21:22 (UTC)
commite98b8d5a8e01d5dd7cf6b8967d1065d72f61c908 (patch) (unidiff)
tree0687ea02ba6cd6071cad137593b8d0e0e21e910f /korganizer
parentb51db424f4b1e558ab8c7c723859bb564c99d83b (diff)
downloadkdepimpi-e98b8d5a8e01d5dd7cf6b8967d1065d72f61c908.zip
kdepimpi-e98b8d5a8e01d5dd7cf6b8967d1065d72f61c908.tar.gz
kdepimpi-e98b8d5a8e01d5dd7cf6b8967d1065d72f61c908.tar.bz2
fixxx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/journalentry.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index f0e0f86..739949d 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -77,21 +77,24 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
77 iconp = SmallIcon("1updownarrow"); 77 iconp = SmallIcon("1updownarrow");
78 toggleJournal->setPixmap (iconp ) ; 78 toggleJournal->setPixmap (iconp ) ;
79 QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb); 79 QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb);
80 vb->setStretchFactor (textLabel,1); 80 vb->setStretchFactor (textLabel,1);
81 vb->setStretchFactor( toggleJournal, 1 ); 81 vb->setStretchFactor( toggleJournal, 1 );
82 mTitle = new KOLocationBox(TRUE, vb, 30); 82 mTitle = new KOLocationBox(TRUE, vb, 30);
83 mTitle->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) ); 83 mTitle->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
84 mCalendarBox = new QComboBox(vb); 84 mCalendarBox = new QComboBox(vb);
85 mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) ); 85 mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
86#ifndef DESKTOP_VERSION 86#ifndef DESKTOP_VERSION
87 mTitle->setSizeLimit( 8 ); 87 mTitle->setSizeLimit( 8 );
88 mCalendarBox->setSizeLimit( 8 ); 88 mCalendarBox->setSizeLimit( 8 );
89#endif 89#endif
90 vb->setStretchFactor ( mTitle, 8 ); 90 vb->setStretchFactor ( mTitle, 8 );
91 vb->setStretchFactor ( mCalendarBox, 3 ); 91 int limit = 3;
92 if ( QApplication::desktop()->width() < 640 )
93 limit = 6;
94 vb->setStretchFactor ( mCalendarBox, limit );
92 //mTitleLabel->setMargin(0); 95 //mTitleLabel->setMargin(0);
93 //mTitleLabel->setAlignment(AlignCenter); 96 //mTitleLabel->setAlignment(AlignCenter);
94 QPushButton * loadTemplate = new QPushButton( vb ); 97 QPushButton * loadTemplate = new QPushButton( vb );
95 QPushButton * saveTemplate = new QPushButton( vb ); 98 QPushButton * saveTemplate = new QPushButton( vb );
96 if ( QApplication::desktop()->width() < 321 ) 99 if ( QApplication::desktop()->width() < 321 )
97 iconp = SmallIcon("fileexport16"); 100 iconp = SmallIcon("fileexport16");
@@ -113,14 +116,20 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
113#ifndef DESKTOP_VERSION 116#ifndef DESKTOP_VERSION
114 QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); 117 QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold );
115#endif 118#endif
116 mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width(); 119 mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width();
117 mDeskWid = QApplication::desktop()->width(); 120 mDeskWid = QApplication::desktop()->width();
118 int maxwid = mDeskWid - mMaxWidDiff; 121 int maxwid = mDeskWid - mMaxWidDiff;
119 mTitle->setMaximumWidth( maxwid/2 +20 ); 122 if ( QApplication::desktop()->width() < 640 ) {
120 mCalendarBox->setMaximumWidth( maxwid/2 -20 ); 123 mTitle->setMaximumWidth( maxwid/2 +20 );
124 mCalendarBox->setMaximumWidth( maxwid/2 -20);
125 } else {
126 mTitle->setMaximumWidth( (maxwid/4)*3);
127 mCalendarBox->setMaximumWidth( maxwid/2 );
128 }
129 //mCalendarBox->setMaximumWidth( maxwid/2 -20 );
121 mEditor->setWordWrap( KTextEdit::WidgetWidth ); 130 mEditor->setWordWrap( KTextEdit::WidgetWidth );
122 QBoxLayout *topLayout = new QVBoxLayout(this); 131 QBoxLayout *topLayout = new QVBoxLayout(this);
123 topLayout->addWidget(vb); 132 topLayout->addWidget(vb);
124 topLayout->addWidget(mEditor); 133 topLayout->addWidget(mEditor);
125 mEditor->installEventFilter(this); 134 mEditor->installEventFilter(this);
126 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 135 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
@@ -134,20 +143,28 @@ JournalEntry::~JournalEntry()
134{ 143{
135 //qDebug("JournalEntry::~JournalEntry() "); 144 //qDebug("JournalEntry::~JournalEntry() ");
136} 145}
137void JournalEntry::resizeEvent(QResizeEvent* e ) 146void JournalEntry::resizeEvent(QResizeEvent* e )
138{ 147{
139#ifndef DESKTOP_VERSION 148#ifndef DESKTOP_VERSION
149
140 if ( mDeskWid != QApplication::desktop()->width() ) { 150 if ( mDeskWid != QApplication::desktop()->width() ) {
141 mDeskWid == QApplication::desktop()->width(); 151 mDeskWid == QApplication::desktop()->width();
142 int maxwid = mDeskWid - mMaxWidDiff; 152 int maxwid = mDeskWid - mMaxWidDiff;
143 mTitle->setMaximumWidth( maxwid/2 +20 ); 153 if ( QApplication::desktop()->width() < 640 ) {
144 mCalendarBox->setMaximumWidth( maxwid/2 -20 ); 154 mTitle->setMaximumWidth( maxwid/2 +20 );
155 mCalendarBox->setMaximumWidth( maxwid/2 -20);
156 }
157 else {
158 mTitle->setMaximumWidth( (maxwid/4)*3);
159 mCalendarBox->setMaximumWidth( maxwid/2 );
160 }
161 //mCalendarBox->setMaximumWidth( maxwid/2 -20 );
145 } 162 }
146 setMaximumWidth( QApplication::desktop()->width() ); 163 //setMaximumWidth( QApplication::desktop()->width() );
147 qDebug("MAXXX %d ", QApplication::desktop()->width()); 164 //qDebug("MAXXX %d ", QApplication::desktop()->width());
148#endif 165#endif
149 QFrame::resizeEvent( e ); 166 QFrame::resizeEvent( e );
150} 167}
151QSize JournalEntry::sizeHint() const 168QSize JournalEntry::sizeHint() const
152{ 169{
153 return QSize ( 240, heiHint ); 170 return QSize ( 240, heiHint );