-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 @@ -161,6 +161,9 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) ); - 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 @@ -422,5 +422,5 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) formatAttendees(event); 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>"); } @@ -535,9 +535,9 @@ void KOEventViewer::formatAttendees(Incidence *event) mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; if ( a->RSVP() ) { - ++a_count; + ++a_count_nr; mText += "<IMG src=\"" + iconPath + "\">"; } else { - ++a_count_nr; + ++a_count; mText += "<IMG src=\"" + NOiconPath + "\">"; } @@ -551,5 +551,5 @@ 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\">"; mText += i18n( "Mail to all" ); @@ -567,5 +567,5 @@ void KOEventViewer::formatAttendees(Incidence *event) mText += "</a> ( "; 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 @@ -796,7 +796,9 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) : KOEventView( calendar, parent, 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; mWidStack = new QWidgetStack( this ); @@ -818,5 +820,4 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) updatePossible = false; mCells.setAutoDelete( true ); - mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; mDayLabels.resize( mDaysPerWeek ); mDayLabelsW.resize( mDaysPerWeek ); @@ -907,12 +908,8 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); 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 ) mWidStack->raiseWidget( mWeekView ); @@ -1011,13 +1008,10 @@ void KOMonthView::updateConfig() QFontMetrics fontmetric(mDayLabels[0]->font()); mWidthLongDayLabel = 0; - + qDebug("KOMonthView::updateConfig() "); for (int i = 0; i < 7; i++) { int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; } - bool temp = mShowSatSunComp ; - mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; if ( ! mShowWeekView ) { - if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) computeLayout(); } @@ -1049,15 +1043,15 @@ void KOMonthView::updateDayLabels() mDayLabelsT = &mDayLabels; #endif - + qDebug("updateDayLabels W %d M %d ",mShortDayLabelsW ,mShortDayLabelsM); mDayLabelsT = &mDayLabelsW; for (int i = 0; i < 7; i++) { 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; (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); } 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)); } @@ -1066,11 +1060,11 @@ void KOMonthView::updateDayLabels() for (int i = 0; i < 7; i++) { 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; (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); } 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)); } @@ -1270,4 +1264,12 @@ void KOMonthView::updateView() 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(); clPending = true; @@ -1281,9 +1283,4 @@ void KOMonthView::computeLayoutWeek() int daysToShow; - bool combinedSatSun = false; - if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { - daysToShow = 6; - combinedSatSun = true; - } int tWid = topLevelWidget()->size().width(); int tHei = topLevelWidget()->size().height(); @@ -1299,6 +1296,5 @@ void KOMonthView::computeLayoutWeek() else daysToShow = 3; - mShowSatSunComp = true; - combinedSatSun = true; + bool combinedSatSun = true; //qDebug("KOMonthView::computeLayout()------------------------------------ "); @@ -1381,5 +1377,5 @@ void KOMonthView::computeLayoutWeek() // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); - mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ; + mShortDayLabelsW = mDayLabelsW[0]->width() < mWidthLongDayLabel ; updateDayLabels(); bool forceUpdate = !updatePossible; @@ -1401,5 +1397,5 @@ void KOMonthView::computeLayout() int daysToShow = 7; bool combinedSatSun = false; - if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { + if (KOPrefs::instance()->mMonthViewSatSunTog ) { daysToShow = 6; combinedSatSun = true; @@ -1488,5 +1484,6 @@ void KOMonthView::computeLayout() // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); //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(); bool forceUpdate = !updatePossible; diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 51eb9e6..9dbe319 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -227,4 +227,5 @@ class KOMonthView: public KOEventView bool isMonthView() { return true; } bool isUpdatePossible() { return updatePossible; } + void setIgnoreResizeEvent( int c ) { ignoreResizeEvent = c ;} MonthViewCell * selectedCell(); @@ -259,4 +260,5 @@ class KOMonthView: public KOEventView private: + int ignoreResizeEvent; int currentWeek(); bool clPending; @@ -270,5 +272,4 @@ class KOMonthView: public KOEventView int mNumCells; bool mWeekStartsMonday; - bool mShowSatSunComp; void computeLayout(); void computeLayoutWeek(); @@ -281,5 +282,6 @@ class KOMonthView: public KOEventView QPtrVector<KOWeekButton> mWeekLabelsW; - 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 @@ -123,5 +123,5 @@ void KOViewManager::showDateView( int view, QDate date) mMainView->dateNavigator()->selectDates( date, 14); } else if (view == 6 ) { - mMainView->dateNavigator()->selectDates( date, 7 ); + //mMainView->dateNavigator()->selectDates( date, 7 ); showMonthView(); } else if (view == 7 ) { @@ -224,4 +224,5 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) if ( mCurrentView == mMonthView ) { if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { + mMonthView->setIgnoreResizeEvent( 2 ); mMainView->navigatorBar()->show(); hei -= mMainView->navigatorBar()->sizeHint().height(); @@ -492,5 +493,5 @@ bool KOViewManager::showsNextDays() } void KOViewManager::showMonthView() -{ + { if (!mMonthView) { mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); |