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

List:       kde-commits
Subject:    kdelibs/khtml/rendering
From:       Mario Weilguni <mweilguni () sime ! com>
Date:       2005-03-15 18:05:17
Message-ID: 20050315180517.E810712E73 () office ! kde ! org
[Download RAW message or body]

CVS commit by mario: 

BUG:97796
RadioButtons do not call their onChange trigger anymore if they are
unchecked, only when they are checked. The triggers are no longer called
in the initialization phase (e.g. the checked attribute)

This is not a perfect solution, since the specs say that onChange trigger 
should fire when focus is lost, however, it's the same behaviour as Firefox
has. MSIE seems to follow the specs here and is slightly different.


  M +10 -4     render_form.cpp   1.285


--- kdelibs/khtml/rendering/render_form.cpp  #1.284:1.285
@@ -163,4 +163,8 @@ RenderRadioButton::RenderRadioButton(HTM
     b->setMouseTracking(true);
     setQWidget(b);
+
+    // prevent firing toggled() signals on initialization
+    b->setChecked(element->checked());
+
     connect(b,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
 }
@@ -186,9 +190,11 @@ void RenderRadioButton::calcMinMaxWidth(
 }
 
-void RenderRadioButton::slotToggled(bool)
+void RenderRadioButton::slotToggled(bool activated)
 {
+    if(activated) {
     ref();
     element()->onChange();
     deref();
+    }
 }
 


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

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