src/gui.cpp

changeset 219
70eb948a2b02
parent 218
2a65ad4972a8
child 220
1f368f0a323b
--- a/src/gui.cpp	Sun May 19 00:12:02 2013 +0300
+++ b/src/gui.cpp	Sun May 19 00:47:07 2013 +0300
@@ -193,9 +193,6 @@
 	addMenuAction ("newBFC");				// New BFC Statment
 	addMenuAction ("newVertex");			// New Vertex
 	addMenuAction ("newRadial");			// New Radial
-	menu->addSeparator ();					// -----
-	addMenuAction ("modeSelect");			// Select Mode
-	addMenuAction ("modeDraw");			// Draw Mode
 	
 	// Edit menu
 	initMenu ("&Edit");
@@ -210,6 +207,11 @@
 	addMenuAction ("selectAll");			// Select All
 	addMenuAction ("selectByColor");		// Select by Color
 	addMenuAction ("selectByType");		// Select by Type
+	menu->addSeparator ();					// -----
+	addMenuAction ("modeSelect");			// Select Mode
+	addMenuAction ("modeDraw");			// Draw Mode
+	menu->addSeparator ();					// -----
+	addMenuAction ("setDrawDepth");		// Set Draw Depth
 	
 	initMenu ("&Tools");
 	addMenuAction ("setColor");			// Set Color
@@ -834,7 +836,7 @@
 	return false;
 }
 
-short ForgeWindow::getSelectedColor() {
+short ForgeWindow::getSelectedColor () {
 	short result = -1;
 	
 	for (LDObject* obj : m_sel) {
@@ -855,17 +857,17 @@
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
 LDObject::Type ForgeWindow::uniformSelectedType () {
-	LDObject::Type eResult = LDObject::Unidentified;
+	LDObject::Type result = LDObject::Unidentified;
 	
 	for (LDObject* obj : m_sel) {
-		if (eResult != LDObject::Unidentified && obj->color != eResult)
+		if (result != LDObject::Unidentified && obj->color != result)
 			return LDObject::Unidentified;
 		
-		if (eResult == LDObject::Unidentified)
-			eResult = obj->getType ();
+		if (result == LDObject::Unidentified)
+			result = obj->getType ();
 	}
 	
-	return eResult;
+	return result;
 }
 
 // =============================================================================
@@ -907,12 +909,22 @@
 	contextMenu->addAction (findAction ("del"));
 	contextMenu->addSeparator ();
 	contextMenu->addAction (findAction ("setColor"));
+	
 	if (single)
 		contextMenu->addAction (findAction ("setContents"));
+	
 	contextMenu->addAction (findAction ("makeBorders"));
 	contextMenu->addAction (findAction ("setOverlay"));
 	contextMenu->addAction (findAction ("clearOverlay"));
 	
+	for (const char* mode : g_modeActionNames)
+		contextMenu->addAction (findAction (mode));
+	
+	if (R ()->camera () != GL::Free) {
+		contextMenu->addSeparator ();
+		contextMenu->addAction (findAction ("setDrawDepth"));
+	}
+	
 	contextMenu->exec (pos);
 }
 

mercurial