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

Fix table editing redraw code on all platforms. #507

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

szanni
Copy link

@szanni szanni commented Aug 25, 2020

Pretty much all information in the commit message. No
uiTableModelRowChanged was emitted on any of the changes when
editing cells in uiTable:

This fixes bugs on all platforms not calling uiTableModelRowChanged()
when setting a new value in edit mode. This is now automatically
done in uiprivTableModelSetValue() so that ALL uiTable views are
informed about the update.

Darwin and windows did some custom redrawing which hid this bug.
Unix does frequent unrelated redraw which hide the bug. It can often
be experienced when double clicking a checkbox.

szanni added 2 commits August 25, 2020 13:32
This fixes bugs on all platforms not calling uiTableModelRowChanged()
when setting a new value in edit mode. This is now automatically
done in uiprivTableModelSetValue() so that ALL uiTable views are
informed about the update.

Darwin and windows did some custom redrawing which hid this bug.
Unix does frequent unrelated redraw which hide the bug. It can often
be experienced when double clicking a checkbox.
We are changing the value, update the row!

There are several uses for setting NULL values, IMO all abusing the
API for different causes. Fix those API abuses instead:

- This will cause one unneeded redraw when clicking on table column
  buttons as they signal a click through setting NULL. Possibly use
  a dedicated callback handler for that instead?
- This will fix resetting colors to default, as this is signaled
  through a NULL value.
@szanni
Copy link
Author

szanni commented Aug 27, 2020

OK, I updated the PR removing the early abort to not trigger an uiTableModelRowChanged call when setting NULL.
Not only do button columns use a NULL value, so do color columns... as I found out doing some further code digging.

IMO we should call a uiTableModelRowChanged in any case because we are setting a value so the row technically changed!
API abuses to trigger other functionality should be fixed at its root. For example providing a callback handler for a button column or something.

szanni added a commit to szanni/libui that referenced this pull request Aug 27, 2020
The SetCellValue() when clicking a checkbox within a uiTable is
never called. The UI happiliy updates suggesting the value has
been set - which is not actually the case.

The checkbox not redrawing with the actual check box value from
the model is another related issue, see andlabs#507.
szanni added a commit to szanni/libui that referenced this pull request Aug 27, 2020
The SetCellValue() when clicking a checkbox within a uiTable is
never called. The UI happiliy updates suggesting the value has
been set - which is not actually the case.

The checkbox not redrawing with the actual check box value from
the model is another related issue, see andlabs#507.
szanni added a commit to szanni/libui that referenced this pull request Dec 1, 2021
The SetCellValue() when clicking a checkbox within a uiTable is
never called. The UI happiliy updates suggesting the value has
been set - which is not actually the case.

The checkbox not redrawing with the actual check box value from
the model is another related issue, see andlabs#507.
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.

1 participant