-rw-r--r-- | korganizer/mainwindow.cpp | 2 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 5 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 7 | ||||
-rw-r--r-- | microkde/kdatetbl.cpp | 36 | ||||
-rw-r--r-- | microkde/kdatetbl.h | 4 | ||||
-rw-r--r-- | microkde/kglobalsettings.cpp | 1 |
6 files changed, 32 insertions, 23 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 856f7db..468fd5b 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -2031,5 +2031,5 @@ void MainWindow::weekAction() int month; KPopupFrame* popup = new KPopupFrame(this); - KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(10, popup); + KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); // ----- picker->resize(picker->sizeHint()); diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 4a31c77..2b8fd4f 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -169,8 +169,5 @@ void NavigatorBar::selectMonth() int month; KPopupFrame* popup = new KPopupFrame(this); - int size = 12; - if ( QApplication::desktop()->width() >= 480 ) - size = 18; - KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(size, popup); + KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup); // ----- picker->resize(picker->sizeHint()); diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index 2be9c9e..d6e9b51 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp @@ -55,5 +55,8 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) 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 ); @@ -284,5 +287,5 @@ KDatePicker::selectMonthClicked() int month; KPopupFrame* popup = new KPopupFrame(this); - KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(fontsize, popup); + KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup); // ----- picker->resize(picker->sizeHint()); 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); diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h index 2efa532..87808df 100644 --- a/microkde/kdatetbl.h +++ b/microkde/kdatetbl.h @@ -58,5 +58,5 @@ public: * The constructor. */ - KDateInternalMonthPicker(int fontsize, QWidget* parent, const char* name=0); + KDateInternalMonthPicker(QWidget* parent, const char* name=0); /** * The size hint. @@ -334,5 +334,5 @@ public: * The constructor. */ - KDateInternalWeekPicker(int fontsize, QWidget* parent, const char* name=0); + KDateInternalWeekPicker(QWidget* parent, const char* name=0); /** * The size hint. diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index 30e793f..fbbf814 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp @@ -12,4 +12,5 @@ QFont KGlobalSettings::generalFont() size = 10; QFont f = QApplication::font(); + //qDebug("pointsize %d ", f.pointSize()); f.setPointSize( size ); return f; |