2

I have a Kivy app that uses a slightly modified Settings as a data record editor.

I want to hide or show an item after the setting panel has been created (depending on user interaction with some other setting item).

Is there a simple way of dynamically hiding a setting item, so that it doesn't take up any space?

I can set the opacity to 0 and disabled to True and the items disappears, but still takes space.

Setting the size to (0,0) (to hide) and resetting it to the original value (to show it) corrupts the view.

What is the correct way of doing this? Removing the SettingItem seems complicated, because the items to hide a somewhere in the middle of the items.

Ruediger Jungbeck
  • 2,836
  • 5
  • 36
  • 59
  • It could be a possible duplicate of [this](https://stackoverflow.com/questions/23211142/5994041) if there isn't some option in the `Settings` to make it work (which I really doubt there is). – Peter Badida Feb 05 '17 at 20:23
  • The problem is, that I don't want to have the empty space caused by moving the SettingItem off screen. This would be the same as setting opacity to 0 and disabling the item. – Ruediger Jungbeck Feb 05 '17 at 20:27
  • I see your issue, but unless there's an option in the Settings directly, you'll need to make it the harder way if not even creating your own settings from scratch. You could however make it go off the screen **and** resize itself (`size = [0, 0]`), which would be less harsh to the layout a `SettingItem` is in. This is quite a persistent issue not having implemented widget hiding in Kivy. You might want to report it as a feature request, but I think we already have it reported at GitHub too. There might be a workaround in recreating the whole Settings panel via `add_json_panel` or similar. – Peter Badida Feb 05 '17 at 20:44
  • Setting size to (0, 0) and setting the position of screen corrupts the display – Ruediger Jungbeck Feb 05 '17 at 23:13
  • Did you find a way to make this work? If not then how did you manage to change the opacity of a particular setting after the settings screen was loaded? – yashC Feb 07 '21 at 10:49
  • I ended by rewriting my data record editor from scratch (ie without using Settings). The new code has also significantly improved response time. – Ruediger Jungbeck Feb 17 '21 at 15:20

0 Answers0