From e98b8d5a8e01d5dd7cf6b8967d1065d72f61c908 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 09 Jul 2005 11:21:22 +0000 Subject: fixxx --- (limited to 'korganizer/journalentry.cpp') diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index f0e0f86..739949d 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -80,15 +80,18 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : vb->setStretchFactor (textLabel,1); vb->setStretchFactor( toggleJournal, 1 ); mTitle = new KOLocationBox(TRUE, vb, 30); - mTitle->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) ); + mTitle->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); mCalendarBox = new QComboBox(vb); - mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) ); + mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); #ifndef DESKTOP_VERSION mTitle->setSizeLimit( 8 ); mCalendarBox->setSizeLimit( 8 ); #endif vb->setStretchFactor ( mTitle, 8 ); - vb->setStretchFactor ( mCalendarBox, 3 ); + int limit = 3; + if ( QApplication::desktop()->width() < 640 ) + limit = 6; + vb->setStretchFactor ( mCalendarBox, limit ); //mTitleLabel->setMargin(0); //mTitleLabel->setAlignment(AlignCenter); QPushButton * loadTemplate = new QPushButton( vb ); @@ -116,8 +119,14 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : mMaxWidDiff = 3*size - 2*frameWidth() - textLabel->sizeHint().width(); mDeskWid = QApplication::desktop()->width(); int maxwid = mDeskWid - mMaxWidDiff; - mTitle->setMaximumWidth( maxwid/2 +20 ); - mCalendarBox->setMaximumWidth( maxwid/2 -20 ); + if ( QApplication::desktop()->width() < 640 ) { + mTitle->setMaximumWidth( maxwid/2 +20 ); + mCalendarBox->setMaximumWidth( maxwid/2 -20); + } else { + mTitle->setMaximumWidth( (maxwid/4)*3); + mCalendarBox->setMaximumWidth( maxwid/2 ); + } + //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); mEditor->setWordWrap( KTextEdit::WidgetWidth ); QBoxLayout *topLayout = new QVBoxLayout(this); topLayout->addWidget(vb); @@ -137,14 +146,22 @@ JournalEntry::~JournalEntry() void JournalEntry::resizeEvent(QResizeEvent* e ) { #ifndef DESKTOP_VERSION + if ( mDeskWid != QApplication::desktop()->width() ) { mDeskWid == QApplication::desktop()->width(); int maxwid = mDeskWid - mMaxWidDiff; - mTitle->setMaximumWidth( maxwid/2 +20 ); - mCalendarBox->setMaximumWidth( maxwid/2 -20 ); + if ( QApplication::desktop()->width() < 640 ) { + mTitle->setMaximumWidth( maxwid/2 +20 ); + mCalendarBox->setMaximumWidth( maxwid/2 -20); + } + else { + mTitle->setMaximumWidth( (maxwid/4)*3); + mCalendarBox->setMaximumWidth( maxwid/2 ); + } + //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); } - setMaximumWidth( QApplication::desktop()->width() ); - qDebug("MAXXX %d ", QApplication::desktop()->width()); + //setMaximumWidth( QApplication::desktop()->width() ); + //qDebug("MAXXX %d ", QApplication::desktop()->width()); #endif QFrame::resizeEvent( e ); } -- cgit v0.9.0.2