-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add [disabled] to submenu #86
Conversation
Only "disabled" the label of the submenu (greyed out text), but does not disable any child widgets nor does it prevent the submenu from expanding/collapsing. Should primarily help to visualise that a whole submenu can be ignored.
Hi. Thanks for the contribution and sorry for not answering earlier. I will review this as soon as I can and hope to upload a new LAM version before Wrathstone goes live. Regarding your description, wouldn't it be desirable to close and prevent the submenu from opening when it is disabled? |
Hi, yes this indeed was the originally desired behaviour. I tried to implement that and managed to block any interaction with the panel itself, but couldn't figure out how to also trigger the collapsing-animation in case the panel is in expanded state. Since it would be bad user experience if the panel interaction is disabled but stays expanded, I removed the first part again. In the meanwhile (for my own Add-On) I put the checkbox that enables/disables the submenu inside the panel itself. If it is closed you immediately see if the features under that topics are enabled or disabled (due to different text-color); and if you want to change it you anyway open it to check the other settings. So... I'm not sure now which should be the target behavior :) |
I'd prefer it to actually disable the interaction with the submenu. That way it is consistent with how the property works on other widgets. I haven't tried it yet, but calling the animation:PlayFromStart method when the menu is open should be all it takes to close it. local function UpdateDisabled(control)
local disable
if type(control.data.disabled) == "function" then
disable = control.data.disabled()
else
disable = control.data.disabled
end
if disable then
control.label:SetColor(ZO_DEFAULT_DISABLED_COLOR:UnpackRGBA())
if control.open then
control.animation:PlayFromStart()
end
else
control.label:SetColor(ZO_DEFAULT_ENABLED_COLOR:UnpackRGBA())
end
end |
That's what I was trying as well, unfortuantely it does not work though (i.e. nothing happens). I made another commit that adds the logic to prevent the submenu from expanding/collapsing when it is set to disabled. So only closing animation should be missing. |
Ok. I'll take a look later. |
You need to set |
Oh I see, that's why no animation happened. In the latest comit I included all your feedback, and from what I can see it is working fine now. |
Ok. I'll merge it now. Thanks again for contributing. :) |
This change does:
This change does NOT: