Skip to content

Commit

Permalink
DeskTop: Fix initial window size for list views
Browse files Browse the repository at this point in the history
Investigating #792 turned up a glitch in computing the bounding box
for list views. Rather than calculating the actual width of all lines,
a fixed width is used to ensure long dates fit. But this was applied
(1) after the bounding box was inflated and (2) by assigning to a
right edge rather than as a width.

This ensures that when a window is opened in list view (which happens
if the parent window is a list view) then the new window's horizontal
scrollbars will be inactive.
  • Loading branch information
inexorabletash committed Apr 14, 2024
1 parent a3923e2 commit 12e162b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Project Page: https://github.com/a2stuff/a2d
* Package now includes ProDOS 2.4.3 and BASIC.system 1.7.
* Improve appearance of buttons when clicked. c/o @buserror
* Fix corruption issues when replacing files with folders and folders with anything during copy.
* Fix initial window size calculation for list views so scrollbar is not shown. ([#792](https://github.com/a2stuff/a2d/issues/792))

### Launcher
* If starting from a folder, brand it as a system folder.
Expand Down
8 changes: 4 additions & 4 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -8114,15 +8114,15 @@ check_icon:
;; If there are any entries...
lda cached_window_entry_count
IF_NOT_ZERO
;; Add padding around bbox
MGTK_CALL MGTK::InflateRect, bbox_pad_iconbb_rect

;; List view?
jsr GetCachedWindowViewBy ; N=0 is icon view, N=1 is list view
IF_NEG
;; max.x = kListViewWidth
copy16 #kListViewWidth, iconbb_rect::x2
add16 iconbb_rect::x1, #kListViewWidth, iconbb_rect::x2
END_IF

;; Add padding around bbox
MGTK_CALL MGTK::InflateRect, bbox_pad_iconbb_rect
END_IF

rts
Expand Down
1 change: 1 addition & 0 deletions res/notes/testplan.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
* Launch DeskTop. Open a volume. File > New Folder..., create A. File > New Folder..., create B. Drag B onto A. File > New folder.... Verify DeskTop doesn't hang.

* Launch DeskTop. Open a window with files with dates with long month names (e.g. "February 29, 2020"). View > by Name. Resize the window so the lines are cut off on the right. Move the horizontal scrollbar all the way to the right. Verify that the right edges of all lines are visible.
* Launch DeskTop. Open a window containing a folder. View > by Name. Open the folder. Verify that in the new window, the horizontal scrollbar is inactive.

* Launch DeskTop. Double-click on a file that DeskTop can't open (and where no BASIS.SYSTEM is present). Click OK in the "This file cannot be opened." alert. Double-click on the file again. Verify that the alert renders with an opaque background.

Expand Down

1 comment on commit 12e162b

@xandark
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Please # to comment.