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 | 31 | ||||
-rw-r--r-- | korganizer/calendarview.h | 4 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 47 | ||||
-rw-r--r-- | korganizer/komonthview.h | 4 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 41 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 1 |
6 files changed, 49 insertions, 79 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 77de94f..0fbaa9a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -287,5 +287,2 @@ void CalendarView::init() - mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); - rightLayout->addWidget( mNavigatorBar ); - mRightFrame = new QWidgetStack( rightBox ); @@ -329,5 +326,3 @@ void CalendarView::init() QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); - mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); mRightFrame = new QWidgetStack( rightBox ); - rightLayout->addWidget( mNavigatorBar ); rightLayout->addWidget( mRightFrame, 10 ); @@ -352,15 +347,3 @@ void CalendarView::init() 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 & ) ) ); @@ -384,4 +367,2 @@ void CalendarView::init() mNavigator, SLOT( slotMonthSelect( int ) ) ); - connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), - mNavigator, SLOT( slotMonthSelect( int ) ) ); @@ -3870,14 +3851,2 @@ 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) diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 8d7ff36..731298d 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -59,3 +59,2 @@ class KDatePicker; class ResourceView; -class NavigatorBar; class KOEventEditor; @@ -108,3 +107,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser QWidget *leftFrame(); - NavigatorBar *navigatorBar(); @@ -178,3 +176,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser public slots: - void showNavigatorBar(bool); void showOpenError(); @@ -535,3 +532,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser QVBox* mDateFrame; - NavigatorBar *mNavigatorBar; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 234375b..7ba0b2f 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -795,4 +795,5 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) 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 ); @@ -806,2 +807,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) #endif + hb->addWidget( mNavigatorBar ); hb->addWidget( mWidStack ); @@ -812,2 +814,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) updatePossible = false; + //updatePossible = true; mCells.setAutoDelete( true ); @@ -919,2 +922,6 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) emit incidenceSelected( 0 ); +#ifndef DESKTOP_VERSION + resize( QApplication::desktop()->size() ); + computeLayout(); +#endif } @@ -945,3 +952,2 @@ void KOMonthView::switchView() KOPrefs::instance()->mMonthViewWeek = mShowWeekView; - //emit showNavigator( !mShowWeekView ); if ( clPending ) { @@ -1262,8 +1268,3 @@ 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(); @@ -1288,4 +1289,4 @@ void KOMonthView::computeLayoutWeek() - int wid = size().width();//e - int hei = size().height()-1; + int wid = width();//e + int hei = height()-1-mNavigatorBar->height(); @@ -1294,3 +1295,2 @@ void KOMonthView::computeLayoutWeek() - if ( lastWid == width() && lastHei ==height() ) @@ -1308,3 +1308,3 @@ void KOMonthView::computeLayoutWeek() - qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); + //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); QFontMetrics fm ( mWeekLabels[0]->font() ); @@ -1389,7 +1389,7 @@ void KOMonthView::computeLayoutWeek() updateDayLabels(); - bool forceUpdate = !updatePossible; + //bool forceUpdate = !updatePossible; updatePossible = true; //mWeekLabels[mNumWeeks]->setText( i18n("M")); - if ( forceUpdate ) - updateView(); + //if ( forceUpdate ) + // updateView(); } @@ -1415,12 +1415,15 @@ void KOMonthView::computeLayout() - 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 ------------------------------------ "); + //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); QFontMetrics fm ( mWeekLabels[0]->font() ); @@ -1502,7 +1505,5 @@ void KOMonthView::computeLayout() updateDayLabels(); - bool forceUpdate = !updatePossible; + //bool forceUpdate = !updatePossible; updatePossible = true; //mWeekLabels[mNumWeeks]->setText( i18n("W")); - if ( forceUpdate ) - updateView(); } diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index a29a1a8..bf861ef 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -38,2 +38,3 @@ #include "koeventview.h" +#include "navigatorbar.h" @@ -230,2 +231,3 @@ class KOMonthView: public KOEventView bool skipResize; + NavigatorBar* navigatorBar() { return mNavigatorBar ;} public slots: @@ -251,3 +253,2 @@ class KOMonthView: public KOEventView void prevMonth(); - void showNavigator( bool ); void selectWeekNum ( int ); @@ -260,2 +261,3 @@ class KOMonthView: public KOEventView private: + NavigatorBar* mNavigatorBar; int currentWeek(); diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index ba15f7f..b551e2a 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -203,3 +203,3 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) if ( view == mMonthView && mMonthView) - mMonthView->skipResize = true ; + ;//mMonthView->skipResize = true ; mCurrentView = view; @@ -223,13 +223,2 @@ 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 ) { @@ -238,6 +227,2 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) mMainView->leftFrame()->show(); - if ( KOPrefs::instance()->mVerticalScreen ) - hei -= mMainView->leftFrame()->height(); - else - wid -= mMainView->leftFrame()->width(); } @@ -529,7 +514,23 @@ void KOViewManager::showMonthView() 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 ) ) ); + } diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 657f98d..f05e6f6 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -156,2 +156,3 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam mSelectMonth->setFocusPolicy(NoFocus); + setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); |