author | zautrix <zautrix> | 2005-06-29 11:08:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-29 11:08:57 (UTC) |
commit | 435e68d6ace30fb2121b718226e00be44971c617 (patch) (side-by-side diff) | |
tree | 2b7d2793f0244db82a9cddbfab8957d13989ed20 /korganizer | |
parent | b7044dfc9516d546683973985555c481d59fc677 (diff) | |
download | kdepimpi-435e68d6ace30fb2121b718226e00be44971c617.zip kdepimpi-435e68d6ace30fb2121b718226e00be44971c617.tar.gz kdepimpi-435e68d6ace30fb2121b718226e00be44971c617.tar.bz2 |
fixx
-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 @@ -53,12 +53,13 @@ #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #endif JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : QFrame(parent) { + heiHint = QApplication::desktop()->height() / 5 ; showOnlyMode = false; mCalendar = calendar; mJournal = 0; mDirty = false; QHBox * vb = new QHBox ( this ); @@ -114,14 +115,18 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : connect( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) ); connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); } JournalEntry::~JournalEntry() { + qDebug("JournalEntry::~JournalEntry() "); +} +QSize JournalEntry::sizeHint() const +{ + return QSize ( 240, heiHint ); } - void JournalEntry::slotSaveTemplate() { QString fileName =locateLocal( "templates", "journals" ); QDir t_dir; if ( !t_dir.exists(fileName) ) t_dir.mkdir ( fileName ); diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index 85ad5df..b0e9cc7 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h @@ -46,12 +46,13 @@ class JournalEntry : public QFrame { void setDate(const QDate &); void clear(); void flushEntry(); void setShowOnly() {showOnlyMode = true;} + QSize sizeHint() const; protected slots: void slotSaveTemplate(); void slotLoadTemplate(); void setDirty(); void toggleShowJournal(); @@ -70,11 +71,12 @@ class JournalEntry : public QFrame { Calendar *mCalendar; Journal *mJournal; QDate mDate; void keyPressEvent ( QKeyEvent * ) ; QLabel *mTitleLabel; KTextEdit *mEditor; + int heiHint; bool mDirty; }; #endif diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index fae59d6..9e354d3 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -22,12 +22,13 @@ */ // // View of Journal entries #include <qlayout.h> +#include <qscrollview.h> #include <qpopupmenu.h> #include <klocale.h> #include <kdebug.h> #include "koprefs.h" @@ -40,13 +41,19 @@ using namespace KOrg; KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, const char *name) : 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(); } KOJournalView::~KOJournalView() { } @@ -54,13 +61,13 @@ KOJournalView::~KOJournalView() int KOJournalView::currentDateCount() { return 0; } 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 ); connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index aabf11c..0437d95 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h @@ -66,11 +66,12 @@ class KOJournalView : public KOrg::BaseView void showList(QPtrList<Journal> jl); Calendar *mCalendar; JournalEntry* getNewEntry(); QPtrList<JournalEntry> jEntries; void keyPressEvent ( QKeyEvent * ) ; QBoxLayout *mTopLayout; + QWidget *parWid; QDate mDate; }; #endif |