author | zautrix <zautrix> | 2005-02-08 16:24:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-08 16:24:18 (UTC) |
commit | 78c70cfbbe79243d8b0ec40f8f6438c99046e12b (patch) (unidiff) | |
tree | 382bc11ad3b56f72b8f84414e1da5e5ea871204b /microkde | |
parent | 584ed7893497b2adad5ba6c3e914d90b76973b92 (diff) | |
download | kdepimpi-78c70cfbbe79243d8b0ec40f8f6438c99046e12b.zip kdepimpi-78c70cfbbe79243d8b0ec40f8f6438c99046e12b.tar.gz kdepimpi-78c70cfbbe79243d8b0ec40f8f6438c99046e12b.tar.bz2 |
fix
-rw-r--r-- | microkde/kdatetbl.cpp | 36 | ||||
-rw-r--r-- | microkde/kdatetbl.h | 4 | ||||
-rw-r--r-- | microkde/kglobalsettings.cpp | 1 |
3 files changed, 25 insertions, 16 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 | |||
81 | KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) | 81 | KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) |
82 | : QGridView(parent, name, f) | 82 | : QGridView(parent, name, f) |
83 | { | 83 | { |
84 | setFontSize(10); | 84 | setFont( KGlobalSettings::generalFont() ); |
85 | if(!date_.isValid()) | 85 | if(!date_.isValid()) |
86 | { | 86 | { |
87 | date_=QDate::currentDate(); | 87 | date_=QDate::currentDate(); |
@@ -110,13 +110,12 @@ KDateTable::paintCell(QPainter *painter, int row, int col) | |||
110 | int pos; | 110 | int pos; |
111 | QBrush brushBlue(blue); | 111 | QBrush brushBlue(blue); |
112 | QBrush brushLightblue(QColor(220,245,255)); | 112 | QBrush brushLightblue(QColor(220,245,255)); |
113 | QFont font=KGlobalSettings::generalFont(); | 113 | QFont _font=font(); |
114 | // ----- | 114 | // ----- |
115 | font.setPointSize(fontsize); | ||
116 | if(row==0) | 115 | if(row==0) |
117 | { // we are drawing the headline | 116 | { // we are drawing the headline |
118 | font.setBold(true); | 117 | _font.setBold(true); |
119 | painter->setFont(font); | 118 | painter->setFont(_font); |
120 | bool normalday = true; | 119 | bool normalday = true; |
121 | QString daystr; | 120 | QString daystr; |
122 | if (KGlobal::locale()->weekStartsMonday()) | 121 | if (KGlobal::locale()->weekStartsMonday()) |
@@ -148,7 +147,7 @@ KDateTable::paintCell(QPainter *painter, int row, int col) | |||
148 | painter->lineTo(w-1, h-1); | 147 | painter->lineTo(w-1, h-1); |
149 | // ----- draw the weekday: | 148 | // ----- draw the weekday: |
150 | } else { | 149 | } else { |
151 | painter->setFont(font); | 150 | painter->setFont(_font); |
152 | pos=7*(row-1)+col; | 151 | pos=7*(row-1)+col; |
153 | if (KGlobal::locale()->weekStartsMonday()) | 152 | if (KGlobal::locale()->weekStartsMonday()) |
154 | pos++; | 153 | pos++; |
@@ -300,10 +299,11 @@ KDateTable::setFontSize(int size) | |||
300 | QRect rect; | 299 | QRect rect; |
301 | // ----- store rectangles: | 300 | // ----- store rectangles: |
302 | fontsize=size; | 301 | fontsize=size; |
303 | QFont font = KGlobalSettings::generalFont(); | 302 | QFont _font = font(); |
304 | font.setPointSize(fontsize); | 303 | _font.setPointSize(fontsize); |
305 | font.setBold( true ); | 304 | setFont( _font ); |
306 | QFontMetrics metrics(font); | 305 | _font.setBold( true ); |
306 | QFontMetrics metrics(_font); | ||
307 | 307 | ||
308 | // ----- find largest day name: | 308 | // ----- find largest day name: |
309 | maxCell.setWidth(0); | 309 | maxCell.setWidth(0); |
@@ -443,7 +443,7 @@ KDateTable::sizeHint() const | |||
443 | } | 443 | } |
444 | 444 | ||
445 | KDateInternalMonthPicker::KDateInternalMonthPicker | 445 | KDateInternalMonthPicker::KDateInternalMonthPicker |
446 | (int fontsize, QWidget* parent, const char* name) | 446 | (QWidget* parent, const char* name) |
447 | : QGridView(parent, name), | 447 | : QGridView(parent, name), |
448 | result(0) // invalid | 448 | result(0) // invalid |
449 | { | 449 | { |
@@ -453,7 +453,11 @@ KDateInternalMonthPicker::KDateInternalMonthPicker | |||
453 | activeCol = -1; | 453 | activeCol = -1; |
454 | activeRow = -1; | 454 | activeRow = -1; |
455 | font=KGlobalSettings::generalFont(); | 455 | font=KGlobalSettings::generalFont(); |
456 | //font.setPointSize(fontsize); | 456 | int fontsize = 10; |
457 | int add = 2; | ||
458 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | ||
459 | add += 6; | ||
460 | font.setPointSize(fontsize+add); | ||
457 | setFont(font); | 461 | setFont(font); |
458 | setHScrollBarMode(AlwaysOff); | 462 | setHScrollBarMode(AlwaysOff); |
459 | setVScrollBarMode(AlwaysOff); | 463 | setVScrollBarMode(AlwaysOff); |
@@ -761,7 +765,7 @@ void KDateTable::virtual_hook( int, void* ) | |||
761 | 765 | ||
762 | 766 | ||
763 | KDateInternalWeekPicker::KDateInternalWeekPicker | 767 | KDateInternalWeekPicker::KDateInternalWeekPicker |
764 | (int fontsize, QWidget* parent, const char* name) | 768 | (QWidget* parent, const char* name) |
765 | : QGridView(parent, name), | 769 | : QGridView(parent, name), |
766 | result(0) // invalid | 770 | result(0) // invalid |
767 | { | 771 | { |
@@ -771,7 +775,11 @@ KDateInternalWeekPicker::KDateInternalWeekPicker | |||
771 | activeCol = -1; | 775 | activeCol = -1; |
772 | activeRow = -1; | 776 | activeRow = -1; |
773 | font=KGlobalSettings::generalFont(); | 777 | font=KGlobalSettings::generalFont(); |
774 | //font.setPointSize(fontsize); | 778 | int fontsize = 10; |
779 | int add = 2; | ||
780 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | ||
781 | add += 4; | ||
782 | font.setPointSize(fontsize+add); | ||
775 | setFont(font); | 783 | setFont(font); |
776 | setHScrollBarMode(AlwaysOff); | 784 | setHScrollBarMode(AlwaysOff); |
777 | setVScrollBarMode(AlwaysOff); | 785 | setVScrollBarMode(AlwaysOff); |
diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h index 2efa532..87808df 100644 --- a/microkde/kdatetbl.h +++ b/microkde/kdatetbl.h | |||
@@ -57,7 +57,7 @@ public: | |||
57 | /** | 57 | /** |
58 | * The constructor. | 58 | * The constructor. |
59 | */ | 59 | */ |
60 | KDateInternalMonthPicker(int fontsize, QWidget* parent, const char* name=0); | 60 | KDateInternalMonthPicker(QWidget* parent, const char* name=0); |
61 | /** | 61 | /** |
62 | * The size hint. | 62 | * The size hint. |
63 | */ | 63 | */ |
@@ -333,7 +333,7 @@ public: | |||
333 | /** | 333 | /** |
334 | * The constructor. | 334 | * The constructor. |
335 | */ | 335 | */ |
336 | KDateInternalWeekPicker(int fontsize, QWidget* parent, const char* name=0); | 336 | KDateInternalWeekPicker(QWidget* parent, const char* name=0); |
337 | /** | 337 | /** |
338 | * The size hint. | 338 | * The size hint. |
339 | */ | 339 | */ |
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index 30e793f..fbbf814 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp | |||
@@ -11,6 +11,7 @@ QFont KGlobalSettings::generalFont() | |||
11 | if (QApplication::desktop()->width() < 480 ) | 11 | if (QApplication::desktop()->width() < 480 ) |
12 | size = 10; | 12 | size = 10; |
13 | QFont f = QApplication::font(); | 13 | QFont f = QApplication::font(); |
14 | //qDebug("pointsize %d ", f.pointSize()); | ||
14 | f.setPointSize( size ); | 15 | f.setPointSize( size ); |
15 | return f; | 16 | return f; |
16 | } | 17 | } |