-rw-r--r-- | microkde/kdatetbl.cpp | 36 |
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 @@ -82,5 +82,5 @@ KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) : QGridView(parent, name, f) { - setFontSize(10); + setFont( KGlobalSettings::generalFont() ); if(!date_.isValid()) { @@ -111,11 +111,10 @@ KDateTable::paintCell(QPainter *painter, int row, int col) 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; @@ -149,5 +148,5 @@ KDateTable::paintCell(QPainter *painter, int row, int col) // ----- draw the weekday: } else { - painter->setFont(font); + painter->setFont(_font); pos=7*(row-1)+col; if (KGlobal::locale()->weekStartsMonday()) @@ -301,8 +300,9 @@ KDateTable::setFontSize(int size) // ----- 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: @@ -444,5 +444,5 @@ KDateTable::sizeHint() const KDateInternalMonthPicker::KDateInternalMonthPicker -(int fontsize, QWidget* parent, const char* name) +(QWidget* parent, const char* name) : QGridView(parent, name), result(0) // invalid @@ -454,5 +454,9 @@ KDateInternalMonthPicker::KDateInternalMonthPicker 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); @@ -762,5 +766,5 @@ 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 @@ -772,5 +776,9 @@ KDateInternalWeekPicker::KDateInternalWeekPicker 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); |