sirinsidiator / ESO-LibAddonMenu

http://www.esoui.com/downloads/info7-LibAddonMenu.html
Artistic License 2.0
41 stars 20 forks source link

temporarily hide a control #43

Open sirinsidiator opened 8 years ago

sirinsidiator commented 8 years ago

uladz requested a feature to temporarily hide a control from a settings panel.

Ayantir commented 8 years ago

I see one usage for this

  1. Dynamic creation of controls. Your controls are based on Guilds per ex. Controls should be recreated on GuildJoin/Left. Or your Controls are based on the value of another control. If a control is set to a certain value, other controls should be hidden, shown. (This update should be done wile being in LAM directly)

Then, implementation.

We could add another option in the setting itself. shouldDisplay = functionName,

functionName will be a function

Or we can set the shouldDisplay on anotherControl value I'm not really fan since function() return db.anotherSetting end is really easy to do.

Or add another option in panel

hideDisabledControls =true,

In both cases if doing this, we should consider hiding the parent submenu if all controls are hidden.

AssemblerManiac commented 8 years ago

+1 on this I can't see hiding a control being necessary for much of anything else except guild related items. Nothing else is dynamic enough to need it (unless there's an option related to an achievement or leveled skill, but I think those are extreme fringe cases).

Hide group if all hidden, great idea. Can see it being very useful.

Rebuilding whole menu does work. Just means breaking down the component parts of your menu into manageable chunks, and then making it be rebuilt whenever "some criteria" is met.

Baertram commented 3 years ago

Another usecase would be to hide the complete panel until all of it controls were created. Currently I need to achieve this via the LAM callbacks, and it often fails (I do not why it does not work properly all the time).

So I'd like to add to the request that we could hide the total LAM panel (except maybe the headline with the name, donations, website links etc.) and show a "loading texture" until all controls were created.

Addons using a lot of dynamically added controls sometimes load a very long time and if users already open submenus etc. the controls might be missplaced or wrong. Maybe even use LibAsync to create all the controls to strip client lags as all the dynamically created controls load.