Add locked tooltip (#998)

Adds the ability to define descriptive tooltips for settings when they
are locked.


![image](https://github.com/user-attachments/assets/5d5778c8-911b-4358-b4e6-f0389270ad76)


Makes some minor improvements to tooltip layout logic as well.
This commit is contained in:
boatbomber
2024-12-28 15:03:11 -08:00
committed by GitHub
parent b7d3394464
commit 19ca2b12fc
5 changed files with 16 additions and 8 deletions

View File

@@ -57,8 +57,9 @@ function Checkbox:render()
end,
}, {
StateTip = e(Tooltip.Trigger, {
text = (if self.props.locked then "[LOCKED] " else "")
.. (if self.props.active then "Enabled" else "Disabled"),
text = (if self.props.locked
then (self.props.lockedTooltip or "(Cannot be changed right now)") .. "\n"
else "") .. (if self.props.active then "Enabled" else "Disabled"),
}),
Active = e(SlicedImage, {