-rw-r--r-- | korganizer/calendarview.cpp | 33 | ||||
-rw-r--r-- | korganizer/calendarview.h | 3 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 5 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 28 | ||||
-rw-r--r-- | korganizer/ktimeedit.cpp | 8 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 27 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 3 |
7 files changed, 69 insertions, 38 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 0fbaa9a..a9de65a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2459,19 +2459,9 @@ void CalendarView::beamDone( Ir *ir ) void CalendarView::moveIncidence(Incidence * inc ) { if ( !inc ) return; - // qDebug("showDatePickerForIncidence( ) "); - if ( mDateFrame->isVisible() ) - mDateFrame->hide(); - else { - int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; - int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; - int dw = QApplication::desktop()->width(); - int dh = QApplication::desktop()->height(); - mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); - mDateFrame->show(); - } + showDatePickerPopup(); mDatePickerMode = 2; mMoveIncidence = inc ; QDate da; if ( mMoveIncidence->type() == "Todo" ) { @@ -2486,21 +2476,34 @@ void CalendarView::moveIncidence(Incidence * inc ) //PENDING set date for recurring incidence to date of recurrence //mMoveIncidenceOldDate; mDatePicker->setDate( da ); } -void CalendarView::showDatePicker( ) +void CalendarView::showDatePickerPopup() { - //qDebug("CalendarView::showDatePicker( ) "); - if ( mDateFrame->isVisible() ) + if ( mDateFrame->isVisible() ) mDateFrame->hide(); else { + int offX = 0, offY = 0; +#ifdef DESKTOP_VERSION + int w =mDatePicker->sizeHint().width() ; + int h = mDatePicker->sizeHint().height() ; + int dw = topLevelWidget()->width(); + int dh = topLevelWidget()->height(); + offX = topLevelWidget()->x(); + offY = topLevelWidget()->y(); +#else int w =mDatePicker->sizeHint().width() ; int h = mDatePicker->sizeHint().height() ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); - mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); +#endif + mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); mDateFrame->show(); } +} +void CalendarView::showDatePicker( ) +{ + showDatePickerPopup(); mDatePickerMode = 1; mDatePicker->setDate( mNavigator->selectedDates().first() ); } diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 731298d..e626ea3 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -440,9 +440,10 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser const QString &datebookFile, const QString &tasklistFile ); void syncExternal( int mode ); void slotSelectPickerDate( QDate ) ; - void showDatePicker( ) ; + void showDatePicker() ; + void showDatePickerPopup() ; void moveIncidence(Incidence *) ; void beamIncidence(Incidence *) ; void beamCalendar() ; void beamFilteredCalendar() ; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 6ae4c6f..02d2585 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -924,10 +924,13 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) emit incidenceSelected( 0 ); #ifndef DESKTOP_VERSION resize( QApplication::desktop()->size() ); - computeLayout(); +#else + resize(640, 480 ); #endif + computeLayout(); + } KOMonthView::~KOMonthView() { diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 576c265..5bfe2a1 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -35,8 +35,9 @@ #include <qstringlist.h> #include <stdlib.h> #include <kglobal.h> +#include <kglobalsettings.h> #include <kconfig.h> #include <klocale.h> #include <kdebug.h> #include <kemailsettings.h> @@ -61,15 +62,18 @@ KOPrefs::KOPrefs() : QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); QColor defaultTodoDueTodayColor = QColor(255,220,100); QColor defaultTodoOverdueColor = QColor(255,153,125); + /* mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); mDefaultViewFont = QFont("helvetica",10); mDefaultMonthViewFont = QFont("helvetica",8); mMarcusBainsFont= QFont("helvetica",10); mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); mEditBoxFont = QFont("helvetica",12); mJornalViewFont = QFont("helvetica",12); + */ + KPrefs::setCurrentGroup("General"); @@ -155,20 +159,20 @@ KOPrefs::KOPrefs() : addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); KPrefs::setCurrentGroup("Fonts"); // qDebug(" KPrefs::setCurrentGroup(Fonts); "); - addItemFont("TimeBar Font",&mTimeBarFont); - addItemFont("MonthView Font",&mMonthViewFont); - addItemFont("AgendaView Font",&mAgendaViewFont); - addItemFont("MarcusBains Font",&mMarcusBainsFont); - addItemFont("TimeLabels Font",&mTimeLabelsFont); - addItemFont("TodoView Font",&mTodoViewFont); - addItemFont("ListView Font",&mListViewFont); - addItemFont("DateNavigator Font",&mDateNavigatorFont); - addItemFont("EditBox Font",&mEditBoxFont); - addItemFont("JournalView Font",&mJornalViewFont); - addItemFont("WhatsNextView Font",&mWhatsNextFont); - addItemFont("EventView Font",&mEventViewFont); + addItemFont("TimeBar Font",&mTimeBarFont,KGlobalSettings::generalFont() ); + addItemFont("MonthView Font",&mMonthViewFont,KGlobalSettings::generalFont()); + addItemFont("AgendaView Font",&mAgendaViewFont,KGlobalSettings::generalFont()); + addItemFont("MarcusBains Font",&mMarcusBainsFont,KGlobalSettings::generalFont()); + addItemFont("TimeLabels Font",&mTimeLabelsFont,KGlobalSettings::generalFont()); + addItemFont("TodoView Font",&mTodoViewFont,KGlobalSettings::generalFont()); + addItemFont("ListView Font",&mListViewFont,KGlobalSettings::generalFont()); + addItemFont("DateNavigator Font",&mDateNavigatorFont,KGlobalSettings::generalFont()); + addItemFont("EditBox Font",&mEditBoxFont,KGlobalSettings::generalFont()); + addItemFont("JournalView Font",&mJornalViewFont,KGlobalSettings::generalFont()); + addItemFont("WhatsNextView Font",&mWhatsNextFont,KGlobalSettings::generalFont()); + addItemFont("EventView Font",&mEventViewFont,KGlobalSettings::generalFont()); KPrefs::setCurrentGroup("RemoteSyncing"); addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp index 5222ac9..61a0931 100644 --- a/korganizer/ktimeedit.cpp +++ b/korganizer/ktimeedit.cpp @@ -48,12 +48,14 @@ KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) : QComboBox(TRUE, parent, name) { setInsertionPolicy(NoInsertion); mFlagKeyPressed = false; - - if ( QApplication::desktop()->width() < 650 ) + if ( QApplication::desktop()->height() <= 480 ) { setSizeLimit ( 6 ); - mTime = qt; + } else { + setSizeLimit ( 12 ); + } + mTime = qt; // mNoTimeString = i18n("No Time"); // insertItem( mNoTimeString ); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7810bf9..61c39f5 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -2029,18 +2029,35 @@ void MainWindow::printCal() void MainWindow::weekAction() { int month; KPopupFrame* popup = new KPopupFrame(this); - int size = 12; - if ( QApplication::desktop()->width() >= 480 ) - size = 18; - KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(size, popup); + KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(10, popup); // ----- picker->resize(picker->sizeHint()); popup->setMainWidget(picker); picker->setFocus(); connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); - if(popup->exec(iconToolBar->mapToGlobal(QPoint(0, iconToolBar->height())))) + int x = 0; + int y = iconToolBar->height(); + int dX = 0; + int dY = 0; + if ( iconToolBar->orientation () == Qt:: Horizontal ) { + if ( iconToolBar->y() > height()/2 ) { + dY = iconToolBar->height()+picker->sizeHint().height(); + y = 0; + } + } else { + if ( iconToolBar->x() > width()/2 ) { // right side + x=0; + dX= iconToolBar->width()+picker->sizeHint().width(); + y = 0; + } else { + x= iconToolBar->width(); + y = 0; + } + } + qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); + if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) { month = picker->getResult(); emit selectWeek ( month ); //qDebug("weekSelected %d ", month); diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index f05e6f6..4a31c77 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -39,8 +39,9 @@ #include <knotifyclient.h> #include "kdatetbl.h" #include "koglobals.h" +#include <kglobalsettings.h> #include "koprefs.h" #ifndef KORG_NOPLUGINS #include "kocore.h" #endif @@ -60,9 +61,9 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam mCtrlFrame->setLineWidth(1); topLayout->addWidget( mCtrlFrame ); - QFont tfont = font(); + QFont tfont = KGlobalSettings::generalFont();//font(); if ( QApplication::desktop()->width() >= 480 ) tfont.setPointSize(tfont.pointSize()+2); tfont.setBold(true); |