Can't remove columns without releasing and reacquiring #33


  • New
  • Defect
Open
Assigned to torhal
  • EsperLily created this issue Jan 23, 2013

    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:

    1. Support a 0 count of columns in both Acquire() and SetColumnLayout(). This would delete all columns
    2. If Acquire() or SetColumnLayout() is given a number of columns that's fewer than the existing column set, all extra columns should be deleted.

    I would further recommend that Acquire()/SetColumnLayout() should update the margins if the cellmarginh has changed since the column was originally created.

  • EsperLily added the tags New Defect Jan 23, 2013
  • EsperLily posted a comment Jan 23, 2013

    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 login or register a new account.