Closed
Bug 195722
Opened 23 years ago
Closed 22 years ago
Want simple event when splitter finishes drag or grippy clicked
Categories
(Core :: XUL, enhancement)
Tracking
()
RESOLVED
FIXED
People
(Reporter: neil, Assigned: jag+mozilla)
Details
Attachments
(2 files, 3 obsolete files)
2.94 KB,
patch
|
janv
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
2.87 KB,
patch
|
Details | Diff | Splinter Review |
When a splitter finishes drag you can sort of tell by trapping the mouseup
event. When a grippy is clicked you can sort of tell by trapping the click
event. Unfortunately the click event happens before the click action, so that
the actual state of the splitter is reversed.
By reversing the timing of the click action and event and adding a command event
to the splitter's mouseup event then the splitter state can be guaranteed to be
current for a command event handler on the splitter.
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Updated•23 years ago
|
Attachment #116087 -
Flags: superreview?(bzbarsky)
Attachment #116087 -
Flags: review?(jaggernaut)
![]() |
||
Comment 2•23 years ago
|
||
Comment on attachment 116087 [details] [diff] [review]
Proposed patch
1) Please document in this code why the event ordering has to be the way you're
making it.
2) Where is it documented that the command event is what one should trigger
off? Should this be a comment in some XBL? Should this be in the XUL widget
behavior documentation we have (we _do_ have some, right?)
3) just test for |splitter| instead of |splitter != nsnull|.
4) A diff -w would be much easier to review. ;)
Reporter | ||
Comment 3•23 years ago
|
||
1) Please document in this code why the event ordering has to be the way you're
making it.
You mean in the grippy code, right? Added:
// update the splitter first, in case someone's listening on the command event
2) Where is it documented that the command event is what one should trigger
off? Should this be a comment in some XBL? Should this be in the XUL widget
behavior documentation we have (we _do_ have some, right?)
I chose command because grippys already generate command events. This means that
you can write a command event handler on the splitter to watch for all splitter
adjustment notifications. I'll see what XUL documentation we have (if any :-)
3) just test for |splitter| instead of |splitter != nsnull|.
As you can tell I just reversed the sense of the test, I assumed that if style
was to use (splitter == nsnull) then it was to use (splitter != nsnull).
4) A diff -w would be much easier to review. ;)
But then I wouldn't be able to point out my tab to space conversion :-P
![]() |
||
Comment 4•23 years ago
|
||
> I chose command because grippys already generate command events.
"Document that in the code". And yes, I mean the grippy code.
I know you were following "the style of the file" with the nsnull. Don't
please, in this case.
As for -w, the usual procedure is to attach both a normal diff and a -w one. ;)
Reporter | ||
Comment 5•23 years ago
|
||
![]() |
||
Comment 6•23 years ago
|
||
Comment on attachment 116197 [details]
diff -w
sr=bzbarsky with two more nits:
1) NS_NAMED_LITERAL_STRING(collapsed, "collapsed"); instead of the |nsString
a| we have now (what kind of variable name is "a"??)
2) Make "value" an nsAutoString.
Attachment #116197 -
Flags: superreview+
![]() |
||
Updated•23 years ago
|
Attachment #116087 -
Flags: superreview?(bzbarsky)
Reporter | ||
Comment 7•23 years ago
|
||
bz, rather than me trying to second-guess you, or you trying to read diffs that
don't have enough context because I used -w, the JS for that code is:
splitter.setAttribute("state", splitter.getAttribute("state") == "collapsed" ?
"open" : "collapsed");
So, if you can just let me know what that should be in C++ please...
![]() |
||
Comment 8•23 years ago
|
||
Ah, I had missed you toggling the value. In that case, just make it an
nsAutoString (and call it "state" or something instead of "a", ok? ;))
As for context:
cvs diff -u10 -w
will do what you want.... (and in fact that should be done even when not making
-w diffs).
Reporter | ||
Comment 9•23 years ago
|
||
Reporter | ||
Comment 10•23 years ago
|
||
For checkin purposes. Plus fixed typo in previous diff -w
Attachment #116087 -
Attachment is obsolete: true
![]() |
||
Updated•23 years ago
|
Attachment #116207 -
Flags: superreview+
Reporter | ||
Comment 11•22 years ago
|
||
Comment on attachment 116207 [details] [diff] [review]
Updated patch
review hokey-cokey
Attachment #116207 -
Flags: review?(varga)
Comment 12•22 years ago
|
||
Comment on attachment 116207 [details] [diff] [review]
Updated patch
r=varga
Attachment #116207 -
Flags: review?(varga) → review+
Reporter | ||
Comment 13•22 years ago
|
||
GetContent was changed, and I've been running with this revised diff since.
Attachment #116197 -
Attachment is obsolete: true
Attachment #116205 -
Attachment is obsolete: true
Reporter | ||
Comment 14•22 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
![]() |
||
Updated•22 years ago
|
Attachment #116087 -
Flags: review?(jag)
You need to log in
before you can comment on or make changes to this bug.
Description
•