From kde-devel Thu Aug 14 18:45:00 2003 From: Martin Koller Date: Thu, 14 Aug 2003 18:45:00 +0000 To: kde-devel Subject: Re: [Patch] #48264: added a Today button in kdatepicker X-MARC-Message: https://marc.info/?l=kde-devel&m=106088779303109 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_si9O/6nHPumzSMK" --Boundary-00=_si9O/6nHPumzSMK Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 14 August 2003 18:30, Andr=E9 Somers wrote: > >on challenge is that the items on the bottom are informational while the > >arrows at the top are navigational... "Today" looks like a label, not > >navigation, and that's only reinforced by the other two textual areas do= wn > >there. > > > >either the today nav should be moved up top (not exactly sure right now > > how to do that and make it look nice), or it needs to be more obviously > > not a label, IMHO > > I think that's a matter of widgetstyle. At my system, the week _does_ look > like a button (and it is!), and so will the Today button in that case. > > Andr=E9 Yes. If I look at KDE-3.1.2 with keramik, all the buttons do look like=20 buttons. See http://members.aon.at/m.koller/old-kdatepicker.png As I did not install everything on my HEAD KDE setup, I assume I have anoth= er=20 style used at the new screenshot. It seems that there were more changes from 3.1.2 to 3.2, because in 3.2, th= e=20 top-buttons are inside a KToolBar, which make them now less look like=20 buttons. Therefore also the bootom-buttons (week, today) have set the autoraise=20 feature like in the toolbar ... personally I think this is not a good style= ,=20 a button should look like a button, not like a label, but I did not want to= =20 break that. Regarding the "Today" buttontext, I modified the patch to use the "today.pn= g"=20 which is also used in korganizer. Here are screenshots with the icon 1) with autoraise:=20 http://members.aon.at/m.koller/kdatepicker-autoraise.png 2) without autoraise: http://members.aon.at/m.koller/kdatepicker-noautoraise.png Question regarding icons: What icons can I assume to be existing when a use= r=20 did only install kdelibs ? Are all icons in the pics/ subdirs ? If so, I have to add the today icon to it. Regarding the week-button: I think that a button which pops up a textfield = to=20 input a week number is a bad choice. What do you think about changing this to a ComboBox ? (Or was there a reason for a text input field regarding different calendar= =20 systems ?) And for me it's also not clear, why the month selection works in a very=20 uncommon way with a special popup. Why not using a Combobox here again? Even the year selection could use a spinbox instead of a popup. Comments? =2D --=20 Best regards/Sch=F6ne Gr=FC=DFe Martin Public key at: http://blackhole.pca.dfn.de:11371/pks/lookup?op=3Dget&search=3D0x8DFB0F86 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/O9isHmdPoI37D4YRAgf2AJ465XsXTEWPxS9DPUuBr3Urg+FswACfXwH+ tnZClaN3li94AzARx64PSeM=3D =3D0ntt =2D----END PGP SIGNATURE----- --Boundary-00=_si9O/6nHPumzSMK Content-Type: application/octet-stream; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch" Index: kdatepicker.cpp =================================================================== RCS file: /home/kde/kdelibs/kdeui/kdatepicker.cpp,v retrieving revision 1.60 diff -u -3 -p -r1.60 kdatepicker.cpp --- kdatepicker.cpp 17 Jul 2003 21:02:04 -0000 1.60 +++ kdatepicker.cpp 14 Aug 2003 18:43:55 -0000 @@ -45,11 +45,12 @@ class KDatePicker::KDatePickerPrivate { public: - KDatePickerPrivate() : closeButton(0L), selectWeek(0L), navigationLayout(0) {} + KDatePickerPrivate() : closeButton(0L), selectWeek(0L), todayButton(0), navigationLayout(0) {} KToolBar *tb; QToolButton *closeButton; QToolButton *selectWeek; + QToolButton *todayButton; QBoxLayout *navigationLayout; }; @@ -95,6 +96,9 @@ void KDatePicker::init( const QDate &dt d->selectWeek = new QToolButton( this ); d->selectWeek->setAutoRaise(true); + d->todayButton = new QToolButton(this); + d->todayButton->setAutoRaise(true); + d->todayButton->setPixmap(SmallIcon("today")); QToolTip::add(yearForward, i18n("Next year")); QToolTip::add(yearBackward, i18n("Previous year")); @@ -103,6 +107,7 @@ void KDatePicker::init( const QDate &dt QToolTip::add(d->selectWeek, i18n("Select a week")); QToolTip::add(selectMonth, i18n("Select a month")); QToolTip::add(selectYear, i18n("Select a year")); + QToolTip::add(d->todayButton, i18n("Select the current day")); // ----- setFontSize(fontsize); @@ -120,6 +125,7 @@ void KDatePicker::init( const QDate &dt connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); connect(d->selectWeek, SIGNAL(clicked()), SLOT(selectWeekClicked())); + connect(d->todayButton, SIGNAL(clicked()), SLOT(todayButtonClicked())); connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); @@ -133,6 +139,7 @@ void KDatePicker::init( const QDate &dt topLayout->addWidget(table); QBoxLayout * bottomLayout = new QHBoxLayout(topLayout); + bottomLayout->addWidget(d->todayButton); bottomLayout->addWidget(line); bottomLayout->addWidget(d->selectWeek); } @@ -395,6 +402,12 @@ KDatePicker::lineEnterPressed() KNotifyClient::beep(); kdDebug(298) << "KDatePicker::lineEnterPressed: invalid date entered." << endl; } +} + +void +KDatePicker::todayButtonClicked() +{ + setDate(QDate::currentDate()); } QSize Index: kdatepicker.h =================================================================== RCS file: /home/kde/kdelibs/kdeui/kdatepicker.h,v retrieving revision 1.34 diff -u -3 -p -r1.34 kdatepicker.h --- kdatepicker.h 15 Feb 2003 03:14:01 -0000 1.34 +++ kdatepicker.h 14 Aug 2003 18:43:55 -0000 @@ -188,6 +188,8 @@ protected slots: void selectMonthClicked(); void selectYearClicked(); void lineEnterPressed(); + /// @since 3.2 + void todayButtonClicked(); signals: /** This signal is emitted each time the selected date is changed. * Usually, this does not mean that the date has been entered, --Boundary-00=_si9O/6nHPumzSMK Content-Type: image/png; name="today.png" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="today.png" iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAZiS0dE AEQARQBFJNe/wgAAAAlwSFlzAAALEAAACxABrSO9dQAAAAd0SU1FB9ELFw0zB81/WN0AAAG1SURB VHicrZM/aFNRFMZ/777ra8FApUNG6aBY7B4CxWAJmEYsKgT/wNuLCkJUeApCGoRSXLJ3zuKkg8WI xkUkksWp0EIHyWZH9abv3PLedaiNxNgh6geXj+/COXznOxz4R3gAtVrNjVtYr9c9AKIocnvOjf2i KHIAWkRIxLB4r0Gvr0mCDGgNSoGv8HwffPVT+7h0j+2VG4gIURShDy09e3Kbr3YfI/skyehEvlJM akVm8tjgT0TQsQipNXTevCIIAp6/fMu1q2WMMQRBgLV2hC9cLBOLAKBEhMQa+t+/ca6QB+B1+8NA /4kTaxCRAwcSx9y5+xiA1rsO2WyWRqPhVatVBxs83BQevX+Bm06BDQBSMUgcH6zRuaM3WKlU3MfM POrUSdKdHp9W5mm1uywWc9x68BTA05eWloY6nJiaotlsemEYusvl83Q2hXSnh5tOabW7AwdDGayv LnP9Son11WW+7O4ShqErLeQp5mZYm5uge/80a3MTFHMzAKMZpNYA0O5+BqC0kB/Sv3Nqf2WgYxES 26dw9jgAhfrNIzM5RGL7gxE8gDOzs2PfAuBtb239Rdn/xg+jYxfZNjZyrgAAAABJRU5ErkJggg== --Boundary-00=_si9O/6nHPumzSMK Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --Boundary-00=_si9O/6nHPumzSMK--