-
Notifications
You must be signed in to change notification settings - Fork 213
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
allow custom widget options icon #4314
base: master
Are you sure you want to change the base?
Conversation
Wasn't sure if the icon should be in GetInfo or in the main body like the options, though. |
Probably in the main body, like options, for consistency. Options have a path parameter that widgets can use to put icons in different paths, eg a widget could make a submenu of Hotkeys for hotkeys it adds, and have a submenu in Settings for some configuration. We're trying to be good about putting everything you might want to hotkey in the hotkeys menu while keeping it clear of settings. For an icon system to handle multiple paths it would have to look something like this:
I'd prefer the full solution, but just doing a single options_icon is ok too. |
Will do. Wouldn't it be cleaner just to put the icon on the option itself? options_path = 'Settings/Interface/Player Centroid Marker'
options_icon = "luaui/widgets/player-centroid-marker/main-icon.png"
options_order ={...yadda...}
options = {
enable = {
name = "Enable player centroid markers",
type = 'bool',
value = false,
desc = "Toggle the player-name markers over groups of units",
OnChange = function() ReInitialize() end,
advanced = false,
icon = "luaui/widgets/player-centroid-marker/toggle-marker.png"
},
... While it's less flexible than simply allowing a widget to stuff icons wherever it likes into the tree of icons, I think it's easier and more legible this way. |
Submenus are automatically inferred from paths, not directly from options menus. You wouldn't be able to add an icon to a submenu button with an option. Also, options don't have icons at the moment. |
Ahh, that makes sense, I thought you were saying the settings themselves needed icons, but no, they're going deep into various other trees and intermediate nodes on that tree may not be already defined, so we need to be able to insert icons into various points on the tree. I was just trying to come up with a way to avoid the widget-developer from repeating themselves, but yeah I can see what you mean. |
Any news? |
Allow widgets to declare their own options icon.