addon_common icon indicating copy to clipboard operation
addon_common copied to clipboard

ui.collection title not showing

Open talmazov opened this issue 5 years ago • 5 comments

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

talmazov avatar Apr 07 '20 02:04 talmazov

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).

vxlcoder avatar Apr 08 '20 14:04 vxlcoder

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

talmazov avatar Apr 15 '20 06:04 talmazov

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.

vxlcoder avatar Apr 15 '20 12:04 vxlcoder

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

talmazov avatar Apr 16 '20 17:04 talmazov

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

On Thu, Apr 16, 2020 at 1:11 PM talmazov [email protected] 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 .

patmo141 avatar Apr 16 '20 17:04 patmo141