View Single Post
07/01/21, 08:41 AM   #11
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,980
From my understanding, if you want the ItemFlavor to be directly below the TraitTypeText.
I've added resizeToFitDescendants="true" to your TLC so it will change it's size depending on the text and other contents and also DimensionConstraints so the maximum size will not be above 300 width and 500 height (change the height to your maximal needs).

Code:
<GuiXml>
    <Controls>
        <TopLevelControl name="CraftyStockListTooltip" hidden="true" mouseEnabled="true" movable="false" clampedToScreen="true" resizeToFitDescendants="true">
            <!--Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="0" offsetY="0"/-->
            <Dimensions x="300" y="0" />
            <DimensionConstraints minX="300" minY="0" maxX="300" maxY="500" />
            <Controls>
                <Backdrop name="$(parent)BG" inherits="ZO_DefaultBackdrop" />
                <Texture name="$(parent)ItemIcon" textureFile="" tier="HIGH">
					<Dimensions x="50" y="50"/>
					<Anchor point="CENTER" relativeTo="$(parent)" relativePoint="TOP" offsetY="-10" />
				</Texture>
                <Label name="$(parent)ItemLink" font="ZoFontGameLargeBold" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="CENTER" text="">
                    <Anchor point="TOP" relativeTo="$(parent)ItemIcon" relativePoint="BOTTOM" offsetX="0" offsetY="10"/>
                </Label>
				<Label name="$(parent)ItemType" font="ZoFontGameLargeBold" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="CENTER" text="">
                    <Anchor point="TOP" relativeTo="$(parent)ItemLink" relativePoint="BOTTOM" offsetX="0" offsetY="5"/>
                </Label>

                <Texture name="$(parent)Divider" textureFile="/esoui/art/miscellaneous/horizontaldivider.dds" tier="HIGH">
					<Dimensions x="300" y="4"/>
					<Anchor point="CENTER" relativeTo="$(parent)ItemType" relativePoint="BOTTOM" offsetY="10" />
				</Texture>

				<Label name="$(parent)TraitTypeText" font="ZoFontGameLargeBold" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="TOP" text="">
                    <Anchor point="TOPLEFT" relativeTo="$(parent)Divider" relativePoint="TOPLEFT" offsetX="15" offsetY="10"/>
                </Label>

                <Label name="$(parent)ItemFlavor" font="ZoFontGameLargeBold" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="TOP" text="">
                    <Anchor point="TOPLEFT" relativeTo="$(parent)TraitTypeText" relativePoint="BOTTOMLEFT" offsetX="0" offsetY="0"/>
                </Label>

            </Controls>
        </TopLevelControl>
    </Controls>
</GuiXml>
The labels do not necessarily need any 2nd anchor for your usecase except if you want to tell the ItemFlavor label to be anchored to the bottom of the tooltip. But the labels should resize themselves to the size they will need. Else you can set the Dimension Constraints for the labels as well so they will not get bigger than/smaller than...
If you anchor the middle label (TraitTypeText) to the RIGHT it will ALWAYS be the size from Divider to the middle (RIGHT) of the tlc (tooltip control).
And the following anchored label will then begin below that RIGHT (middle) of the tlc.


Last edited by Baertram : 07/01/21 at 08:55 AM.
  Reply With Quote