#Positioning tiles in columns

35 messages ยท Page 1 of 1 (latest)

sterile osprey
#

Hi! I'd like to align my tiles to columns. So they are perfectly aligned to so kind of virtual columns. You can check images to see "good" and "bad" aligned. To achive that I create empty tiles that conditionally should be added or hiden.

function()
    
    local panel1 = WeakAuras.GetRegion("WKDH-Primary-actions");
    local panel2 = WeakAuras.GetRegion("WKDH-Secondary-actions");
    local space = WeakAuras.GetRegion(aura_env.id);
    
    if (panel1 == nil or panel2 == nil or space == nil) then
        return false;
    end
    
    local spaceWidth = space:GetWidth()+1;
    
    local panel1NOE = math.floor(panel1:GetWidth()/spaceWidth);
    local panel2NOE = math.floor(panel2:GetWidth()/spaceWidth);
    
    local panelsNOEDiff = math.abs(panel1NOE - panel2NOE);
    
    return panelsNOEDiff % 2 == 1;
end

I struggle with binding it to proper event. Right now to force this code execution I trigger it as a Custom -> Event -> Event(s):

UNIT_AURA:player, PLAYER_ENTERING_WORLD, ACTIVE_TALENT_GROUP_CHANGE, PLAYER_TALENT_UPDATE, PLAYER_SPECIALIZATION_CHANGED

Probably there is a better way to do that. How to force this code execution when I open/close weak aura window?

eager nebula
#

you want the bottom row to line up with the top row you mean?

sterile osprey
#

Yes!

#

๐Ÿ™‚

#

Maybe there is easier way to do that

eager nebula
#

how did you get it to line up in your 2nd pic?

sterile osprey
#

If I have even number of elements I always add one more.

#

add one more = conditionaly show mostly hidden element

#

I do that kind of tricks in both row so at the end I perfectly line up them

eager nebula
#

would be easier to just change the grow direction

#

you can have the top bar set to centered horizontal

#

and the bottom bar set to right then anchor the bottom bar to the top bar with the left sides aligned

sterile osprey
#

In that case - can both bars be centered?

#

The top one - yes but what about bottom?

eager nebula
#

the bottom bar will line up with the top bar that is centered

sterile osprey
#

but top bar is 2 - 3 elements longer

eager nebula
#

the bottom will be left justified

#

so if they arn't the same length then there will be empty space on the right

#

if you want it to be centered but aligned to a grid then just put all the icons into the same group and use the Grid grow option

#

and organize the icons in your list on the left to be in the order that you want

sterile osprey
#

I need to test thsi "grid grow" option tbh

#

Have never used it before and it sounds intresting

#

Right now it looks like that

eager nebula
#

if you have two groups it's more difficult to align the icons than just puttings all the icons into one group and using the right grow option so it shows up as two lines

sterile osprey
#

but if I put those 2 lines in the same group I will be able to achive something similar

eager nebula
#

if you want that space between the icons then you have to just put a "dummy" icon that's transparent or anchor the icons seperately.

sterile osprey
#

but 1 dummy space is enough. Right now the 2nd one is only to align top and bottom lines together

eager nebula
#

if you just use grid and set the row and column limit you can have it line up with no space between them

sterile osprey
#

Thank you!

#

and appreciate that you tried to understand what I want to achieve instead of just jumping to topic ๐Ÿ™‚ ๐Ÿ‘

sterile osprey
#

Ehh.. I am still not satisfied with the grid layout :/.

Hmm.. is there any way to on-load trigger custom code that will show or hide element?

Right now I just listening on the most probable events like UNIT_AURA:player, PLAYER_ENTERING_WORLD, ACTIVE_TALENT_GROUP_CHANGE, PLAYER_TALENT_UPDATE, PLAYER_SPECIALIZATION_CHANGED.

I still think that it could be done better. I just need event like WEAKAURA: panel closed

#

or WEAKAURA: on init , WEAKAURA: after load