diff -r edb78a44240b -r 9ff332964015 branchitem.cpp --- a/branchitem.cpp Tue Mar 31 15:36:10 2009 +0000 +++ b/branchitem.cpp Wed Apr 01 15:06:57 2009 +0000 @@ -6,7 +6,10 @@ BranchItem::BranchItem(const QList &data, TreeItem *parent):TreeItem (data,parent) { - cout << "Constr. BranchItem\n"; + //cout << "Constr. BranchItem\n"; + + scrolled=false; + tmpUnscrolled=false; } BranchItem::~BranchItem() @@ -15,6 +18,12 @@ qDeleteAll(childItems); } +void BranchItem::copy (BranchItem *other) +{ + scrolled=other->scrolled; + tmpUnscrolled=other->tmpUnscrolled; +} + QString BranchItem::saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset) { // Cloudy stuff can be hidden during exports @@ -113,4 +122,87 @@ return s; } +void BranchItem::unScroll() +{ + if (tmpUnscrolled) resetTmpUnscroll(); + if (scrolled) toggleScroll(); +} +void BranchItem::toggleScroll() +{ + if (scrolled) + { + scrolled=false; + //FIXME-1 systemFlags->deactivate("scrolledright"); + /* + for (int i=0; isetVisibility(true); + */ + } else + { + scrolled=true; + /* + //FIXME-1 systemFlags->activate("scrolledright"); + for (int i=0; isetVisibility(false); + */ + } + /* + calcBBoxSize(); + positionBBox(); + move (absPos.x(), absPos.y() ); + forceReposition(); + */ +} + +bool BranchItem::isScrolled() +{ + return scrolled; +} + +bool BranchItem::hasScrolledParent(BranchItem *start) +{ + // Calls parents recursivly to + // find out, if we are scrolled at all. + // But ignore myself, just look at parents. + + if (this !=start && scrolled) return true; + + BranchItem* bi=(BranchItem*)parentItem; + if (bi) + return bi->hasScrolledParent(start); + else + return false; +} + +void BranchItem::tmpUnscroll() +{ + // Unscroll parent (recursivly) + BranchItem * bi=(BranchItem*)parentItem; + if (bi) bi->tmpUnscroll(); + + // Unscroll myself + if (scrolled) + { + tmpUnscrolled=true; + // FIXME-1 systemFlags->activate("tmpUnscrolledright"); + toggleScroll(); + } +} + +void BranchItem::resetTmpUnscroll() +{ + // Unscroll parent (recursivly) + BranchItem * bi=(BranchItem*)parentItem; + if (bi) bi->resetTmpUnscroll(); + + // Unscroll myself + if (tmpUnscrolled) + { + tmpUnscrolled=false; + // FIXME-1 systemFlags->deactivate("tmpUnscrolledright"); + toggleScroll(); + } +} + +