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

uiImageView control #31

Open
cody271 opened this issue Jan 16, 2022 · 4 comments
Open

uiImageView control #31

cody271 opened this issue Jan 16, 2022 · 4 comments
Labels
old repo original andlabs/libui project

Comments

@cody271
Copy link
Contributor

cody271 commented Jan 16, 2022

Old PR

@AndyObtiva
Copy link
Contributor

AndyObtiva commented Mar 9, 2023

Thank you for continuing to maintain libui-ng. I recently worked on adding the newly implemented Table Selection API to Glimmer DSL for LibUI and it is almost ready for release.

Otherwise, we need this feature (image display support) very badly in Glimmer DSL for LibUI. I've gotten multiple requests for it including this new one. It seems everyone who wants to build a desktop application will end up needing to render an image in their application at one point. Is there any ETA for when it will be available!?

By the way, the way SWT handles this is by allowing us to display an image:

  • inside a canvas (like the libui area control)
  • inside a label (as a property on label)
  • as a background of a composite (equivalent of a box/grid in libui)
  • as application icon (shows up on ALT+TAB/CMD+TAB)
  • as a tab image-icon in a tab folder.

Displaying an image inside a canvas (area control) might be the one most needed initially. Eventually, it would be helpful if other uses of image are supported too gradually.

@cody271
Copy link
Contributor Author

cody271 commented Mar 25, 2023

It seems everyone who wants to build a desktop application will end up needing to render an image in their application at one point.

Yes absolutely, this is a sorely missing feature.

Is there any ETA for when it will be available!?

Basic uiImageView control, uiImage loading from file, and uiArea support are WIP.

By the way, the way SWT handles this is by allowing us to display an image:

  • as application icon (shows up on ALT+TAB/CMD+TAB)

App (and tray) icons are also a high priority. I'm not sure about the other image related feature requests listed.

@petabyt
Copy link

petabyt commented Dec 29, 2023

IMO uiImage and uiImageView would be confusing for new users. (Shouldn't it be uiImageControl?)
Also appending a uiImage to a box would cause a segmentation fault. This already has caused some confusion (#229)

Why not just turn uiImage into a widget?

uiImage *img = uiNewImage(64, 64);
uiImageFromFile(img, "ide/libui.png");
uiBoxAppend(vbox, uiControl(img), 0);

This would keep backwards compatibility with the current code (the uiImageFromFile API is a suggestion, probably needs improvement)

@AndyObtiva
Copy link
Contributor

I am not sure uiImageControl is better. We don’t say uiTableControl or uiEntryControl. The word control is redundant as almost everything is a control in this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
old repo original andlabs/libui project
Projects
None yet
Development

No branches or pull requests

3 participants