Allow setting multiple values for ButtonGroup #360

Merged
j merged 1 commit from qsniyg/oxjs:buttongroup-values into master 2023-10-07 09:20:17 +00:00
Contributor

Previously calling ButtonGroup::options('value', /*...*/) would toggle the value. With this new code it simply sets value.

For example, say you have a ButtonGroup bg with the values a, B, c, where a capital denotes the button currently selected. Here is how the function would alter its value:

  • bg.options('value', 'b') -> a, B, c
  • bg.options('value', 'z') -> a, b, c (a, B, c if min == 0, i.e. it doesn't alter the value)
  • bg.options('value', ['a', 'b']) -> A, B, c

While this changes the behavior, it's consistent with the way value is set by the widget (through self.options.value = self.optionGroup.value(); in toggleButton).

Previously calling `ButtonGroup::options('value', /*...*/)` would toggle the value. With this new code it simply sets value. For example, say you have a ButtonGroup `bg` with the values `a, B, c`, where a capital denotes the button currently selected. Here is how the function would alter its value: * `bg.options('value', 'b')` -> `a, B, c` * `bg.options('value', 'z')` -> `a, b, c` (`a, B, c` if `min` == 0, i.e. it doesn't alter the value) * `bg.options('value', ['a', 'b'])` -> `A, B, c` While this changes the behavior, it's consistent with the way `value` is set by the widget (through `self.options.value = self.optionGroup.value();` in `toggleButton`).
qsniyg added 1 commit 2023-09-04 22:53:16 +00:00
j merged commit d71ad7cad6 into master 2023-10-07 09:20:17 +00:00
j deleted branch buttongroup-values 2023-10-07 09:20:17 +00:00
Sign in to join this conversation.
No description provided.