View Single Post
06/20/17, 06:11 AM   #5
Lum1on
AddOn Author - Click to view addons
Join Date: Aug 2016
Posts: 18
Originally Posted by sirinsidiator View Post
A scroll list only renders rows that are actually visible on the screen. The other rows do not actually exist while out of view. In order to correctly show the scroll bar and position the elements, the scroll list somehow needs to know how much height all rows will take, but for the non-existing rows it can't call GetHeight, so it uses a predefined height based on the datatype instead.

There are a few possibilities to get dynamic heights to work, but they are rather complicated. Your easiest option is to make sure the text doesn't break into a new row. Either you make your list wide enough, or you cut the text off when it is too long (TextWrapMode) and show a tooltip on mouseover.
Well, that unfortunately is not an option. The window itself is resizable by the user which determines the width and height of the ZO_ScrollList. And the data that the addon pushes into it is based on the player's actions and Events.

Of course I could simple make the rowHeight three times as large as it is now but when most of the data is 1-2 rows it would look kinda silly because of the uneven padding in between.

I've worked with Javascript, C++, XML and QML before so it's not all new. I just don't really understand why LUA doesn't automatically determine the height of the ZO_ScrollList element and it uses a specific height in all of them.

EDIT
I've also tried to research if I could be able to place an empty XML object which has a height defined by the text and it could potentially expand the height, but that's probably just other scenario of the same problem I'm having now; I'm not able to manually define the rowHeight when pushing or updating items in ZO_ScrollList.

Last edited by Lum1on : 06/20/17 at 06:14 AM.
  Reply With Quote