[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] PATCH: KDateEdit
From:       David Jarvie <lists () astrojar ! org ! uk>
Date:       2002-11-16 20:37:49
[Download RAW message or body]

Once KDateEdit arrow has been clicked to display the date picker popup, it 
currently remains showing the pressed state, and never reverts to the 
unpressed state. In some styles, this is very noticeable to the user, and is 
at odds with the behaviour of a normal combo box. Here is a patch to make it 
revert to the unpressed state after being clicked. I would like to see this 
go into KDE 3.1 if there is still time.

Please review so that I can commit it.

-- 
David Jarvie


Index: kdateedit.cpp
===================================================================
RCS file: /home/kde/kdepim/libkdepim/kdateedit.cpp,v
retrieving revision 1.15
diff -u -r1.15 kdateedit.cpp
--- kdateedit.cpp       2002/11/13 16:27:41     1.15
+++ kdateedit.cpp       2002/11/16 20:38:54
@@ -24,6 +24,7 @@

 #include <qevent.h>
 #include <qlineedit.h>
+#include <qlistbox.h>

 #include <kdatepicker.h>
 #include <knotifyclient.h>
@@ -158,6 +159,11 @@
   }

   mDateFrame->show();
+
+  // The combo box is now shown pressed. Make it show not pressed again.
+  listBox()->setCurrentItem(0);
+  QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0, 0);
+  QApplication::postEvent(listBox(), keyEvent);
 }

 void KDateEdit::dateSelected(QDate newDate)
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic