-
Notifications
You must be signed in to change notification settings - Fork 475
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
Refactor/widgets #4955
Refactor/widgets #4955
Conversation
ResizingPanel, Pages, EditField, HotkeyLabel, Label and Scrollbar
WrappedLabel, TooltipLabel, HelpButton, ConfigureButton, BannerPanel
TextButton, CycleHotkeyLabel, ButtonGroup, ToggleHotkeyLabel, List
FilteredList, TabBar, Tab, RangeSlider, DimensionsTooltip
DOUBLE_CLICK_MS = Panel.DOUBLE_CLICK_MS | ||
STANDARDSCROLL = Scrollbar.STANDARDSCROLL | ||
SCROLL_INITIAL_DELAY_MS = Scrollbar.SCROLL_INITIAL_DELAY_MS | ||
SCROLL_DELAY_MS = Scrollbar.SCROLL_DELAY_MS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll probably need a function-based API for these config elements. As written, if you change these values via the control panel, the relevant widgets won't actually see the changed value and will not change their behavior. See scripts/internal/control-panel/registry.lua
for how these values are interacted with.
We could change them to a function interface, like we did for HIDE_ARMOK_TOOLS
in dfhack.lua
. It is now wrapped with getMortalMode()
and setMortalMode()
functions. The code in the control panel registry would then have switch to call the new API instead of setting the values directly (this is not hard -- see how the mortal mode functions are called).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure TabBar should be classified as a container. It's meant to be used alongside a container, like a Pages widget, but it doesn't contain other widgets itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to root widgets dir
library/lua/gui/widgets.lua
Outdated
parse_label_text = Label.parse_label_text | ||
render_text = Label.render_text | ||
check_text_keys = Label.check_text_keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any existing usages of these three functions (parse_label_text
, render_text
, and check_text_keys
)? they aren't really intended for public use. they could probably stay as an internal API and not be exposed in widgets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right.
removed from the public API.
Refactor massive
widgets.lua
into module per component style.No API or logic has been changed (at least intentionally).
This is a preparation to add
TextArea
(gui/journal
style input widget) and migrateTextField
widget to journal style features.