From 78c70cfbbe79243d8b0ec40f8f6438c99046e12b Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 08 Feb 2005 16:24:18 +0000 Subject: fix --- (limited to 'microkde/kdatetbl.cpp') 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); -- cgit v0.9.0.2