bright-gpu-74537
04/17/2022, 12:47 PMbest-agent-85158
04/17/2022, 12:49 PMbest-agent-85158
04/17/2022, 12:49 PMbright-gpu-74537
04/17/2022, 12:50 PMbest-agent-85158
04/17/2022, 12:51 PMbright-gpu-74537
04/17/2022, 12:51 PMbest-agent-85158
04/17/2022, 12:52 PMbest-agent-85158
04/17/2022, 12:52 PMbright-gpu-74537
04/17/2022, 12:53 PMbest-agent-85158
04/17/2022, 12:57 PMbright-gpu-74537
04/17/2022, 12:58 PMbright-gpu-74537
04/17/2022, 12:58 PMbest-agent-85158
04/17/2022, 1:01 PMbright-gpu-74537
04/17/2022, 1:01 PMbright-gpu-74537
04/17/2022, 1:04 PMbest-agent-85158
04/17/2022, 1:24 PMbest-agent-85158
04/17/2022, 1:24 PMrefined-greece-48002
04/17/2022, 1:25 PMbest-agent-85158
04/17/2022, 3:17 PMColumnfull-journalist-82607
04/17/2022, 3:30 PMfull-journalist-82607
04/17/2022, 3:31 PMbest-agent-85158
04/17/2022, 3:56 PMapplyTo function i was talikng about:
haxe
public function applyTo(components:Rest<Component>) {
for (c in component) c.customStyle = this;
}best-agent-85158
04/17/2022, 3:57 PMhaxe
var s:Style = {padding: 5, verticalAlign: "center"}
s.applyTo(vbox, hbox, mygrid, image1, image2);best-agent-85158
04/17/2022, 4:02 PMbright-gpu-74537
04/17/2022, 4:41 PM#vbox, #hbox, #mygrid, #image1, #image2 {padding: 5, verticalAlign: "center"}.
But if people are happier using a code only approach, its no skin off my nose 🙂
That said, i do think it should be a static extension rather than in the Style class, it keeps it simple and its also an explicit "using" then which means we dont have to care so much about compatibility issues (like for example i dont think rest args are supported on haxe3, or even all versions of 4)best-agent-85158
04/17/2022, 4:45 PMbest-agent-85158
04/17/2022, 4:47 PMStyle class:bright-gpu-74537
04/17/2022, 4:48 PMbright-gpu-74537
04/17/2022, 4:48 PMbest-agent-85158
04/17/2022, 4:49 PM#if (haxe_ver > version("4.2"))