There seems to be no way to get rid of columns without releasing the tooltip and reacquiring it. This poses a problem when the column spacing needs to be changed while the tooltip is already visible, because the only way to have variable column spacing is to use AddColumn() after SetCellMarginH(). Even if I wanted uniform spacing, there's no way to adjust the margins of the existing columns.
This also complicates code that otherwise doesn't need to care if the tooltip is already visible, because it's just going to Clear() it and set it up again.
My suggestion would be twofold:
I would further recommend that Acquire()/SetColumnLayout() should update the margins if the cellmarginh has changed since the column was originally created.
Alternatively, we could simply provide a mechanism to update the margins of existing columns. The problem with fixing Acquire()/SetColumnLayout() is the API documentation states that the number of columns given is a guarantee that the tooltip has "at least" that many columns, suggesting that it may still have more. I don't know if there are any addons using LibQTip-1.0 that rely on these functions not deleting extra columns.
My current thought is to provide a new function, SetColumnMarginH(), which takes a column index and a margin. That margin would be applied to the left edge of the column, just like the cell margin works today (and the API documentation should make this clear).
Secondly, we could then update SetColumnLayout() to support an invocation that looks like SetColumnLayout(4, "LEFT", 0, "RIGHT", 6, "LEFT, "RIGHT"), with the numbers acting as margins for the next column. Not only does this make setting margins easier, but it's also a more understandable API.
To post a comment, please
or register a new account.