summaryrefslogtreecommitdiffabout
path: root/microkde/kdatetbl.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kdatetbl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdatetbl.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index e827412..990cfb9 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -81,7 +81,7 @@ KDateValidator::fixup( QString& ) const
KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f)
: QGridView(parent, name, f)
{
- setFontSize(10);
+ setFont( KGlobalSettings::generalFont() );
if(!date_.isValid())
{
date_=QDate::currentDate();
@@ -110,13 +110,12 @@ KDateTable::paintCell(QPainter *painter, int row, int col)
int pos;
QBrush brushBlue(blue);
QBrush brushLightblue(QColor(220,245,255));
- QFont font=KGlobalSettings::generalFont();
+ QFont _font=font();
// -----
- font.setPointSize(fontsize);
if(row==0)
{ // we are drawing the headline
- font.setBold(true);
- painter->setFont(font);
+ _font.setBold(true);
+ painter->setFont(_font);
bool normalday = true;
QString daystr;
if (KGlobal::locale()->weekStartsMonday())
@@ -148,7 +147,7 @@ KDateTable::paintCell(QPainter *painter, int row, int col)
painter->lineTo(w-1, h-1);
// ----- draw the weekday:
} else {
- painter->setFont(font);
+ painter->setFont(_font);
pos=7*(row-1)+col;
if (KGlobal::locale()->weekStartsMonday())
pos++;
@@ -300,10 +299,11 @@ KDateTable::setFontSize(int size)
QRect rect;
// ----- store rectangles:
fontsize=size;
- QFont font = KGlobalSettings::generalFont();
- font.setPointSize(fontsize);
- font.setBold( true );
- QFontMetrics metrics(font);
+ QFont _font = font();
+ _font.setPointSize(fontsize);
+ setFont( _font );
+ _font.setBold( true );
+ QFontMetrics metrics(_font);
// ----- find largest day name:
maxCell.setWidth(0);
@@ -443,7 +443,7 @@ KDateTable::sizeHint() const
}
KDateInternalMonthPicker::KDateInternalMonthPicker
-(int fontsize, QWidget* parent, const char* name)
+(QWidget* parent, const char* name)
: QGridView(parent, name),
result(0) // invalid
{
@@ -453,7 +453,11 @@ KDateInternalMonthPicker::KDateInternalMonthPicker
activeCol = -1;
activeRow = -1;
font=KGlobalSettings::generalFont();
- //font.setPointSize(fontsize);
+ int fontsize = 10;
+ int add = 2;
+ if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
+ add += 6;
+ font.setPointSize(fontsize+add);
setFont(font);
setHScrollBarMode(AlwaysOff);
setVScrollBarMode(AlwaysOff);
@@ -761,7 +765,7 @@ void KDateTable::virtual_hook( int, void* )
KDateInternalWeekPicker::KDateInternalWeekPicker
-(int fontsize, QWidget* parent, const char* name)
+(QWidget* parent, const char* name)
: QGridView(parent, name),
result(0) // invalid
{
@@ -771,7 +775,11 @@ KDateInternalWeekPicker::KDateInternalWeekPicker
activeCol = -1;
activeRow = -1;
font=KGlobalSettings::generalFont();
- //font.setPointSize(fontsize);
+ int fontsize = 10;
+ int add = 2;
+ if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
+ add += 4;
+ font.setPointSize(fontsize+add);
setFont(font);
setHScrollBarMode(AlwaysOff);
setVScrollBarMode(AlwaysOff);