•   
  • 1
  • 20
  • 21
  • 22
  • 23
  • 24(current)
Release PyXBMCt: a Python framework for simple creating UI for XBMC addons
(2019-05-13, 21:32)Roman_V_M Wrote: Unfortunately, ControlList doesn't have a scrollbar.

Thanks for your reply. That's too bad, but I'll work around it.

I have some other layout questions if you have the time.

The reason I ask is because my controls look stretched or squashed to fill the whole cell. My only goal is to make it look clean and neat, I'm not trying to make a complex UI or use any advanced layout features. I'd also like for it to work across skins / resolutions. My needs are pretty straight forward. I need a text entry box, an int representing seconds (using a slider for this) and a multi-select list. I could use a series of three built-in dialogues but I'd like to make something more user friendly.

I could eventually figure it out with trial and error but I bet someone smarter has thought of better ways. Can you please confirm my understanding: 

- It looks like the "cells" in the grid are spread evenly and the size is based on the geometry of the Dialogue that contains them. If that's so I can easily infer the cell size from that.
- The controls appear to stretch to fill the whole cell - padding (default x)
- If I understand correctly pad_x/y will shrink the control within the cell and I can use this to get it to a proper ratio so it doesn't look so wonky.
- I don't know the correct ratios for any of these controls. Is there a reference for this somewhere? I imagine a slider has a default fixed height. If so, is this the same across all skins and resolutions?
- Is there a way for controls not to stretch and maybe have them align on the top left of the cell (or any other kind of alignment, frankly) 

Thanks for your patience and help! This is my first addon and first python project, and I last wrote code 10+ years ago... but I appreciate your help getting back on the bicycle
Reply
Your assumptions about creating a controls layout in PyXBMCt are basically correct. This is more of a trial-and-error game until you get your layout right, and there are no specific guidelines.
I said is like a million times and repeat once again: PyXBMCt is just a thin convenience wrapper around xbmcgi Window and Control classes. It provides a grid layout instead of absolute pixel coordinates and a set of default textures to decorate your Controls, because most of xbmcgui Controls do not have their own textures.
By default, xbmcgui.Window and WindowDialog operate on a coordinate grid of 1280x720 pixes. This is a purely virtual coordinate grid that do not depend on you current skin or display resolutions (and they are different things). Controls are placed and sized in absolute pixel coordinates from the top-left screen corner. Instead of this, PyXBMCt provides a more convenient grid layout and calculates actual Controls coordinates in absolute pixels "under the hood".
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
(2019-05-15, 09:14)Roman_V_M Wrote: Your assumptions about creating a controls layout in PyXBMCt are basically correct. This is more of a trial-and-error game until you get your layout right, and there are no specific guidelines.
I said is like a million times and repeat once again: PyXBMCt is just a thin convenience wrapper around xbmcgi Window and Control classes. It provides a grid layout instead of absolute pixel coordinates and a set of default textures to decorate your Controls, because most of xbmcgui Controls do not have their own textures.
By default, xbmcgui.Window and WindowDialog operate on a coordinate grid of 1280x720 pixes. This is a purely virtual coordinate grid that do not depend on you current skin or display resolutions (and they are different things). Controls are placed and sized in absolute pixel coordinates from the top-left screen corner. Instead of this, PyXBMCt provides a more convenient grid layout and calculates actual Controls coordinates in absolute pixels "under the hood".
Thanks very much for your help - and for the add on in the first place !
Reply
  •   
  • 1
  • 20
  • 21
  • 22
  • 23
  • 24(current)
 
Thread Rating:
  • 4 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
PyXBMCt: a Python framework for simple creating UI for XBMC addons54