Feature: allow to configure window options as functions #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the possibility for more dynamic window configuration. To do so, it allows some window configuration options to be a function. If so, it evaluates the function by calling it with the window number as first parameter. The output of the function is taken as the actual configuration value that is then passed to the Nui library.
In addition to this, it also makes the "relative" option of Nui configurable. The default value reflects the former fixed constant.
A possible usage of this would be a configuration that sizes and positions Navbuddy relative to the current window and with the same width as the window.
Moreover this allows to easily require a minimum width of Navbuddy and much more. It does so without putting the burden to the plugin, but rather the experienced power user.
All changes are fully backwards compatible.