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

Tabbed document UI example with elm #237

Open
wants to merge 102 commits into
base: main
Choose a base branch
from

Conversation

hydra
Copy link
Contributor

@hydra hydra commented Jan 10, 2025

This is an example of a desktop productivity-style application.

image

It was developed after attempting the same thing in multiple different GUI frameworks, including: Freya, Floem, Vizia, MakePadUI, Iced. The full requirements for the example is in this PR, not all of which are currently met or implemented, however this example is probably useful for those new to Cushy wanting to see an example of a more complex application instead of trivial 'widget' examples.

A livestream video series is available on YouTube of the process and issues encountered.

https://www.youtube.com/playlist?list=PLUCLWCDEWm8g7pHKQGE7Pokk4wiVU8rLl

A comparison spreadsheet related to this investigation can be found here:

https://docs.google.com/spreadsheets/d/1cxH_GgzrGDpXm4CN0cWvQ9RF_PLf6HEvVYcZhqOO0nc/edit?usp=sharing

Additionally, it borrows the 'ELM' approach featured in Iced, that is, user-interactions generate messages, and the state of the application is then updated by the message handlers, instead of directly in on_click handlers, and then the UI updates itself based on the new state.

Notes:

  • Maybe this PR does some things incorrectly as a result of the author's inexperience with Cushy.

hydra added 30 commits January 10, 2025 14:32
… handle tab button highlighting.

Issues:
* the first tab always has a solid background, no idea why.
…ot_map for the tabs.

There's no `on_selected` for `Select`, attempted to use `for_each` on the Dynamic<TabKey>

Issues:
* Tabs don't display any content.
* First added tab is not selected by default.
Issues:
* Rendering issues when using `with` without `height`, but don't want to specify a height.
Issues:
* selected tab background color is not correct.
Issues
* Config is not saved because control is not returned to `main()` by Cushy.
… passed around. Update tab API to take a context argument.
hydra added 30 commits January 10, 2025 14:34
…t in a container.

* Doesn't work, FIXME added.
* Some cosmetic.
* Some required after rebasing on `upstream/main`.
* temporarily duplicating some items to test sidebar.
* Should use the theme colors. Probably needs to be turned into a wrapping widget so it can access the context to get the theme.
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