conwayste / conwayste

Multiplayer Conway's Game of Life (desktop app + server) implemented in Rust
https://conwayste.rs/
GNU General Public License v3.0
27 stars 3 forks source link

Checkbox Rect should contain all text inside it #89

Open AaronM04 opened 4 years ago

AaronM04 commented 4 years ago

Currently the Checkbox's label will overflow the Rect. The text should be cropped to fit inside the Rect. In no cases should anything be drawn outside of it. The checkbox itself should always be the largest square that fits on the left end of the Rect.

Also, it would be nice to have a shrink_to_fit method that would shrink the Rect to perfectly fit the checkbox+label combination. Parent widgets (like panes) could then call this and adjust the checkbox's position and/or their own size to neatly fit everything.

AaronM04 commented 4 years ago

What do you think @Manghi -- does this belong in 1.0 milestone? And does it deserve an easy label? :)

Manghi commented 4 years ago

Yes it does. Sorry this slipped my radar. As we discussed offline, the rectangle should either grow-to-fit or shrink-to-fit depending on Label's dimensions. We had also talked about multi-line support, but we can save that for another ticket.

AaronM04 commented 4 years ago

Actually I'm not 100% sure we want the label inside the checkbox widget. I keep thinking about the case where we want a grid with the labels on one side (left, probably) and the corresponding input widgets on the other side (right, probably).

Manghi commented 4 years ago

That makes a lot more sense to be honest. The case I was covering was being able to click on the label and have the checkbox toggle as well -- this is a pretty common feature of checkboxes across several platforms. I think with what you described, the overall "grid" would receive on click event and then process the state of its child, the checkbox.

Manghi commented 4 years ago

Should be doable after #94 is merged