Skip to content

Refactor button widgets; add widgets.RadioButton#5781

Merged
ab9rf merged 10 commits into
DFHack:developfrom
Bumber64:button-widgets
Jul 12, 2026
Merged

Refactor button widgets; add widgets.RadioButton#5781
ab9rf merged 10 commits into
DFHack:developfrom
Bumber64:button-widgets

Conversation

@Bumber64

@Bumber64 Bumber64 commented Mar 31, 2026

Copy link
Copy Markdown
Member

Refactor widgets.ConfigureButton and make widgets.HelpButton a subclass of it. Add widgets.RadioButton, which looks and functions like the buttons in the gui/control-panel list.

I don't understand the ---@field stuff very well, so I based it on examples as best I could. Needs to be verified.

@Bumber64
Bumber64 marked this pull request as draft July 3, 2026 19:21
@Bumber64 Bumber64 changed the title Refactor button widgets; add widgets.ToggleButton Refactor button widgets; add widgets.RadioButton Jul 5, 2026
Bumber64 added 3 commits July 4, 2026 22:19
* Update widgets.lua - RadioButton
* Update and rename toggle_button.lua to radio_button.lua
* Update help_button.lua
* Update configure_button.lua - Replace GraphicButton
* Delete library/lua/gui/widgets/buttons/graphic_button.lua
* Update Lua API.rst - Add RadioButton; HelpButton now subclass
* Update radio_button.lua
* Update configure_button.lua
* Update help_button.lua
@Bumber64
Bumber64 marked this pull request as ready for review July 6, 2026 03:41

@SilasD SilasD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with this, I guess.

RadioButton looks a little bit half-baked, but it's in a usable state.

Comment thread library/lua/gui/widgets/buttons/configure_button.lua
Comment thread library/lua/gui/widgets/buttons/help_button.lua
Comment thread library/lua/gui/widgets/buttons/configure_button.lua
Comment thread library/lua/gui/widgets/buttons/help_button.lua
Comment thread library/lua/gui/widgets/buttons/help_button.lua
Comment thread library/lua/gui/widgets/buttons/radio_button.lua
Comment thread library/lua/gui/widgets/buttons/radio_button.lua
@ab9rf

ab9rf commented Jul 12, 2026

Copy link
Copy Markdown
Member

For the record: Pure code-quality changes that don't have user-facing effects do not require a changelog.

@ab9rf
ab9rf merged commit 6199575 into DFHack:develop Jul 12, 2026
14 checks passed
@Bumber64

Copy link
Copy Markdown
Member Author

Did we confirm that the ---@field stuff is all okay? It wasn't mentioned in review.

IIRC, it's used for a Lua language server, which I don't use.

@SilasD

SilasD commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Did we confirm that the ---@field stuff is all okay? It wasn't mentioned in review.

IIRC, it's used for a Lua language server, which I don't use.

It all looked good. the widgets.RadioButton.attrs class probably wants
---@field toggle_state? boolean
but it's no more broken than all the other definitions.

when I get my local fork of vallode's LuaLS whipped into better shape I'll spend some time with all of these classes' annotations.

@Bumber64
Bumber64 deleted the button-widgets branch July 13, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants