Thread Tools Display Modes
07/01/15, 10:24 AM   #1
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Resize header text limit without truncate.

Greetings,

As the title suggests, I am attempting to increase the readable width of the category header text at the cooking station before it wraps to the next line. I am making my adjustments through a hook into ZO_IconHeader_UpdateSize which gets called during the creation of the tree layout:

Code:
	local ESOMRL_ZO_IconHeader_UpdateSize = ZO_IconHeader_UpdateSize
	ZO_IconHeader_UpdateSize = function(control)
		ESOMRL_ZO_IconHeader_UpdateSize(control)
		if GetCraftingInteractionType() == 5 then
			local _, textHeight = control.text:GetTextDimensions() 
			control.text:SetDimensions(580, textHeight)
		end
	end
This unfortunately results in the built-in text truncation function kicking in and generating a tooltip instead of displaying the whole line:



I have tried many other options. For example:

Code:
control.text:SetDimensionConstraints(0, 0, 580, 0)
Using that instead of the SetDimensions function above shows the whole line, but with an ugly blank line underneath it:



Using both options together looks the same as the first image (text truncated with tooltip).

Obviously I need to get deeper in the tree and set width on the parent object somehow, but I am unable to figure out how to do that. I have tried manually adjusting the width of ZO_ProvisionerTopLevelNavigationContainer, ZO_ProvisionerTopLevelNavigationContainerScrollChild, ZO_ProvisionerTopLevelNavigationContainerScrollChildZO_IconHeader but this all does nothing.

I think the parent container is inheriting some internal hard-set template value somewhere that may be out of reach to modify, or otherwise it is not immediately apparent to me.

Can anyone help, it is driving me insane!
  Reply With Quote
07/01/15, 10:28 AM   #2
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
I gave up to quickly...

Apparently switching the order of the resize functions did it:

Code:
	local ESOMRL_ZO_IconHeader_UpdateSize = ZO_IconHeader_UpdateSize
	ZO_IconHeader_UpdateSize = function(control)
		ESOMRL_ZO_IconHeader_UpdateSize(control)
		if GetCraftingInteractionType() == 5 then
			local _, textHeight = control.text:GetTextDimensions() 
			control.text:SetDimensionConstraints(0, 0, 580, 0)
			control.text:SetDimensions(580, textHeight)
		end
	end
DERP.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Resize header text limit without truncate.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off