-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 7 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 10 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 61 | ||||
-rw-r--r-- | korganizer/komonthview.h | 6 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 5 |
5 files changed, 46 insertions, 43 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index cd78f54..ce66863 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp @@ -162,4 +162,7 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) - if ( QApplication::desktop()->width() < 320 ) { - mCompleteDateEdit->setMaximumWidth( 85 ); + if ( QApplication::desktop()->width() <= 480 ) { + if ( QApplication::desktop()->width() < 320 ) + mCompleteDateEdit->setMaximumWidth( 85 ); + else + mCompleteDateEdit->setMaximumWidth( 130 ); topLayout->setSpacing( 0 ); diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 2faf18f..de11c13 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -423,3 +423,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) if ( event->relatedTo() ) { - addTag("b",i18n("Parent todo: ")); + addTag("b",i18n("Parent todo:<br>")); mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); @@ -536,3 +536,3 @@ void KOEventViewer::formatAttendees(Incidence *event) if ( a->RSVP() ) { - ++a_count; + ++a_count_nr; mText += "<IMG src=\"" + iconPath + "\">"; @@ -540,3 +540,3 @@ void KOEventViewer::formatAttendees(Incidence *event) else { - ++a_count_nr; + ++a_count; mText += "<IMG src=\"" + NOiconPath + "\">"; @@ -552,3 +552,3 @@ void KOEventViewer::formatAttendees(Incidence *event) mText.append("</li></ul>"); - if ( a_count > 1 ) { + if ( (a_count+a_count_nr) > 1 ) { mText += "<a href=\"mailto:ALL\">"; @@ -568,3 +568,3 @@ void KOEventViewer::formatAttendees(Incidence *event) mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); - mText += "\n"; + mText += "<br>\n"; } diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 65accdc..5926abe 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -797,5 +797,7 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), - mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) + mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) { - + ignoreResizeEvent = 0; + mShortDayLabelsW = false; + mShortDayLabelsM = false; clPending = true; @@ -819,3 +821,2 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mCells.setAutoDelete( true ); - mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; mDayLabels.resize( mDaysPerWeek ); @@ -908,10 +909,6 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mContextMenu = eventPopup(); - // updateConfig(); //useless here + updateConfig(); //useless here //mWeekLabels[mNumWeeks]->setText( i18n("W")); -#if 0 - mWidStack = new QWidgetStack( this ); - mMonthView = new QWidget( mWidStack ); - mWeekView = new QWidget( mWidStack ); -#endif + if ( mShowWeekView ) @@ -1012,3 +1009,3 @@ void KOMonthView::updateConfig() mWidthLongDayLabel = 0; - + qDebug("KOMonthView::updateConfig() "); for (int i = 0; i < 7; i++) { @@ -1017,6 +1014,3 @@ void KOMonthView::updateConfig() } - bool temp = mShowSatSunComp ; - mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; if ( ! mShowWeekView ) { - if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) computeLayout(); @@ -1050,3 +1044,3 @@ void KOMonthView::updateDayLabels() #endif - + qDebug("updateDayLabels W %d M %d ",mShortDayLabelsW ,mShortDayLabelsM); mDayLabelsT = &mDayLabelsW; @@ -1054,4 +1048,4 @@ void KOMonthView::updateDayLabels() if (mWeekStartsMonday) { - bool show = mShortDayLabels; - if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) + bool show = mShortDayLabelsW; + if ( i > 4 && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) show = true; @@ -1059,4 +1053,4 @@ void KOMonthView::updateDayLabels() } else { - if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); - else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); + if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsW)); + else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsW)); @@ -1067,4 +1061,4 @@ void KOMonthView::updateDayLabels() if (mWeekStartsMonday) { - bool show = mShortDayLabels; - if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) + bool show = mShortDayLabelsM; + if ( i > 4 && KOPrefs::instance()->mMonthViewSatSunTog && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) show = true; @@ -1072,4 +1066,4 @@ void KOMonthView::updateDayLabels() } else { - if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); - else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); + if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsM)); + else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsM)); @@ -1271,2 +1265,10 @@ void KOMonthView::resizeEvent(QResizeEvent * e) { + qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); + if ( ignoreResizeEvent ) { + qDebug("KOMonthView::resizeEvent ignored "); + --ignoreResizeEvent; + return; + } + if ( e->size().width()+ e->size().height() < 240 ) + return; computeLayout(); @@ -1282,7 +1284,2 @@ void KOMonthView::computeLayoutWeek() int daysToShow; - bool combinedSatSun = false; - if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { - daysToShow = 6; - combinedSatSun = true; - } int tWid = topLevelWidget()->size().width(); @@ -1300,4 +1297,3 @@ void KOMonthView::computeLayoutWeek() daysToShow = 3; - mShowSatSunComp = true; - combinedSatSun = true; + bool combinedSatSun = true; @@ -1382,3 +1378,3 @@ void KOMonthView::computeLayoutWeek() //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); - mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ; + mShortDayLabelsW = mDayLabelsW[0]->width() < mWidthLongDayLabel ; updateDayLabels(); @@ -1402,3 +1398,3 @@ void KOMonthView::computeLayout() bool combinedSatSun = false; - if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { + if (KOPrefs::instance()->mMonthViewSatSunTog ) { daysToShow = 6; @@ -1489,3 +1485,4 @@ void KOMonthView::computeLayout() //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); - mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; + mShortDayLabelsM = mDayLabels[0]->width() < mWidthLongDayLabel ; + qDebug("dlwid %d %d ",mDayLabels[0]->width() , mWidthLongDayLabel); updateDayLabels(); diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 51eb9e6..9dbe319 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -228,2 +228,3 @@ class KOMonthView: public KOEventView bool isUpdatePossible() { return updatePossible; } + void setIgnoreResizeEvent( int c ) { ignoreResizeEvent = c ;} @@ -260,2 +261,3 @@ class KOMonthView: public KOEventView private: + int ignoreResizeEvent; int currentWeek(); @@ -271,3 +273,2 @@ class KOMonthView: public KOEventView bool mWeekStartsMonday; - bool mShowSatSunComp; void computeLayout(); @@ -282,3 +283,4 @@ class KOMonthView: public KOEventView - bool mShortDayLabels; + bool mShortDayLabelsM; + bool mShortDayLabelsW; int mWidthLongDayLabel; diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index a74c5fe..dcb51dc 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -124,3 +124,3 @@ void KOViewManager::showDateView( int view, QDate date) } else if (view == 6 ) { - mMainView->dateNavigator()->selectDates( date, 7 ); + //mMainView->dateNavigator()->selectDates( date, 7 ); showMonthView(); @@ -225,2 +225,3 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { + mMonthView->setIgnoreResizeEvent( 2 ); mMainView->navigatorBar()->show(); @@ -493,3 +494,3 @@ bool KOViewManager::showsNextDays() void KOViewManager::showMonthView() -{ + { if (!mMonthView) { |