[qet] [3159] Restore it_prev_

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3159
Author:   scorpio810
Date:     2014-06-21 11:51:37 +0200 (Sat, 21 Jun 2014)
Log Message:
-----------
Restore it_prev_

Modified Paths:
--------------
    trunk/sources/elementspanel.cpp

Modified: trunk/sources/elementspanel.cpp
===================================================================
--- trunk/sources/elementspanel.cpp	2014-06-21 04:19:54 UTC (rev 3158)
+++ trunk/sources/elementspanel.cpp	2014-06-21 09:51:37 UTC (rev 3159)
@@ -132,6 +132,11 @@
 	@return la collection, la categorie ou l'element selectionne(e)
 */
 ElementsCollectionItem *ElementsPanel::selectedItem() const {
+	// change color of drag element
+	if(it_prev_) {
+	it_prev_->setBackgroundColor(0, Qt::white);
+	}
+
 	ElementsLocation selected_location(selectedElementLocation());
 	if (!selected_location.isNull()) {
 		return(QETApp::collectionItem(selected_location));
@@ -199,7 +204,18 @@
 		return;
 	}
 #endif
-	
+
+	// Change color on mouse over
+	it_ = itemAt(e -> pos());
+	if(it_prev_){
+			if(it_ != it_prev_){
+			it_->setBackgroundColor(0, Qt::cyan);
+			it_prev_->setBackgroundColor(0, Qt::white);
+			it_prev_ = it_;
+		}
+	}
+	else it_prev_ = it_;
+
 	e -> accept();
 	/// @todo mettre en valeur le lieu de depot
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/