author | zautrix <zautrix> | 2005-02-01 12:06:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-01 12:06:53 (UTC) |
commit | d1aa72f683fb264cca6936a8119d0abe9b310325 (patch) (side-by-side diff) | |
tree | e9099e8a366ba9890139f6ecce5ad686d3c06d93 | |
parent | 00b559c52051c05d6df41724b207a038c0e548bf (diff) | |
download | kdepimpi-d1aa72f683fb264cca6936a8119d0abe9b310325.zip kdepimpi-d1aa72f683fb264cca6936a8119d0abe9b310325.tar.gz kdepimpi-d1aa72f683fb264cca6936a8119d0abe9b310325.tar.bz2 |
fixes
-rw-r--r-- | korganizer/koagendaview.cpp | 41 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 1 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 8 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 41 |
4 files changed, 48 insertions, 43 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index aa36553..8c27c43 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -627,2 +627,17 @@ void KOAgendaView::slotDaylabelClicked() } + +QPushButton* KOAgendaView::getNewDaylabel() +{ + + QPushButton * dayLabel = new QPushButton(mDayLabels); + dayLabel->setFlat( true ); + connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); + dayLabel->setFocusPolicy(NoFocus); + dayLabel->setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); + mDayLabelsList.append( dayLabel ); + mLayoutDayLabels->addWidget(dayLabel); + //mLayoutDayLabels->setStretchFactor(dayLabel, 100); + return dayLabel ; +} + void KOAgendaView::createDayLabels() @@ -651,3 +666,4 @@ void KOAgendaView::createDayLabels() int wid = fm.width( dayTest ); - maxWid -= ( selCount * 3 ); + //maxWid -= ( selCount * 3 ); //working for QLabels + maxWid -= ( selCount * 5 ); //working for QPushButton if ( maxWid < 0 ) @@ -671,3 +687,3 @@ void KOAgendaView::createDayLabels() QFontMetrics f( dlf ); - wid = f.width( "20" ); + wid = f.width( "20" )+2; needWid = wid * selCount; @@ -692,8 +708,3 @@ void KOAgendaView::createDayLabels() appendLabels = true; - dayLabel = new QPushButton(mDayLabels); - dayLabel->setFlat( true ); - connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); - dayLabel->setFocusPolicy(NoFocus); - mDayLabelsList.append( dayLabel ); - mLayoutDayLabels->addWidget(dayLabel); + dayLabel = getNewDaylabel(); } @@ -718,8 +729,3 @@ void KOAgendaView::createDayLabels() if ( appendLabels ) { - dayLabel = new QPushButton(mDayLabels); - dayLabel->setFlat( true ); - connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); - dayLabel->setFocusPolicy(NoFocus); - mDayLabelsList.append( dayLabel ); - mLayoutDayLabels->addWidget(dayLabel); + dayLabel = getNewDaylabel(); } @@ -809,8 +815,3 @@ void KOAgendaView::createDayLabels() if ( appendLabels ) { - dayLabel = new QPushButton(mDayLabels); - dayLabel->setFlat( true ); - connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); - dayLabel->setFocusPolicy(NoFocus); - mDayLabelsList.append( dayLabel ); - mLayoutDayLabels->addWidget(dayLabel); + dayLabel = getNewDaylabel(); } diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index fd0a7af..cbe86b6 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -192,2 +192,3 @@ class KOAgendaView : public KOEventView { protected: + QPushButton* getNewDaylabel(); bool mBlockUpdating; diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index dd83d48..989f758 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -342,3 +342,3 @@ void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) mSelStart = tmp; - repaint(); + repaint(false); } @@ -350,3 +350,3 @@ void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) mSelEnd = tmp; - repaint(); + repaint(false); } @@ -373,3 +373,3 @@ void KODayMatrix::mouseMoveEvent (QMouseEvent* e) mSelStart = tmp; - repaint(); + repaint(false); } @@ -381,3 +381,3 @@ void KODayMatrix::mouseMoveEvent (QMouseEvent* e) mSelEnd = tmp; - repaint(); + repaint(false); } diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 188ad23..7e126d9 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -100,16 +100,18 @@ void KOViewManager::readSettings(KConfig *config) - void KOViewManager::showDateView( int view, QDate date) { - + static int lastMode = 0; + static int lastCount = 0; + static bool lastNDMode = false; + static QDate lastDate; //qDebug("date %d %s", view, date.toString().latin1()); -#if 0 - mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 ); - mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); -#endif + + //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); + bool savemFlagShowNextxDays = mFlagShowNextxDays; + mFlagShowNextxDays = false; if ( view == 3 ) { //mCurrentAgendaView = 1 ; + lastDate = mMainView->dateNavigator()->selectedDates().first(); + lastCount = mMainView->dateNavigator()->selectedDates().count(); + lastNDMode = savemFlagShowNextxDays; mMainView->showDay( date ); @@ -140,4 +142,12 @@ void KOViewManager::showDateView( int view, QDate date) mCurrentAgendaView = 3 ; - } if (view == 9) { - showWeekView(); + } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) + if ( lastMode ) { + mCurrentAgendaView = lastCount ; + mMainView->dateNavigator()->selectDates( lastDate, lastCount); + mFlagShowNextxDays = lastNDMode; + if ( mFlagShowNextxDays ) { + mCurrentAgendaView = 3 ; + } + } else + showWeekView(); } else if (view == 10) { @@ -145,10 +155,3 @@ void KOViewManager::showDateView( int view, QDate date) } - -#if 0 - dateNavigator()->blockSignals( true ); - dateNavigator()->selectDate( d ); - dateNavigator()->blockSignals( false ); - mViewManager->showDayView(); -#endif - + lastMode = view; } |