Skip to content

Commit

Permalink
Support changing menu height
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian L Lange committed Jul 17, 2024
1 parent 2f8bbea commit 0fb2dbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions LibEditMode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ Depending on the setting type there are additional required and optional entries
|:----------|:----------------------------------------------------------------------------------------------------------------------|:---------|:---------|
| values | indexed table containing [DropdownOption](#dropdownoption)s | table | no |
| generator | [Dropdown `SetupMenu` "generator" (callback)](https://warcraft.wiki.gg/wiki/Patch_11.0.0/API_changes#New_menu_system) | function | no |
| height | max height of the menu | integer | no |
- Either `values` or `generator` is required, the former for simple menues and the latter for complex ones.
- They are not exclusive, but `generator` takes precedence (e.g. `values` will be available but not used).
Expand Down
4 changes: 4 additions & 0 deletions widgets/dropdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ function dropdownMixin:Setup(data)
end)
elseif data.values then
self.Dropdown:SetupMenu(function(_, rootDescription)
if data.height then
rootDescription:SetScrollMode(data.height)
end

for _, value in next, data.values do
if value.isRadio then
rootDescription:CreateRadio(value.text, get, set, {
Expand Down

0 comments on commit 0fb2dbc

Please sign in to comment.