branchitem.cpp
changeset 767 6d2b32f305f9
parent 763 8c028a5d9083
child 768 382a444f5b0c
     1.1 --- a/branchitem.cpp	Thu May 07 08:48:53 2009 +0000
     1.2 +++ b/branchitem.cpp	Wed May 13 08:26:27 2009 +0000
     1.3 @@ -202,38 +202,38 @@
     1.4  	if (scrolled) toggleScroll();
     1.5  }
     1.6  
     1.7 -void BranchItem::toggleScroll()
     1.8 +bool BranchItem::toggleScroll()	
     1.9  {
    1.10 -	BranchItem *bi=getFirstBranch();
    1.11  
    1.12 +	if (!branchCount()>0) return false;
    1.13  	BranchObj *bo=NULL;
    1.14  	if (scrolled)
    1.15  	{
    1.16  		scrolled=false;
    1.17 -		//FIXME-1 systemFlags->deactivate("scrolledright");
    1.18 -		while (bi)
    1.19 +		systemFlags.deactivate("system-scrolledright");
    1.20 +		if (branchCounter>0)
    1.21  		{
    1.22 -			bo=(BranchObj*)(bi->getLMO());
    1.23 -			if (bo) bo->setVisibility(true);
    1.24 -			bi=getNextBranch(bi);
    1.25 +			for (int i=0;i<branchCounter;++i)
    1.26 +			{
    1.27 +				bo=(BranchObj*)(getBranchNum(i)->getLMO());
    1.28 +				if (bo) bo->setVisibility(true);
    1.29 +			}
    1.30  		}
    1.31 +		model->reposition();
    1.32  	} else
    1.33  	{
    1.34  		scrolled=true;
    1.35 -		//FIXME-1 systemFlags->activate("scrolledright");
    1.36 -		while (bi)
    1.37 +		systemFlags.activate("system-scrolledright");
    1.38 +		if (branchCounter>0)
    1.39  		{
    1.40 -			bo=(BranchObj*)(bi->getLMO());
    1.41 -			if (bo) bo->setVisibility(false);
    1.42 -			bi=getNextBranch(bi);
    1.43 +			for (int i=0;i<branchCounter;++i)
    1.44 +			{
    1.45 +				bo=(BranchObj*)(getBranchNum(i)->getLMO());
    1.46 +				if (bo) bo->setVisibility(false);
    1.47 +			}
    1.48  		}
    1.49  	}
    1.50 -	if (bo)
    1.51 -	{
    1.52 -		bo->calcBBoxSize();
    1.53 -		bo->positionBBox();	
    1.54 -		bo->forceReposition();
    1.55 -	}
    1.56 +	return true;
    1.57  }
    1.58  
    1.59  bool BranchItem::isScrolled()
    1.60 @@ -357,7 +357,7 @@
    1.61  
    1.62  	if (!getHeading().isEmpty() ) 
    1.63  	{
    1.64 -		newbo->updateHeading();
    1.65 +		newbo->updateData();	//FIXME-3 maybe better model->emitDataHasChanged()?
    1.66  		newbo->setColor (headingColor);
    1.67  	}	
    1.68