author | zautrix <zautrix> | 2005-02-08 14:12:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-08 14:12:31 (UTC) |
commit | 41111b332c2a5f1b2ec152df309b9199f5e9c921 (patch) (side-by-side diff) | |
tree | 3a2e5c5a25cdb52f542b2fe84a03f94599be2fe3 | |
parent | 9927a063f34bb826a4b5f7f7029308c9c66acbce (diff) | |
download | kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.zip kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.tar.gz kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.tar.bz2 |
fixes
-rw-r--r-- | korganizer/calendarview.cpp | 31 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 5 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 28 | ||||
-rw-r--r-- | korganizer/ktimeedit.cpp | 6 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 27 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 3 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 10 | ||||
-rw-r--r-- | microkde/kdatetbl.cpp | 22 | ||||
-rw-r--r-- | microkde/kglobalsettings.cpp | 6 |
10 files changed, 91 insertions, 48 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 0fbaa9a..a9de65a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2460,17 +2460,7 @@ 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; @@ -2487,19 +2477,32 @@ void CalendarView::moveIncidence(Incidence * inc ) //mMoveIncidenceOldDate; mDatePicker->setDate( da ); } -void CalendarView::showDatePicker( ) +void CalendarView::showDatePickerPopup() { - //qDebug("CalendarView::showDatePicker( ) "); 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 @@ -442,6 +442,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void syncExternal( int mode ); void slotSelectPickerDate( QDate ) ; void showDatePicker( ) ; + void showDatePickerPopup() ; void moveIncidence(Incidence *) ; void beamIncidence(Incidence *) ; void beamCalendar() ; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 6ae4c6f..02d2585 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -925,8 +925,11 @@ 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 @@ -36,6 +36,7 @@ #include <stdlib.h> #include <kglobal.h> +#include <kglobalsettings.h> #include <kconfig.h> #include <klocale.h> #include <kdebug.h> @@ -62,6 +63,7 @@ KOPrefs::KOPrefs() : 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); @@ -69,6 +71,8 @@ KOPrefs::KOPrefs() : mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); mEditBoxFont = QFont("helvetica",12); mJornalViewFont = QFont("helvetica",12); + */ + KPrefs::setCurrentGroup("General"); @@ -156,18 +160,18 @@ KOPrefs::KOPrefs() : 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" ); diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp index 5222ac9..61a0931 100644 --- a/korganizer/ktimeedit.cpp +++ b/korganizer/ktimeedit.cpp @@ -49,9 +49,11 @@ KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) { setInsertionPolicy(NoInsertion); mFlagKeyPressed = false; - - if ( QApplication::desktop()->width() < 650 ) + if ( QApplication::desktop()->height() <= 480 ) { setSizeLimit ( 6 ); + } else { + setSizeLimit ( 12 ); + } mTime = qt; // mNoTimeString = i18n("No Time"); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7810bf9..61c39f5 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -2030,16 +2030,33 @@ 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 ); diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index f05e6f6..4a31c77 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -40,6 +40,7 @@ #include "kdatetbl.h" #include "koglobals.h" +#include <kglobalsettings.h> #include "koprefs.h" #ifndef KORG_NOPLUGINS #include "kocore.h" @@ -61,7 +62,7 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam topLayout->addWidget( mCtrlFrame ); - QFont tfont = font(); + QFont tfont = KGlobalSettings::generalFont();//font(); if ( QApplication::desktop()->width() >= 480 ) tfont.setPointSize(tfont.pointSize()+2); tfont.setBold(true); diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index d8bc9f5..2be9c9e 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp @@ -33,6 +33,7 @@ #include <qvalidator.h> #include <kdebug.h> #include <knotifyclient.h> +#include <kglobalsettings.h> #include "kdatetbl.h" #include "kdateedit.h" //#include "kdatepicker.moc" @@ -51,14 +52,9 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) //table(new KDateTable(this)), //fontsize(1) { - // ----- - int size = 12; - if ( QApplication::desktop()->width() >= 480 ) - size = 18; - fontsize = size; - setFont ( QFont("helvetica",size) ); + setFont ( KGlobalSettings::generalFont() ); table = new KDateTable(this); - setFontSize(size); + setFontSize(font().pointSize()+2); //line->setValidator(val); lineDate = new KDateEdit( this, "dateediipicker", true ); yearForward->setPixmap(SmallIcon("2rightarrowB")); diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index fce0e5a..e827412 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp @@ -198,8 +198,12 @@ KDateTable::paintCell(QPainter *painter, int row, int col) painter->setPen(pen); painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); } + /* if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width()); - if(rect.height()>maxCell.height()) maxCell.setHeight(rect.height()); + if(rect.height()>maxCell.height()) { + maxCell.setHeight(rect.height()); + } + */ } void @@ -313,9 +317,15 @@ KDateTable::setFontSize(int size) // ----- compare with a real wide number and add some space: rect=metrics.boundingRect(QString::fromLatin1("88")); maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); +#ifdef DESKTOP_VERSION + maxCell.setHeight(QMAX(maxCell.height()+8, rect.height())); +#else maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); - if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) +#endif + if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) { maxCell.setHeight(maxCell.width() * 1000 / 1900 ); + qDebug("setmax "); + } } void @@ -443,7 +453,7 @@ KDateInternalMonthPicker::KDateInternalMonthPicker activeCol = -1; activeRow = -1; font=KGlobalSettings::generalFont(); - font.setPointSize(fontsize); + //font.setPointSize(fontsize); setFont(font); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); @@ -761,7 +771,7 @@ KDateInternalWeekPicker::KDateInternalWeekPicker activeCol = -1; activeRow = -1; font=KGlobalSettings::generalFont(); - font.setPointSize(fontsize); + //font.setPointSize(fontsize); setFont(font); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); @@ -782,7 +792,11 @@ KDateInternalWeekPicker::KDateInternalWeekPicker if(max.width()<rect.width()) max.setWidth(rect.width()); if(max.height()<rect.height()) max.setHeight(rect.height()); } + if ( QApplication::desktop()->width() > 640 ) { + max.setWidth(max.width()+6); + max.setHeight(max.height()+8); + } } QSize diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index 2fff8fc..30e793f 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp @@ -10,11 +10,13 @@ QFont KGlobalSettings::generalFont() int size = 12; if (QApplication::desktop()->width() < 480 ) size = 10; - return QFont("helvetica",size); + QFont f = QApplication::font(); + f.setPointSize( size ); + return f; } QFont KGlobalSettings::toolBarFont() { - return QFont("helevetica",12); + return QApplication::font(); } QColor KGlobalSettings::toolBarHighlightColor() |