Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use list canvas item version 2 for data panel, optimized #1251

Merged
merged 5 commits into from
Nov 13, 2024

Conversation

cmeyer
Copy link
Collaborator

@cmeyer cmeyer commented Nov 13, 2024

  • Repaint image canvas item children only within visible rect.
  • Reuse TestUI.UserInterface in tests. Important for strict data panel testing.
  • Improve error handling during display data computation (ignore the error).
  • Update data panel to use list canvas item 2 for optimized drawing.

The first commit updates the image display to use the visible rect painting optimization. The next two commits are prep for the last commit, which changes the data panel to use the new list canvas item v2, with optimized drawing.

To test this, you will need nion-software/nionui#88

Possible test procedure:

DATA-PANEL-1. Test data panel functionality.

  1. Create a project with several data items.
    1.1. Data panel shows list of items and scroll bar, filling data panel width and height.
  2. Use scroll bar to change position.
    2.1. Display items scroll with scroll bar.
  3. Click on a display item to select.
    3.1. Display item is selected.
  4. Shift-click on another display item more than one away to select range.
    4.1. Display items in range are selected.
  5. Command-click on a selected and deselected display item.
    5.1. Command clicking should toggle selection.
  6. Press delete key with one item selected.
    6.1. Selected item should be deleted.
  7. Press delete key with more than one item selected.
    7.1. All selected items should be deleted.
  8. Mouse over one display item.
    8.1. Tool tip should be shown.
  9. Click-drag on a display item and drag to display panel.
    9.1. Display item should be shown in display panel.
  10. Click on display item. Press up and down arrow.
    10.1. Selected display item should change.
  11. Click on display item. Press up and down arrow with shift key down.
    11.1. Selected display items should be extended up or down depending on key.
  12. If using trackpad, two finger drag to scroll.
    12.1. Selected display items should scroll.
  13. Open project with smal number of display items.
    13.1. Confirm no thumb appears in scroll bar.
  14. Add display items until more than will fit in data panel.
    14.1. Confirm thumb appears in scroll bar.

…ror).

The errors are raised with invalid data. The tests do not raise errors
unless thumbnails are computed. The new data panel will compute thumbnails
more quickly and trigger the errors.
@cmeyer cmeyer changed the title 2024 11 06 new data panel items Use list canvas item version 2 for data panel, optimized Nov 13, 2024
@cmeyer cmeyer marked this pull request as ready for review November 13, 2024 03:41
Copy link
Contributor

@KRLango KRLango left a comment

Choose a reason for hiding this comment

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

LGTM

This issue was revealed by the tests and the faster data panel.
This fix just converts the RGB data to grayscale and then continues
as normal. It is a hack but reasonable since it hasn't come up as a bug
until now.
@cmeyer cmeyer merged commit 41b9b6f into nion-software:master Nov 13, 2024
11 checks passed
@cmeyer cmeyer deleted the 2024-11-06-new-data-panel-items branch November 13, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants