--nextPart2666566.rbAy7Kke6d Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On March 12, 2007, Micha=C3=ABl Larouche wrote: > Le March 12, 2007 04:15, Simon Hausmann a =C3=A9crit=C2=A0: > > On Monday 12 March 2007 03:17:41 Micha=C3=ABl Larouche wrote: > > > Le March 3, 2007 12:56, Micha=C3=ABl Larouche a =C3=A9crit=C2=A0: > > > > I have been working (slowy) on a new widget for kdelibs. > > > > > > > > It is a small label to display message in a dialog. The label is > > > > first hidden when instancied and only show up when a message is > > > > affected to the label. This is similiar to the ErrorNotifier control > > > > in Windows Forms. This widget will be useful to replace message box > > > > in dialog like Ask Password dialog and other non-modal dialogs. > > > > > > > > This is a work in progress of course and not all planned features a= re > > > > not implemented. I would like to add a autohide timeout to the > > > > widget. I tried to add FadeIn animation. > > > > > > > > I would like comments and suggestion about for this widget. > > > > > > Here a updated patch ready to be comitted on tomorrow (kdelibs > > > breakage) > > > > Looks okay to me. Here's some more feedback on the API: > > > > * I suggest to replace setIconName(const QString &name) with just a > > second setIcon overload that takes a QIcon. It's nice if a property > > called "icon" also takes the native icon type :) > > > > * I also wouldn't make setIcon a slot. I've never seen a signal that > > emits an icon :) > > > > * I suggest to rename the timeout property (what's a timeout a label?) = to > > autoHideTimeout (aha!). > > > > And of course the obligatory question for kdelibs inclusion at the end: > > Which applications are using this widget (either at the moment or in the > > near future)? > > > > > > Simon > > New patch based on your suggestion Simon. > > I'll try to make use of this widget where it is needed to replace modal > message box used in wrong contextes. I needed that for a dialog in Kopete > at least and kdesu will make good use of it :) > > Just think every dialog that ask a password, it will be able to display t= he > error meessage right in the dialog in a nice way. i actually did exactly this in kpassworddialog recently: http://aseigo.blogspot.com/2007/02/nested-dialogs-suck.html so there's one more use case =3D) as for this: + setFrameShape(QFrame::StyledPanel); + setFrameShadow(QFrame::Plain); + setBackgroundRole(QPalette::Base); it's getting used a fair amount as the magic "pimp my information widget". = my=20 fear is that we'll change our mind on how this should be done in the future= =20 and then have to track down all instances of these three lines. perhaps=20 better would be a KDialog static method that would take a QWidget* and styl= e=20 it properly, e.g.: void KDialog::styleInformationDisplay( QWidget* w ) { QFrame* frame =3D qobject_cast(w); if ( frame ) { setFrameShape(QFrame::StyledPanel); setFrameShadow(QFrame::Plain); setBackgroundRole(QPalette::Base); } } finally, i hate to be the style nazi, but please ensure that code meant for= =20 kdelibs follows the kde style guidelines: http://techbase.kde.org/Policies/Kdelibs_Coding_Style =2D-=20 Aaron J. Seigo humru othro a kohnu se GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43 =46ull time KDE developer sponsored by Trolltech (http://www.trolltech.com) --nextPart2666566.rbAy7Kke6d Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBF9Zi41rcusafx20MRAsaQAJ9e/i0VuYNIskutAgN4VNeHvDMQ+QCfWmGO uQHGYdTxCLtYjgRaziVm6js= =37hq -----END PGP SIGNATURE----- --nextPart2666566.rbAy7Kke6d--