#1 Gspöt2

Open
opened 6 years ago by pgimeno · 3 comments

Gspöt2

This is to track the changes for what is going to become Gspöt2.

Goals

  • To make enhancements that may break backwards compatibility, and at the same time get rid of legacy stuff.
  • To have a base to work on that is better understood and makes it easier to implement new features.
  • Keep compatibility with love2d 0.9.1 as long as it keeps being a small effort.

Proposed changes

  • Implement a proper hierarchy of containers. The parent of an element should clip the element to its boundaries, or alternatively, let the user decide whether a control should clip or not as an element property (clip = true or false). In the end it's all about whether to intersect the parent's clip rect with the child's or not.
  • Get rid of the elements array. The structure will instead be a tree. The elements without a parent will be in a children list in the Gspot object; each element already has a children array. The order in the children array will determine the draw order (if that doesn't conflict with the above).
  • Get rid of the legacy idnew etc.
  • Rethink keyboard repeat. Implement repetition in software, or get rid of it altogether, or simplify usage (element repeats / does not repeat).
  • Try to minimize garbage creation (remove as many functions and tables created on the fly as possible).
  • Rethink pos objects. It's a misname, as they indicate a rectangle or a circle, not just a point. Possibly rename them, or replace them with something else, as they create garbage.
  • Remove the remaining 0.8 stuff.
  • Make the module return a function to create a new Gspot instance, instead of a pre-created instance of the object like now. It's cleaner and suggests to the user that more can be created.

Proposed new features that depend on these changes

  • Change the parent of an element (element:setparent()).
  • Always-on-top setting for elements. Suggested implementation is to keep a list of always-on-top elements, which will be drawn in front of the normal ones, but treated the same otherwise.
  • Let an element capture the mouse.
  • Keyboard navigation.
  • Label alignment.
  • Even if not allowing an element to be outside the boundary of its parent, it's still useful to have controls whose position is defined relatively to other controls. A possible solution is to have an attach property, similar to parent. Another one is the alternative mentioned above of having a clip property.
  • Include example themes. I've been doing some work on one that looks like Goo.
  • Update the documentation.

Questions

  • What would you add, change or remove from the list above? Is there anything else that you would like Gspöt to have, but it's difficult with the current organization? Is there anything you don't agree with? Difficult to accomplish or maintain? Something that has technical flaws?
  • Should it be in a new repository? One immediate advantage of doing so would be the separation of documentation.
## Gspöt2 This is to track the changes for what is going to become Gspöt2. ## Goals - To make enhancements that may break backwards compatibility, and at the same time get rid of legacy stuff. - To have a base to work on that is better understood and makes it easier to implement new features. - Keep compatibility with love2d 0.9.1 as long as it keeps being a small effort. ## Proposed changes - [ ] Implement a proper hierarchy of containers. The parent of an element should clip the element to its boundaries, or alternatively, let the user decide whether a control should clip or not as an element property (`clip` = `true` or `false`). In the end it's all about whether to intersect the parent's clip rect with the child's or not. - [ ] Get rid of the `elements` array. The structure will instead be a tree. The elements without a parent will be in a `children` list in the Gspot object; each element already has a `children` array. The order in the `children` array will determine the draw order (if that doesn't conflict with the above). - [ ] Get rid of the legacy `idnew` etc. - [ ] Rethink keyboard repeat. Implement repetition in software, or get rid of it altogether, or simplify usage (element repeats / does not repeat). - [ ] Try to minimize garbage creation (remove as many functions and tables created on the fly as possible). - [ ] Rethink `pos` objects. It's a misname, as they indicate a rectangle or a circle, not just a point. Possibly rename them, or replace them with something else, as they create garbage. - [ ] Remove the remaining 0.8 stuff. - [ ] Make the module return a function to create a new Gspot instance, instead of a pre-created instance of the object like now. It's cleaner and suggests to the user that more can be created. ## Proposed new features that depend on these changes - [ ] Change the parent of an element (`element:setparent()`). - [ ] Always-on-top setting for elements. Suggested implementation is to keep a list of always-on-top elements, which will be drawn in front of the normal ones, but treated the same otherwise. - [ ] Let an element capture the mouse. - [ ] Keyboard navigation. - [ ] Label alignment. - [ ] Even if not allowing an element to be outside the boundary of its parent, it's still useful to have controls whose position is defined relatively to other controls. A possible solution is to have an `attach` property, similar to parent. Another one is the alternative mentioned above of having a `clip` property. - [ ] Include example themes. I've been doing some work on one that looks like [Goo](https://pgimeno.github.io/Goo). - [ ] Update the documentation. ## Questions - What would you add, change or remove from the list above? Is there anything else that you would like Gspöt to have, but it's difficult with the current organization? Is there anything you don't agree with? Difficult to accomplish or maintain? Something that has technical flaws? - Should it be in a new repository? One immediate advantage of doing so would be the separation of documentation.
LJNIC commented 6 years ago

Hello, thank you for maintaining this great library. One feature I've added in my personal version is highlighted foreground (just for buttons), because I wanted my button's text colour to change when hovered over. Also, a way to navigate between menu items with a keyboard would be nice. Finally, I've been having trouble centering text labels, so something to that end would be nice unless there is something I'm missing.

P.S Thanks for introducing me to this site, it's wonderful.

Hello, thank you for maintaining this great library. One feature I've added in my personal version is highlighted foreground (just for buttons), because I wanted my button's text colour to change when hovered over. Also, a way to navigate between menu items with a keyboard would be nice. Finally, I've been having trouble centering text labels, so something to that end would be nice unless there is something I'm missing. P.S Thanks for introducing me to this site, it's wonderful.
Pedro Gimeno commented 6 years ago
Owner

Thanks for your tips. I've added Keyboard Navigation and Label Alignment to the list of features to add.

I'm hesitant about highlighted foreground. It sounds like something that won't be requested too often, and easy enough to implement by users (either by modifying the lib or by other means).

Thanks for your tips. I've added Keyboard Navigation and Label Alignment to the list of features to add. I'm hesitant about highlighted foreground. It sounds like something that won't be requested too often, and easy enough to implement by users (either by modifying the lib or by other means).
Pedro Gimeno commented 5 years ago
Owner

Copying over the last remaining posts from GitHub

Post by SiENcE, 15 Mar 2017 9:53 CET

I made several bugfixes to gspot and also added richtext support as well as a richtext typetexter.

https://github.com/SiENcE/Gspot

I use this lib for a bigger project, so every change had a reason. For me gspot is the most flexible and smallest love2d gui.

Copying over the last remaining posts from GitHub ##### Post by SiENcE, 15 Mar 2017 9:53 CET I made several bugfixes to gspot and also added richtext support as well as a richtext typetexter. https://github.com/SiENcE/Gspot I use this lib for a bigger project, so every change had a reason. For me gspot is the most flexible and smallest love2d gui.
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.