author | zautrix <zautrix> | 2005-02-16 22:38:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-16 22:38:07 (UTC) |
commit | 0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3 (patch) (unidiff) | |
tree | 5bc6d924f1a71cc04cb8f1ee0001fce7cde0fa71 | |
parent | f33a37a0f7c9b37cfea1346ed373ce1c27c1d6ba (diff) | |
download | kdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.zip kdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.tar.gz kdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.tar.bz2 |
added today but to datepicker
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 12 | ||||
-rw-r--r-- | libkdepim/kdatepicker.h | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 3d8edfc..62c8447 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -8,2 +8,4 @@ Added icon for the stealth new week view and made navigation more user friendly | |||
8 | 8 | ||
9 | Added a "go today" button to the datepicker. | ||
10 | |||
9 | 11 | ||
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index c13734f..77793c4 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp | |||
@@ -49,2 +49,3 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) | |||
49 | selectYear(new QToolButton(this)), | 49 | selectYear(new QToolButton(this)), |
50 | todayBut(new QToolButton(this)), | ||
50 | //line(new QLineEdit(this)), | 51 | //line(new QLineEdit(this)), |
@@ -68,2 +69,3 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) | |||
68 | monthBackward->setPixmap(SmallIcon("1leftarrowB")); | 69 | monthBackward->setPixmap(SmallIcon("1leftarrowB")); |
70 | todayBut->setPixmap(SmallIcon("today")); | ||
69 | setDate(dt); // set button texts | 71 | setDate(dt); // set button texts |
@@ -77,2 +79,3 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) | |||
77 | connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); | 79 | connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); |
80 | connect(todayBut, SIGNAL(clicked()), SLOT(goToday())); | ||
78 | //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); | 81 | //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); |
@@ -138,3 +141,5 @@ KDatePicker::resizeEvent(QResizeEvent*) | |||
138 | //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); | 141 | //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); |
139 | lineDate->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); | 142 | int todaywid = todayBut->sizeHint().width(); |
143 | todayBut->setGeometry(0, height()-sizes[0].height(),todaywid, sizes[0].height()); | ||
144 | lineDate->setGeometry(0+todaywid, height()-sizes[0].height(), width()-todaywid, sizes[0].height()); | ||
140 | // ----- adjust the table: | 145 | // ----- adjust the table: |
@@ -172,2 +177,7 @@ KDatePicker::date() const | |||
172 | 177 | ||
178 | void KDatePicker::goToday() | ||
179 | { | ||
180 | slotSetDate( QDate::currentDate() ); | ||
181 | |||
182 | } | ||
173 | void KDatePicker::slotSetDate( QDate date ) | 183 | void KDatePicker::slotSetDate( QDate date ) |
diff --git a/libkdepim/kdatepicker.h b/libkdepim/kdatepicker.h index 6625357..3db9a89 100644 --- a/libkdepim/kdatepicker.h +++ b/libkdepim/kdatepicker.h | |||
@@ -109,2 +109,3 @@ protected: | |||
109 | void resizeEvent(QResizeEvent*); | 109 | void resizeEvent(QResizeEvent*); |
110 | QToolButton *todayBut; | ||
110 | /// the year forward button | 111 | /// the year forward button |
@@ -143,2 +144,3 @@ protected slots: | |||
143 | void slotSetDate(QDate); | 144 | void slotSetDate(QDate); |
145 | void goToday(); | ||
144 | signals: | 146 | signals: |