Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Layouts failed, try again #28

Closed
Fingercomp opened this issue Aug 20, 2018 · 1 comment
Closed

Layouts failed, try again #28

Fingercomp opened this issue Aug 20, 2018 · 1 comment
Assignees
Labels
housekeeping Refactoring, making things cleaner, etc wonderfully hard
Projects

Comments

@Fingercomp
Copy link
Member

At some point I hope I'll be making GridLayout. The major question here is, how am I going to insert children? Of course, the children list is always linear and ordered, as we have to traverse the tree somehow. But that list shouldn't be exposed.

For GridLayout, we want to use layout:insert(row, column[, rowSpan, columnSpan[, rowStretch, columnStretch]]) or something. We could make the optional parameters element attributes, even though I'm not fond of that idea... what about the row and column, then?

All right, then. function Element:insert(...) self.layout:insert(...) end it is. Is it?

But how should we move elements to other layout cells? Therefore, no. A huge, heavy, unconditional no. Even if we could do something about this concern, proxying is a hack — an unacceptable hack. We already have enough hacks in the code.

So, anyway, this is how I've come to realize that the current layout system makes no sense. I'd like to make layouts nodes of the document tree, as it's done in such major GUI toolkits as Qt and GTK+.

To make life easier, I want to keep scrolling magical and applied to every non-leaf element as it is right now. Doing a ScrollView means making some element be treated specially. Perhaps there's no point to allow users to override the scroll view, but I just don't like additional restrictions.

@Fingercomp Fingercomp added wonderfully hard housekeeping Refactoring, making things cleaner, etc labels Aug 20, 2018
@Fingercomp Fingercomp added this to the wonderful-core 0.1.0 milestone Aug 20, 2018
@Fingercomp Fingercomp self-assigned this Aug 20, 2018
@Fingercomp Fingercomp added this to To do in Wonderful via automation Aug 20, 2018
@Fingercomp Fingercomp moved this from To do to In progress in Wonderful Oct 20, 2018
@Fingercomp
Copy link
Member Author

This is what I think the new tree class hierarchy should be.

The new hierarchy of tree classes

I'm now refactoring the code to use it. It's already got way less hacky and much easier to understand.

Wonderful automation moved this from In progress to Done Nov 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
housekeeping Refactoring, making things cleaner, etc wonderfully hard
Projects
Wonderful
  
Done
Development

No branches or pull requests

1 participant