Giter Site home page Giter Site logo

parentid dont work about openhasp HOT 5 CLOSED

matsekberg avatar matsekberg commented on June 11, 2024
parentid dont work

from openhasp.

Comments (5)

fvanroie avatar fvanroie commented on June 11, 2024 1

Maybe in due time... but you can implement this too if you really needed it.
I have made the whole project open source so users can benefit and contribute alike...

from openhasp.

marsman7 avatar marsman7 commented on June 11, 2024

Your parent object has a size of zero (w=0 and h=0). The children must fit in it. When you change your object to :

{"page":4,"id":99,"obj":"btn","x":0,"y":0,"h"480,"w":320,"toggle":1,"bg_color90":"#880000","bg_color91":"#005500","bg_color92":"#00FF00","bg_color93":"#FF0000","text_font":24, "radius30":7}

All buttons are visible. But I don't think that's what you want. This is not an bug. It just doesn't work that way. Parents are normally TABVIEWS or PAGES but they don't save "bg_color90":"#880000" or "toggle":1 for example.

from openhasp.

matsekberg avatar matsekberg commented on June 11, 2024

My understanding from the documentation is that if the child has the same property as the parent, then the child will override.
X, y, h and w should be taken from the children.

I could try make the leftmost button a parent and the other children.

from openhasp.

fvanroie avatar fvanroie commented on June 11, 2024

Some properties (typically that are related to text and opacity) can be inherited, .i.e. not all properties are inheritable.
You need to set toggle, bg_color90,bg_color91,bg_color92,bg_color93,radius30 on each button individually.
There is no way to group styling properties in the way you are trying to achieve...

You can create a parent obj object and set the text_fontthere once. All x and y coordinates will be relative to the parent.

from openhasp.

matsekberg avatar matsekberg commented on June 11, 2024

Ok so me trying to use parent as a template won’t work that well.
And you see no reason to implement it that way?
In order to simplify the config file.

from openhasp.

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.