author | zautrix <zautrix> | 2005-02-07 13:03:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-07 13:03:38 (UTC) |
commit | 7de846e9f01ce27b622541493e6a02e26e37bf2c (patch) (side-by-side diff) | |
tree | df59c7803b1e171b08d3c387f49b1239d1adc3b5 /korganizer | |
parent | afc19166fcdc09d3d5b757a84abfeb0b2746f35f (diff) | |
download | kdepimpi-7de846e9f01ce27b622541493e6a02e26e37bf2c.zip kdepimpi-7de846e9f01ce27b622541493e6a02e26e37bf2c.tar.gz kdepimpi-7de846e9f01ce27b622541493e6a02e26e37bf2c.tar.bz2 |
fixxxx
-rw-r--r-- | korganizer/calendarview.cpp | 33 | ||||
-rw-r--r-- | korganizer/calendarview.h | 4 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 55 | ||||
-rw-r--r-- | korganizer/komonthview.h | 6 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 41 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 1 |
6 files changed, 55 insertions, 85 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 77de94f..0fbaa9a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -285,9 +285,6 @@ void CalendarView::init() QWidget *rightBox = new QWidget( mPanner ); QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); - mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); - rightLayout->addWidget( mNavigatorBar ); - mRightFrame = new QWidgetStack( rightBox ); rightLayout->addWidget( mRightFrame, 1 ); @@ -327,9 +324,7 @@ void CalendarView::init() QWidget *rightBox = new QWidget( mainBox ); mainBoxLayout->addWidget ( rightBox, 10 ); QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); - mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); mRightFrame = new QWidgetStack( rightBox ); - rightLayout->addWidget( mNavigatorBar ); rightLayout->addWidget( mRightFrame, 10 ); mLeftFrame = leftFrame; @@ -350,19 +345,7 @@ void CalendarView::init() connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); - connect( mNavigatorBar, SIGNAL( goPrevYear() ), - mNavigator, SLOT( selectPreviousYear() ) ); - connect( mNavigatorBar, SIGNAL( goNextYear() ), - mNavigator, SLOT( selectNextYear() ) ); - connect( mNavigatorBar, SIGNAL( goPrevMonth() ), - mNavigator, SLOT( selectPreviousMonth() ) ); - connect( mNavigatorBar, SIGNAL( goNextMonth() ), - mNavigator, SLOT( selectNextMonth() ) ); - connect( mNavigatorBar, SIGNAL( selectWeek( int ) ), - mNavigator, SLOT( selectWeek( int ) ) ); - - connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), - mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); + connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), mNavigator, SLOT( selectWeek( const QDate & ) ) ); @@ -382,8 +365,6 @@ void CalendarView::init() mNavigator, SLOT( selectNext() ) ); connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), mNavigator, SLOT( slotMonthSelect( int ) ) ); - connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), - mNavigator, SLOT( slotMonthSelect( int ) ) ); connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); @@ -3868,18 +3849,6 @@ void CalendarView::slotCalendarChanged() ; } -NavigatorBar *CalendarView::navigatorBar() -{ - return mNavigatorBar; -} -void CalendarView::showNavigatorBar( bool b) -{ - if ( b ) mNavigatorBar->show(); - else mNavigatorBar->hide(); -} - - - void CalendarView::keyPressEvent ( QKeyEvent *e) { //qDebug(" alendarView::keyPressEvent "); diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 8d7ff36..731298d 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -57,7 +57,6 @@ class DateNavigator; class KOIncidenceEditor; class KDatePicker; class ResourceView; -class NavigatorBar; class KOEventEditor; class KOTodoEditor ; class KOEventViewerDialog; @@ -106,7 +105,6 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser QWidgetStack *viewStack(); QWidget *leftFrame(); - NavigatorBar *navigatorBar(); DateNavigator *dateNavigator(); KDateNavigator *dateNavigatorWidget(); @@ -176,7 +174,6 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser public slots: - void showNavigatorBar(bool); void showOpenError(); void watchSavedFile(); void recheckTimerAlarm(); @@ -533,7 +530,6 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser KDatePicker* mDatePicker; QVBox* mDateFrame; - NavigatorBar *mNavigatorBar; KDateNavigator *mDateNavigator; // widget showing small month view. diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 234375b..7ba0b2f 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -793,8 +793,9 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) { skipResize = false; clPending = true; + mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); mWidStack = new QWidgetStack( this ); - QHBoxLayout* hb = new QHBoxLayout( this ); + QVBoxLayout* hb = new QVBoxLayout( this ); mMonthView = new QWidget( mWidStack ); mWeekView = new QWidget( mWidStack ); #if QT_VERSION >= 0x030000 @@ -804,12 +805,14 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mWidStack->addWidget( mMonthView, 1 ); mWidStack->addWidget( mWeekView , 1 ); #endif + hb->addWidget( mNavigatorBar ); hb->addWidget( mWidStack ); mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); mShowWeekView = KOPrefs::instance()->mMonthViewWeek; if ( mShowWeekView ) mWeekStartsMonday = true; updatePossible = false; + //updatePossible = true; mCells.setAutoDelete( true ); mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; mDayLabels.resize( mDaysPerWeek ); @@ -917,6 +920,10 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mWidStack->raiseWidget( mMonthView ); emit incidenceSelected( 0 ); +#ifndef DESKTOP_VERSION + resize( QApplication::desktop()->size() ); + computeLayout(); +#endif } KOMonthView::~KOMonthView() @@ -943,7 +950,6 @@ void KOMonthView::switchView() selectedCell()->deselect(); mShowWeekView = !mShowWeekView; KOPrefs::instance()->mMonthViewWeek = mShowWeekView; - //emit showNavigator( !mShowWeekView ); if ( clPending ) { computeLayout(); updateConfig(); @@ -1260,12 +1266,7 @@ 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 ( skipResize ) { - skipResize = false; - qDebug("skipResize "); - return; - } + //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); computeLayout(); clPending = true; if ( mShowWeekView ) @@ -1286,16 +1287,15 @@ void KOMonthView::computeLayoutWeek() int tWid = topLevelWidget()->size().width(); int tHei = topLevelWidget()->size().height(); - int wid = size().width();//e - int hei = size().height()-1; + int wid = width();//e + int hei = height()-1-mNavigatorBar->height(); if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) return; - - if ( lastWid == width() && lastHei ==height() ) + if ( lastWid == width() && lastHei == height() ) return; - lastWid =width(); + lastWid = width(); lastHei = height(); @@ -1306,7 +1306,7 @@ void KOMonthView::computeLayoutWeek() mShowSatSunComp = true; combinedSatSun = true; - qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); + //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); QFontMetrics fm ( mWeekLabels[0]->font() ); int weeklabelwid = fm.width( "888" ); wid -= weeklabelwid; @@ -1387,11 +1387,11 @@ void KOMonthView::computeLayoutWeek() //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ; updateDayLabels(); - bool forceUpdate = !updatePossible; + //bool forceUpdate = !updatePossible; updatePossible = true; //mWeekLabels[mNumWeeks]->setText( i18n("M")); - if ( forceUpdate ) - updateView(); + //if ( forceUpdate ) + // updateView(); } void KOMonthView::computeLayout() { @@ -1413,16 +1413,19 @@ void KOMonthView::computeLayout() int tWid = topLevelWidget()->size().width(); int tHei = topLevelWidget()->size().height(); - int wid = size().width();//e - int hei = size().height()-1; + int wid = width();//e + int hei = height()-1-mNavigatorBar->height(); - if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) + if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) { return; - if ( lastWid == width() && lastHei ==height() ) + } + if ( lastWid == width() && lastHei == height() ){ return; - lastWid =width(); - lastHei = height(); - qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); + } + + lastWid = width(); + lastHei = height(); + //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); QFontMetrics fm ( mWeekLabels[0]->font() ); int weeklabelwid = fm.width( "888" ); wid -= weeklabelwid; @@ -1500,11 +1503,9 @@ void KOMonthView::computeLayout() //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; updateDayLabels(); - bool forceUpdate = !updatePossible; + //bool forceUpdate = !updatePossible; updatePossible = true; //mWeekLabels[mNumWeeks]->setText( i18n("W")); - if ( forceUpdate ) - updateView(); } void KOMonthView::showContextMenu( Incidence *incidence ) diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index a29a1a8..bf861ef 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -36,6 +36,7 @@ #include <libkcal/event.h> #include "koeventview.h" +#include "navigatorbar.h" #ifdef DESKTOP_VERSION class QToolTipGroup; @@ -227,7 +228,8 @@ class KOMonthView: public KOEventView bool isUpdatePossible() { return updatePossible; } MonthViewCell * selectedCell(); - bool skipResize; + bool skipResize; + NavigatorBar* navigatorBar() { return mNavigatorBar ;} public slots: virtual void updateView(); virtual void updateConfig(); @@ -249,7 +251,6 @@ class KOMonthView: public KOEventView signals: void nextMonth(); void prevMonth(); - void showNavigator( bool ); void selectWeekNum ( int ); void showDaySignal( QDate ); protected: @@ -258,6 +259,7 @@ class KOMonthView: public KOEventView void updateDayLabels(); private: + NavigatorBar* mNavigatorBar; int currentWeek(); bool clPending; QWidgetStack * mWidStack; diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index ba15f7f..b551e2a 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -201,7 +201,7 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) full = mMainView->leftFrame()->isVisible(); } else { if ( view == mMonthView && mMonthView) - mMonthView->skipResize = true ; + ;//mMonthView->skipResize = true ; mCurrentView = view; // bool full = fullScreen; bool isFull = !mMainView->leftFrame()->isVisible(); @@ -221,25 +221,10 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) { mCurrentAgendaView = 0; - int wid = mMainView->width() ; - int hei = mMainView->height(); - if ( mCurrentView == mMonthView ) { - if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { - mMainView->navigatorBar()->show(); - hei -= mMainView->navigatorBar()->sizeHint().height(); - } - //mMainView->navigatorBar()->hide(); - } else { - mMainView->navigatorBar()->hide(); - } if ( fullScreen ) { mMainView->leftFrame()->hide(); } else { mMainView->leftFrame()->show(); - if ( KOPrefs::instance()->mVerticalScreen ) - hei -= mMainView->leftFrame()->height(); - else - wid -= mMainView->leftFrame()->width(); } emit signalFullScreen( !fullScreen ); if ( callUpdateView ) @@ -527,11 +512,27 @@ void KOViewManager::showMonthView() mMainView, SLOT ( showDay( QDate ) ) ); connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); connect( mMonthView, SIGNAL(nextMonth() ), - mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); + mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); connect( mMonthView, SIGNAL(prevMonth() ), - mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); - connect( mMonthView, SIGNAL( showNavigator(bool) ), - mMainView, SLOT ( showNavigatorBar(bool) ) ); + mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), + mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), + mMainView->dateNavigator(), SLOT( selectNextYear() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), + mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), + mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( selectWeek( int ) ), + mMainView->dateNavigator(), SLOT( selectWeek( int ) ) ); + + connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), + mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); + + + connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), + mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); + } globalFlagBlockAgenda = 1; diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 657f98d..f05e6f6 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -154,6 +154,7 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam mNextMonth->setFocusPolicy(NoFocus); mNextYear->setFocusPolicy(NoFocus); mSelectMonth->setFocusPolicy(NoFocus); + setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); } |