summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebookdayallday.cpp23
-rw-r--r--core/pim/datebook/datebookdayallday.h4
2 files changed, 18 insertions, 9 deletions
diff --git a/core/pim/datebook/datebookdayallday.cpp b/core/pim/datebook/datebookdayallday.cpp
index 985f31a..6014eca 100644
--- a/core/pim/datebook/datebookdayallday.cpp
+++ b/core/pim/datebook/datebookdayallday.cpp
@@ -31,4 +31,4 @@
*/
-DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const char* name, WFlags fl )
- : QWidget( parent, name,fl ),item_count(0),dateBook(db)
+DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const char* name, WFlags )
+ : QScrollView( parent, name ),item_count(0),dateBook(db)
{
@@ -37,4 +37,11 @@ DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const cha
setMinimumSize( QSize( 0, 0 ) );
+ setMaximumHeight(3* (QFontMetrics(font()).height()+4) );
- datebookdayalldayLayout = new QVBoxLayout( this );
+ m_MainFrame = new QFrame(viewport());
+ m_MainFrame->setFrameStyle(QFrame::NoFrame|QFrame::Plain);
+ setFrameStyle(QFrame::NoFrame|QFrame::Plain);
+ setResizePolicy( QScrollView::AutoOneFit );
+ addChild(m_MainFrame);
+
+ datebookdayalldayLayout = new QVBoxLayout( m_MainFrame );
datebookdayalldayLayout->setSpacing( 0 );
@@ -59,3 +66,3 @@ DatebookAlldayDisp* DatebookdayAllday::addEvent(const EffectiveEvent&ev)
DatebookAlldayDisp * lb;
- lb = new DatebookAlldayDisp(dateBook,ev,this,NULL);
+ lb = new DatebookAlldayDisp(dateBook,ev,m_MainFrame,NULL);
datebookdayalldayLayout->addWidget(lb);
@@ -84,5 +91,6 @@ DatebookAlldayDisp::DatebookAlldayDisp(DateBookDB *db,const EffectiveEvent& ev,
setFrameStyle(QFrame::Raised|QFrame::Panel);
- QSize s = sizeHint();
- setMaximumSize( QSize( 32767, s.height()-4 ) );
- setMinimumSize( QSize( 0, s.height()-4 ) );
+
+ int s = QFontMetrics(font()).height()+4;
+ setMaximumHeight( s );
+ setMinimumSize( QSize( 0, s ) );
}
@@ -225,2 +233 @@ void DatebookEventDesc::disp_event(const Event&e)
}
-
diff --git a/core/pim/datebook/datebookdayallday.h b/core/pim/datebook/datebookdayallday.h
index c781785..f5867e5 100644
--- a/core/pim/datebook/datebookdayallday.h
+++ b/core/pim/datebook/datebookdayallday.h
@@ -5,2 +5,3 @@
#include <qframe.h>
+#include <qscrollview.h>
#include <qlabel.h>
@@ -16,3 +17,3 @@ class DateBookDB;
-class DatebookdayAllday : public QWidget
+class DatebookdayAllday : public QScrollView
{
@@ -31,2 +32,3 @@ public slots:
protected:
+ QFrame * m_MainFrame;
QVBoxLayout* datebookdayalldayLayout;