View Single Post
Old 11 June 2014, 03:27   #3
mritter0
Registered User

 
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 49
Posts: 204
Cool. Got it working. Not pixel perfect because of rounding. And, I also forgot to say that I also save the window width/height, which will also vary.
Code:
ULONG
GetNavigationWidth()
{
	ULONG							sum=MainWindow->Width-(!IsOS4 ? 22 : 28)-6+14;
	ULONG							sum2=sum/2;

	ULONG							w1=NavigationGad->Width;

	w1 = (w1 * 100 + sum2) / sum;

	return w1;
}
The 22 : 28 is for (Window->BorderLeft + Window->BorderRight); 22 for OS3.9, 28 for OS4. The 6 is for the width of the weightbar. The 14, not sure where that is coming from; may be 20 on OS4. But 6 pixels won't ruin the math.

Then in the layout code for the navigation gadget
Code:
CHILD_WeightedWidth,		Prefs->NavigationWidth,
And the other listbrowser
Code:
CHILD_WeightedWidth,		99-Prefs->NavigationWidth,
I use 99 to accommodate for the weightbar. Slightly more accurate.
mritter0 is offline  
 
Page generated in 0.04293 seconds with 11 queries