From: <tua...@us...> - 2014-11-11 16:15:23
|
Revision: 9652 http://sourceforge.net/p/planeshift/code/9652 Author: tuathanach Date: 2014-11-11 16:15:20 +0000 (Tue, 11 Nov 2014) Log Message: ----------- Enable ability to have chat tabs on 2 rows or columns. Modified Paths: -------------- trunk/src/client/gui/chatwindow.cpp Modified: trunk/src/client/gui/chatwindow.cpp =================================================================== --- trunk/src/client/gui/chatwindow.cpp 2014-11-11 00:46:13 UTC (rev 9651) +++ trunk/src/client/gui/chatwindow.cpp 2014-11-11 16:15:20 UTC (rev 9652) @@ -212,8 +212,9 @@ buttonNames.Push("Help Button"); unsigned int ct = 0; - int lastX, lastY, increment; + int lastX, lastY, increment, incX, incY; bool isVertical = false; + bool isDoubled = false; pawsWidget * tmp; for (unsigned int i = 0 ; i < buttonNames.GetSize() ; i++) { @@ -222,6 +223,8 @@ tmp = pw->FindWidget(buttonNames[i]); lastX = tmp->GetDefaultFrame().xmin; lastY = tmp->GetDefaultFrame().ymin; + incY = tmp->GetDefaultFrame().Height(); + incX = tmp->GetDefaultFrame().Width(); } if(TABVALUE(settings.tabSetting,i)) {//this tab is visible @@ -246,14 +249,55 @@ if(thisX == lastX && thisY != lastY) { isVertical = true; - increment = tmp->GetDefaultFrame().Height(); + increment = incY; } else { - increment = tmp->GetDefaultFrame().Width(); + increment = incX; } } - if(isVertical) + else if(ct == 2) + { + int thisX, thisY; + thisX = tmp->GetDefaultFrame().xmin; + thisY = tmp->GetDefaultFrame().ymin; + + if(isVertical && thisX != lastX && thisY == lastY) + { + isDoubled = true; + } + else if(!isVertical && thisX == lastX && thisY != lastY) + { + isDoubled = true; + } + } + + if(isDoubled) + { + if(isVertical) + { + if((ct % 2) ==1) + { + tmp->SetRelativeFramePos(lastX+(incX*((ct-1)/2)), lastY + incY); + } + else + { + tmp->SetRelativeFramePos(lastX+(incX*(ct/2)), lastY); + } + } + else + { + if((ct % 2) ==1) + { + tmp->SetRelativeFramePos(lastX + incX, lastY + (incY*((ct-1)/2))); + } + else + { + tmp->SetRelativeFramePos(lastX, lastY + (incY*(ct/2))); + } + } + } + else if(isVertical) { tmp->SetRelativeFramePos(lastX,lastY+increment*ct); //tmp->MoveDelta(0,increment*ct); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |