Closed Bug 71770 Opened 23 years ago Closed 23 years ago

Outliner widget: need to hide scrollbars when they aren't needed

Categories

(Core :: XUL, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: mscott, Assigned: bryner)

References

Details

Attachments

(5 files)

From our messenger to-do list:
49) When the thread pane can display all the message headers then the scroll bar
should disappear.
 Currently the scroll bar remains although the widget to move the focus up or
down is not present.
 The folder pane works as expected. 

If the outliner view is small enough that scrollbars aren't required I think the
outliner widget needs to hide it's scrollbar.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Giving arik some work.
Assignee: hyatt → arik
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
r=dr
OS: Windows NT → All
Hardware: PC → All
(1) No curly braces with single lines in if/else.
(2) Change NS_IMETHODIMP in the header and cpp to nsresult.
(3) Use PRBool as the arg to your new function
(4) Change arg from setVisible to aSetVisible
(5) Add an Invalidate() call following the changing of the scrollbar visibility.

Attached patch take 2Splinter Review
Target Milestone: mozilla0.9 → mozilla0.9.1
Nits, answer for my edification if you like:

+  
+    if (rowCount < mPageCount)
+      SetVisibleScrollbar(PR_FALSE);
+    else
+      SetVisibleScrollbar(PR_TRUE);

My favorite kind of if statement -- how about just 'SetVisibleScrollbar(rowCount
>= mPageCount);' instead?

Isn't the new string-fu to use NS_LITERAL_STRING("true") here:

+    nsAutoString visible; visible.AssignWithConversion ("true");
+    scrollbarContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed,
visible, PR_TRUE);

eliminating the need for an nsAutoString and (on savvy platforms) a converting
copy altogether?

/be
i am not sure what you mean about the if statement...
*** Bug 76466 has been marked as a duplicate of this bug. ***
Arik, Brendan means that you can optimize your if statement to be
|SetVisibleScrollbar(rowCount>= mPageCount);|. Which in words mean: Set the
scrollbar to be visible if rowCount is greater or equals mPageCount.

Clearer now?  :)
Keywords: patch
->P3/0.9.2
Priority: -- → P3
Target Milestone: mozilla0.9.1 → mozilla0.9.2
I'll take this one.  It's making the outliner filepicker look particularly bad.
Assignee: arik → bryner
Status: ASSIGNED → NEW
dr and brendan, can you re-review?  Thanks.
Status: NEW → ASSIGNED
Oops, meant to cc you guys.  Up for reviewing this again?
r=blake
Change the nsAutoString isVisible to isCollapsed.  NO change in logic 
required.  Just substitute the text.  sr=hyatt
checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verified.

thanks for fixing it!

cc laurel, I know this drove her nuts.
Status: RESOLVED → VERIFIED
the scroll bar will show up instantly (if I shrink the thread pane) but it 
disappears in 3 stages (if I grow the thread pane.)

want a new bug on that?
*** Bug 72278 has been marked as a duplicate of this bug. ***
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: