summaryrefslogtreecommitdiffabout
path: root/libkdepim/kdatepicker.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/kdatepicker.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kdatepicker.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp
index 2be9c9e..d6e9b51 100644
--- a/libkdepim/kdatepicker.cpp
+++ b/libkdepim/kdatepicker.cpp
@@ -45,25 +45,28 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
yearBackward(new QToolButton(this)),
monthForward(new QToolButton(this)),
monthBackward(new QToolButton(this)),
selectMonth(new QToolButton(this)),
selectYear(new QToolButton(this)),
//line(new QLineEdit(this)),
val(new KDateValidator(this))
//table(new KDateTable(this)),
//fontsize(1)
{
setFont ( KGlobalSettings::generalFont() );
table = new KDateTable(this);
- setFontSize(font().pointSize()+2);
+ int add = 2;
+ if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
+ add += 4;
+ setFontSize(font().pointSize()+add);
//line->setValidator(val);
lineDate = new KDateEdit( this, "dateediipicker", true );
yearForward->setPixmap(SmallIcon("2rightarrowB"));
yearBackward->setPixmap(SmallIcon("2leftarrowB"));
monthForward->setPixmap(SmallIcon("1rightarrowB"));
monthBackward->setPixmap(SmallIcon("1leftarrowB"));
setDate(dt); // set button texts
connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate)));
connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot()));
connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked()));
connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked()));
connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked()));
@@ -274,25 +277,25 @@ KDatePicker::yearBackwardClicked()
} else {
temp.setYMD(temp.year(), temp.month(), day);
}
// assert(temp.isValid());
setDate(temp);
}
void
KDatePicker::selectMonthClicked()
{
int month;
KPopupFrame* popup = new KPopupFrame(this);
- KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(fontsize, popup);
+ KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup);
// -----
picker->resize(picker->sizeHint());
popup->setMainWidget(picker);
picker->setFocus();
connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
if(popup->exec(selectMonth->mapToGlobal(QPoint(0, selectMonth->height()))))
{
QDate date;
int day;
// -----
month=picker->getResult();
date=table->getDate();