oUF

97.2k Downloads

Suggestion: Allow unit frames to be given a parent other than UIParent

nebel opened this issue ยท 1 comments

commented

Headers and unit frames created by oUF are currently always parented to UIParent. I may be wrong, but as far as I know there is no technical reason requiring unit frames to have this frame as a parent. Allowing other parents may facilitate global scaling, repositioning, etc. easier for layouts which would like features such as those.

An extremely simple but functional version might be simply changing the lines in SpawnHeader and Spawn to:

local header = CreateFrame('Frame', name, (oUF.frameParent or UIParent), template)

and

local object = CreateFrame("Button", name, (oUF.frameParent or UIParent), "SecureUnitButtonTemplate")

respectively. There may be more elegant solutions, of course, but this avoids adding new parameters to the spawn functions.

Given that this is a very simple change with a (likely) very small audience I don't expect a lot of interest in this, but I thought I'd bring it up.

Thanks.

commented

Well... don't ask me how I didn't realise this until now, but since posting the issue I actually looked into other ways to do this and found out you can seemingly just reparent frames with :SetParent, which never occurred to me would be possible. Assuming this works as well as setting the parent during frame creation, this issue serves no purpose. Sorry about that. Closing.