-rw-r--r-- | korganizer/journalentry.cpp | 7 | ||||
-rw-r--r-- | korganizer/journalentry.h | 2 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 11 | ||||
-rw-r--r-- | korganizer/kojournalview.h | 1 |
4 files changed, 18 insertions, 3 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 7274849..0b923ad 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -56,6 +56,7 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : QFrame(parent) { + heiHint = QApplication::desktop()->height() / 5 ; showOnlyMode = false; mCalendar = calendar; mJournal = 0; @@ -117,8 +118,12 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : JournalEntry::~JournalEntry() { + qDebug("JournalEntry::~JournalEntry() "); +} +QSize JournalEntry::sizeHint() const +{ + return QSize ( 240, heiHint ); } - void JournalEntry::slotSaveTemplate() { QString fileName =locateLocal( "templates", "journals" ); diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index 85ad5df..b0e9cc7 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h @@ -49,6 +49,7 @@ class JournalEntry : public QFrame { void flushEntry(); void setShowOnly() {showOnlyMode = true;} + QSize sizeHint() const; protected slots: void slotSaveTemplate(); @@ -73,6 +74,7 @@ class JournalEntry : public QFrame { void keyPressEvent ( QKeyEvent * ) ; QLabel *mTitleLabel; KTextEdit *mEditor; + int heiHint; bool mDirty; }; diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index fae59d6..9e354d3 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -25,6 +25,7 @@ // View of Journal entries #include <qlayout.h> +#include <qscrollview.h> #include <qpopupmenu.h> #include <klocale.h> @@ -43,7 +44,13 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, : KOrg::BaseView(calendar, parent, name) { mCalendar = calendar; - mTopLayout = new QVBoxLayout(this); + QScrollView * sv = new QScrollView( this ); + QHBoxLayout * hbl = new QHBoxLayout( this ); + hbl->addWidget( sv ); + parWid = new QWidget( sv->viewport() ); + sv->addChild(parWid); + sv->setResizePolicy( QScrollView:: AutoOneFit ); + mTopLayout = new QVBoxLayout(parWid); getNewEntry(); } @@ -57,7 +64,7 @@ int KOJournalView::currentDateCount() } JournalEntry* KOJournalView::getNewEntry() { - JournalEntry* Entry = new JournalEntry(mCalendar,this); + JournalEntry* Entry = new JournalEntry(mCalendar,parWid); jEntries.append( Entry ); mTopLayout->addWidget(Entry); Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index aabf11c..0437d95 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h @@ -69,6 +69,7 @@ class KOJournalView : public KOrg::BaseView QPtrList<JournalEntry> jEntries; void keyPressEvent ( QKeyEvent * ) ; QBoxLayout *mTopLayout; + QWidget *parWid; QDate mDate; }; |