obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

libobs,UI: Add bool list and radio button list to properties

Open gxalpha opened this issue 3 years ago • 5 comments

Description

Adds OBS_COMBO_FORMAT_BOOL to combo formats, making it possible to have bool values in a properties list (dropdown).

Adds OBS_COMBO_TYPE_RADIO, which displays a properties list as radio buttons instead of as a combobox. For the API user, input and output behaves the same as OBS_COMBO_TYPE_LIST. Hypothetical case of how this would look (this isn't the actual use case, which will follow in a second separated PR to make reviewing easier.):

Bildschirm­foto 2022-11-22 um 17 52 45 Bildschirm­foto 2022-11-22 um 17 53 11

Technically, these changes are unrelated, but one modifies each other, making it simpler to have them combined (cause the radio type also needs bool support if that would be merged first, so I'd have to fix conflicts from my own PR).

Motivation and Context

Having radio buttons in properties would be beneficial for some use cases, and a year ago at least was something on Warchamp's wishlist. I then made this branch about half a year ago, then forgot it.

This is preparation for a second PR which I will open shortly.

How Has This Been Tested?

Tested with the properties of the ft2-text source, as well as the browser source (see screenshot above). Also tested with a properties view in encoder settings.

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

gxalpha avatar Nov 22 '22 17:11 gxalpha

The idea of radio button list is cool, but I don't really know if they are good for lists with more than 4-5 buttons, at some point the list of radio buttons is just too much and makes the window look bloated. Personally I prefer the look of the drop down list for the permission setting. But I still see potentional good usage of the radio button list in other instances of use cases.

RealIndrit avatar Nov 23 '22 00:11 RealIndrit

I don't really know if they are good for lists with more than 4-5 buttons, at some point the list of radio buttons is just too much and makes the window look bloated. Personally I prefer the look of the drop down list for the permission setting

As mentioned, this isn't the actual use case.

You can find a real use case of this in #7835

gxalpha avatar Nov 23 '22 10:11 gxalpha

I don't really know if they are good for lists with more than 4-5 buttons, at some point the list of radio buttons is just too much and makes the window look bloated. Personally I prefer the look of the drop down list for the permission setting

As mentioned, this isn't the actual use case.

You can find a real use case of this in #7835

Just realized, my bad, completely missed that part 😂.

RealIndrit avatar Nov 23 '22 12:11 RealIndrit

I think these should be added to reference-properties.rst

CodeYan01 avatar Dec 01 '22 08:12 CodeYan01

Fixed.

gxalpha avatar Dec 01 '22 11:12 gxalpha