Coder Social home page Coder Social logo

Comments (2)

geom3trik avatar geom3trik commented on June 12, 2024 2

When using the grid layout type you need to define your rows and columns for the parent and then each child needs a row_index, row_span, col_index, and col_span. The spans default to 1 if you don't specify them but you do need to specify the indices.

Looking at the Style struct in kayakui I can't see these grid properties so it's possible they're not supported. In case I am wrong though it works something like this (pseudocode):

// Properties on parent
layout_type(LayoutType::Grid);
grid_rows(vec[Stretch(1.0), Stretch(1.0), Stretch(1.0)]);  // Grid will have 3 stretch rows
grid_cols(vec[Pixels(300.0), Stretch(1.0), Stretch(1.0)]); // Grid will have one fixed column and 2 stretch columns

// Properties on children
col_index(0);
col_span(1);
row_index(0);
row_span(2);
^ child will be positioned in the first grid cell (top-left), span one column and 2 rows

The bug here is that the layout fails when these properties aren't set. Probably the defaults should be changed so that the layout doesn't fail.

from kayak_ui.

StarArawn avatar StarArawn commented on June 12, 2024

This looks like code inside of the layout library we use called morphorm. We might be able to update the dependency to fix.

from kayak_ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.