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

live-preview: Changing number type shouldn't create a property if one has not already been set. #7484

Open
NigelBreslaw opened this issue Jan 28, 2025 · 1 comment
Labels
a:live preview The Live preview of slintpad or the LSP (mT,bO) bug Something isn't working

Comments

@NigelBreslaw
Copy link
Member

Bug Description

As per #5929 you can scroll the list of visual properties with a touchpad or mouse wheel. If the cursor happens to pass over some combo boxes there values will change. This causes two issues:

  1. Unexpected change to value types e.g. px -> rem. Windows, Mac and Linux don't support scrolling comboboxes by default.
  2. If there was no value e.g. x was set to nothing. Changing from px -> rem now adds the property to the code e.g. x: 0rem causing the whole UI to change.

If I had not been recording a screencast I don't know how I would have even realised what had happened. There was enough lag between the changes and the live-preview updating it wasn't even clear what had happened. Just the app suddenly looked wrong and some new code had magically shown up. Even if the issue linked to at the top is fixed we probably should not be adding in code when there is no property but you change the type? @szecket

Image

Reproducible Code (if applicable)

Environment Details

  • Slint Version: n/a
  • Platform/OS: n/a
  • Programming Language: n/a
  • Backend/Renderer: n/a
  • Slint extension live-preview: production and nightly.

Product Impact

No response

@NigelBreslaw NigelBreslaw added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Jan 28, 2025
@hunger hunger added a:live preview The Live preview of slintpad or the LSP (mT,bO) and removed need triaging Issue that the owner of the area still need to triage labels Jan 28, 2025
@szecket
Copy link
Member

szecket commented Jan 28, 2025

Agreed that this is ungood. At the very least making the value not change if the unit changes is a good start. Using the scrollbar is an inelegant solution.
Is it possible to only use scroll or the select is open? That would be the best solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:live preview The Live preview of slintpad or the LSP (mT,bO) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants