summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-08 16:24:18 (UTC)
committer zautrix <zautrix>2005-02-08 16:24:18 (UTC)
commit78c70cfbbe79243d8b0ec40f8f6438c99046e12b (patch) (unidiff)
tree382bc11ad3b56f72b8f84414e1da5e5ea871204b
parent584ed7893497b2adad5ba6c3e914d90b76973b92 (diff)
downloadkdepimpi-78c70cfbbe79243d8b0ec40f8f6438c99046e12b.zip
kdepimpi-78c70cfbbe79243d8b0ec40f8f6438c99046e12b.tar.gz
kdepimpi-78c70cfbbe79243d8b0ec40f8f6438c99046e12b.tar.bz2
fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp2
-rw-r--r--korganizer/navigatorbar.cpp5
-rw-r--r--libkdepim/kdatepicker.cpp7
-rw-r--r--microkde/kdatetbl.cpp36
-rw-r--r--microkde/kdatetbl.h4
-rw-r--r--microkde/kglobalsettings.cpp1
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
@@ -2027,13 +2027,13 @@ void MainWindow::printCal()
2027#include "libkdepim/kdatepicker.h" 2027#include "libkdepim/kdatepicker.h"
2028#include <kdatetbl.h> 2028#include <kdatetbl.h>
2029void MainWindow::weekAction() 2029void MainWindow::weekAction()
2030{ 2030{
2031 int month; 2031 int month;
2032 KPopupFrame* popup = new KPopupFrame(this); 2032 KPopupFrame* popup = new KPopupFrame(this);
2033 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(10, popup); 2033 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2034 // ----- 2034 // -----
2035 picker->resize(picker->sizeHint()); 2035 picker->resize(picker->sizeHint());
2036 popup->setMainWidget(picker); 2036 popup->setMainWidget(picker);
2037 picker->setFocus(); 2037 picker->setFocus();
2038 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2038 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2039 int x = 0; 2039 int x = 0;
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 4a31c77..2b8fd4f 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -165,16 +165,13 @@ NavigatorBar::~NavigatorBar()
165 165
166void NavigatorBar::selectMonth() 166void NavigatorBar::selectMonth()
167{ 167{
168 168
169 int month; 169 int month;
170 KPopupFrame* popup = new KPopupFrame(this); 170 KPopupFrame* popup = new KPopupFrame(this);
171 int size = 12; 171 KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup);
172 if ( QApplication::desktop()->width() >= 480 )
173 size = 18;
174 KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(size, popup);
175 // ----- 172 // -----
176 picker->resize(picker->sizeHint()); 173 picker->resize(picker->sizeHint());
177 popup->setMainWidget(picker); 174 popup->setMainWidget(picker);
178 picker->setFocus(); 175 picker->setFocus();
179 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 176 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
180 if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height())))) 177 if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height()))))
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp
index 2be9c9e..d6e9b51 100644
--- a/libkdepim/kdatepicker.cpp
+++ b/libkdepim/kdatepicker.cpp
@@ -51,13 +51,16 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
51 val(new KDateValidator(this)) 51 val(new KDateValidator(this))
52 //table(new KDateTable(this)), 52 //table(new KDateTable(this)),
53 //fontsize(1) 53 //fontsize(1)
54{ 54{
55 setFont ( KGlobalSettings::generalFont() ); 55 setFont ( KGlobalSettings::generalFont() );
56 table = new KDateTable(this); 56 table = new KDateTable(this);
57 setFontSize(font().pointSize()+2); 57 int add = 2;
58 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
59 add += 4;
60 setFontSize(font().pointSize()+add);
58 //line->setValidator(val); 61 //line->setValidator(val);
59 lineDate = new KDateEdit( this, "dateediipicker", true ); 62 lineDate = new KDateEdit( this, "dateediipicker", true );
60 yearForward->setPixmap(SmallIcon("2rightarrowB")); 63 yearForward->setPixmap(SmallIcon("2rightarrowB"));
61 yearBackward->setPixmap(SmallIcon("2leftarrowB")); 64 yearBackward->setPixmap(SmallIcon("2leftarrowB"));
62 monthForward->setPixmap(SmallIcon("1rightarrowB")); 65 monthForward->setPixmap(SmallIcon("1rightarrowB"));
63 monthBackward->setPixmap(SmallIcon("1leftarrowB")); 66 monthBackward->setPixmap(SmallIcon("1leftarrowB"));
@@ -280,13 +283,13 @@ KDatePicker::yearBackwardClicked()
280 283
281void 284void
282KDatePicker::selectMonthClicked() 285KDatePicker::selectMonthClicked()
283{ 286{
284 int month; 287 int month;
285 KPopupFrame* popup = new KPopupFrame(this); 288 KPopupFrame* popup = new KPopupFrame(this);
286 KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(fontsize, popup); 289 KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup);
287 // ----- 290 // -----
288 picker->resize(picker->sizeHint()); 291 picker->resize(picker->sizeHint());
289 popup->setMainWidget(picker); 292 popup->setMainWidget(picker);
290 picker->setFocus(); 293 picker->setFocus();
291 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 294 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
292 if(popup->exec(selectMonth->mapToGlobal(QPoint(0, selectMonth->height())))) 295 if(popup->exec(selectMonth->mapToGlobal(QPoint(0, selectMonth->height()))))
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index e827412..990cfb9 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -78,13 +78,13 @@ KDateValidator::fixup( QString& ) const
78 78
79} 79}
80 80
81KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) 81KDateTable::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();
88 } 88 }
89 setFocusPolicy( QWidget::StrongFocus ); 89 setFocusPolicy( QWidget::StrongFocus );
90 setNumRows(7); // 6 weeks max + headline 90 setNumRows(7); // 6 weeks max + headline
@@ -107,19 +107,18 @@ KDateTable::paintCell(QPainter *painter, int row, int col)
107 QPen pen; 107 QPen pen;
108 int w=cellWidth(); 108 int w=cellWidth();
109 int h=cellHeight(); 109 int h=cellHeight();
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())
123 { 122 {
124 daystr = KGlobal::locale()->weekDayName(col+1, true); 123 daystr = KGlobal::locale()->weekDayName(col+1, true);
125 if (col == 5 || col == 6) 124 if (col == 5 || col == 6)
@@ -145,13 +144,13 @@ KDateTable::paintCell(QPainter *painter, int row, int col)
145 daystr, -1, &rect); 144 daystr, -1, &rect);
146 painter->setPen(black); 145 painter->setPen(black);
147 painter->moveTo(0, h-1); 146 painter->moveTo(0, h-1);
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++;
155 if(pos<firstday || (firstday+numdays<=pos)) 154 if(pos<firstday || (firstday+numdays<=pos))
156 { // we are either 155 { // we are either
157 // ° painting a day of the previous month or 156 // ° painting a day of the previous month or
@@ -297,16 +296,17 @@ void
297KDateTable::setFontSize(int size) 296KDateTable::setFontSize(int size)
298{ 297{
299 int count; 298 int count;
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);
310 maxCell.setHeight(0); 310 maxCell.setHeight(0);
311 for(count=0; count<7; ++count) 311 for(count=0; count<7; ++count)
312 { 312 {
@@ -440,23 +440,27 @@ KDateTable::sizeHint() const
440 } else { 440 } else {
441 return QSize(-1, -1); 441 return QSize(-1, -1);
442 } 442 }
443} 443}
444 444
445KDateInternalMonthPicker::KDateInternalMonthPicker 445KDateInternalMonthPicker::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{
450 QRect rect; 450 QRect rect;
451 QFont font; 451 QFont font;
452 // ----- 452 // -----
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);
460 setFrameStyle(QFrame::NoFrame); 464 setFrameStyle(QFrame::NoFrame);
461 setNumRows(4); 465 setNumRows(4);
462 setNumCols(3); 466 setNumCols(3);
@@ -758,23 +762,27 @@ void KDateTable::virtual_hook( int, void* )
758{ /*BASE::virtual_hook( id, data );*/ } 762{ /*BASE::virtual_hook( id, data );*/ }
759 763
760//#include "kdatetbl.moc" 764//#include "kdatetbl.moc"
761 765
762 766
763KDateInternalWeekPicker::KDateInternalWeekPicker 767KDateInternalWeekPicker::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{
768 QRect rect; 772 QRect rect;
769 QFont font; 773 QFont font;
770 // ----- 774 // -----
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);
778 setFrameStyle(QFrame::NoFrame); 786 setFrameStyle(QFrame::NoFrame);
779 setNumRows(13); 787 setNumRows(13);
780 setNumCols(4); 788 setNumCols(4);
diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h
index 2efa532..87808df 100644
--- a/microkde/kdatetbl.h
+++ b/microkde/kdatetbl.h
@@ -54,13 +54,13 @@ signals:
54 */ 54 */
55 void closeMe(int); 55 void closeMe(int);
56public: 56public:
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 */
64 QSize sizeHint() const; 64 QSize sizeHint() const;
65 /** 65 /**
66 * Return the result. 0 means no selection (reject()), 1..12 are the 66 * Return the result. 0 means no selection (reject()), 1..12 are the
@@ -330,13 +330,13 @@ signals:
330 */ 330 */
331 void closeMe(int); 331 void closeMe(int);
332public: 332public:
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 */
340 QSize sizeHint() const; 340 QSize sizeHint() const;
341 /** 341 /**
342 * Return the result. 0 means no selection (reject()), 1..12 are the 342 * Return the result. 0 means no selection (reject()), 1..12 are the
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index 30e793f..fbbf814 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -8,12 +8,13 @@
8QFont KGlobalSettings::generalFont() 8QFont KGlobalSettings::generalFont()
9{ 9{
10 int size = 12; 10 int size = 12;
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}
17QFont KGlobalSettings::toolBarFont() 18QFont KGlobalSettings::toolBarFont()
18{ 19{
19 return QApplication::font(); 20 return QApplication::font();