CGCookie / addon_common

GNU General Public License v3.0
41 stars 7 forks source link

ui.collection title not showing #18

Open talmazov opened 4 years ago

talmazov commented 4 years ago

Using the following code self.ui_outline_container = ui.collection(label="Outline Properties", parent = self.main_menu) self.ui_outline_container.builder([...])

does not produce a text label within the UI collection container 92367867_269282320745797_7731682336781107200_n

vxlcoder commented 4 years ago

sadly, some of the UI collections need some work still. i haven't found a good way to handle it generally, so i might just resort to creating special UI elements. (note: the fns under ui are just factories, building up UI and UI_Proxy objects).

talmazov commented 4 years ago

so playing around with ui.py i got collections to show a label but now the text is black and hard to see image

here is the code below:

    kw_inside = helper_argsplitter({'children'}, kwargs)
    ui_container = UI_Element(tagName='div', classes='collection', **kwargs)
    ui_label = UI_Element(tagName='label', classes='header', innerText="TEST", parent=ui_container)
    ui_inside = UI_Element(tagName='div', classes='inside', parent=ui_container, **kw_inside)
    ui_proxy = UI_Proxy(ui_container)
    ui_proxy.map(['children','append_child','delete_child','clear_children', 'builder'], ui_inside)
    return ui_proxy

I've been trying to play around with ui_defaultstyles.css but can't seem to get it to work any way to over-ride the text color directly in python might work? suggestions? also noticed the same for input text area, hence why i am inclined to believe it is a CSS issue

vxlcoder commented 4 years ago

you can add style="color:white" as a parameter to the UI_Element(...) call to give ultimate override.

important note: the CSS is handled differently than actual CSS in certain ways. One different way in particular, which might be the problem you're running into, is that addon_common's CSS has no notion of specificity (https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity). all conflicting stylings are handled in order, as if there was a !important at the end of each line. eventually I'd like to have specificity. it was too difficult to work in at the moment.

talmazov commented 4 years ago

this worked beautifully, thank you! I'll push the label and collection factories to addon_common repo so we can close this issue

patmo141 commented 4 years ago

Great! We can see if the subtree setup worked appropriately!

On Thu, Apr 16, 2020 at 1:11 PM talmazov notifications@github.com wrote:

this worked beautifully, thank you! I'll push the label and collection factories to addon_common repo so we can close this issue

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CGCookie/addon_common/issues/18#issuecomment-614780236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWIK36RLZGH3TJU5CCBOMDRM432RANCNFSM4MCXTEWQ .