-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add origin options to FormSpec labels #8658
Conversation
Can this, along with #8665, #8652, and #8646 be added to the formspec merging list (https://github.com/minetest/minetest/projects/6)? I know there are a lot of formspec PRs, but I think it's best for all formspec changes to be made in a single release since they require a client update for them to work properly. Don't worry, I don't have too many left to do ;-) |
8bc4629
to
8987f07
Compare
Seems to be actively worked on so removing 'possible close' label. Or was there a reason for that? |
0fabbaf
to
9027b4c
Compare
This PR is now Ready for Review I've added support for |
10ac4d6
to
31795a0
Compare
Hmm, this seems way too complicated for label elements. Even being an avid developer with formspecs myself, I would honestly never use 90% of the options in this PR. As I recall, #7613 just asked for basic left, centere, and right alignment, I cannot imagine many use-cases where people require more sophisticated fine-control just to position labels above or beside a field. I get the impression the overall feature set of formspecs is very off-balance and lacks an agreed-upon vision for the future. Is there not an official roadmap posted somewhere? For example, I just saw a feature request for embedding any kind of content inside buttons. It's still not even possible to dynamically update formspecs in the client, yet apparently we'll be able to have buttons that can have entire mini-formspecs in them. That doesn't make any sense O_o I seem to recall Rubenwardy had an issue opened awhile back for refactoring the entire formspec backend. I guess that's not happening now that the goal is just randomly adding cool and fun features. |
The extra features are required in order to retain compatibility and consistency. But you could remove the many *line alternatives and literally only have left/center/right/legacy. This is what I suggested, adding the rest could be considered going overboard There's still no consensus on a refactor (#9358), I received no response to my suggestion |
Sure it does. It's an easy feature that's impossible for mods to properly hack in with the current API, and the necessary backend work lays the API groundwork for a larger and more important feature--allowing tabs to have 'pages' of content instead of forcing a re-send every tab change. Dynamically updating formspecs is super important, but it requires significant design and implementation effort to get in and is more in the 'concept phase' than anything else. Expecting people to be working on something that isn't actually hashed out fully is a great way to make bad API decisions--something that Minetest suffers greatly from as-is. |
I personally consider the |
I think I should probably clarify my rationale for making the See the label with newlines over the buttons? Try aligning that without the I realize that non- I can remove the The character alignment variation of the |
I was mulling over this PR a bit yesterday, and I think I've revised my position on whether or not this should be merged. It seems pretty certain that sized labels with As a result, I think I will close this PR and create one for aligned sized labels after the very simple #9755 is merged to minimize conflicts. It would probably have Edit: And it would be able to support the old coordinate system for, say, a textarea's units. I won't act without feedback, though, so I would appreciate any anyone could give me. |
Thanks for being receptive to my feedback v-rob. And sorry if I kind of lashed out with so many criticisms before. I value the work you do, and this PR (at least in its earlier state) had the exact feature-set that I'd dreamed about for years. So it's not for lack of appreciation of the concept. It's moreso that I just feel it's important that formspecs have at least remain balanced as possible when it comes to capabilities vs. complexity. I tend to feel that a generic API that solves at least the most common use-cases, while still accommodating edge-cases via documented workarounds, is usually the most elegant solution. Hope that makes sense :) |
Note: This PR is closed due to bad implementation. A new one will be worked on after #9755 is merged (or rejected for some reason).
This PR allows the
label
andvertlabel
elements in FormSpecs to have origin set and custom newline spacing. This closes #7613. It adds three new styling options tolabel
andvertlabel
:From
lua_api.txt
:left
: Left side of the bounding boxcenter
: Center of the bounding boxright
: Right side of the bounding boxleftline
(vertlabel only): Left end of first columncenterline
(vertlabel only): Center of first columnrightline
(vertlabel only): Right end of first columnDefault
left
for label andcenterline
for vertlabel.top
: Top of the bounding boxcenter
: Center of the bounding boxbottom
: Bottom of the bounding boxtopline
(label only): Top of first linecenterline
(label only): Center of first linebottomline
(label only): Bottom of first lineDefault
centerline
for label andtop
for vertlabel.the number is prefixed with
*
, the spacing is set to a multiple of thelabel's font height or width, otherwise it's in coordinates. Default
0.5
.In addition to these styling options, newlines have been added to
vertlabel
since it didn't previously support this. Each newline moves the text to the right, unless, of course, it's negative.A nice side effect of how it is implemented is that the
label
andvertlabel
rects are as tall as the text height as opposed to a full coordinate as it is currently. This also makes it so that it will work with really gigantic fonts as well as normal ones.Screenshot
A picture's worth a thousand words, so here you go:
The gray dots show where the label position is.
To do
This PR is Ready to Review.
How to test
It's very long
This is the above screenshot: