gui.cpp

changeset 155
e21c24bfcdf3
parent 154
cc53e5cbad54
child 156
d35b7e440585
--- a/gui.cpp	Fri May 03 20:26:25 2013 +0300
+++ b/gui.cpp	Fri May 03 23:46:46 2013 +0300
@@ -68,6 +68,7 @@
 EXTERN_ACTION (undo)
 EXTERN_ACTION (redo)
 EXTERN_ACTION (showHistory)
+EXTERN_ACTION (selectAll)
 EXTERN_ACTION (selectByColor)
 EXTERN_ACTION (selectByType)
 EXTERN_ACTION (moveXNeg)
@@ -239,6 +240,7 @@
 	qEditMenu->addAction (ACTION (paste));				// Paste
 	qEditMenu->addAction (ACTION (del));					// Delete
 	qEditMenu->addSeparator ();							// -----
+	qEditMenu->addAction (ACTION (selectAll));			// Select All
 	qEditMenu->addAction (ACTION (selectByColor));		// Select by Color
 	qEditMenu->addAction (ACTION (selectByType));		// Select by Type
 	qEditMenu->addSeparator ();							// -----
@@ -358,6 +360,7 @@
 	
 	// ==========================================
 	initSingleToolBar ("Select");
+	g_CurrentToolBar->addAction (ACTION (selectAll));
 	g_CurrentToolBar->addAction (ACTION (selectByColor));
 	g_CurrentToolBar->addAction (ACTION (selectByType));
 	
@@ -911,15 +914,24 @@
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
 void ForgeWindow::spawnContextMenu (const QPoint pos) {
+	const bool single = (g_ForgeWindow->sel.size () == 1);
+	
 	QMenu* contextMenu = new QMenu;
-	contextMenu->addAction (ACTION (editObject));
-	contextMenu->addSeparator ();
+	
+	if (single) {
+		contextMenu->addAction (ACTION (editObject));
+		contextMenu->addSeparator ();
+	}
+	
 	contextMenu->addAction (ACTION (cut));
 	contextMenu->addAction (ACTION (copy));
 	contextMenu->addAction (ACTION (paste));
 	contextMenu->addAction (ACTION (del));
-	
-	ACTION (editObject)->setEnabled (g_ForgeWindow->sel.size () == 1);
+	contextMenu->addSeparator ();
+	contextMenu->addAction (ACTION (setColor));
+	if (single)
+		contextMenu->addAction (ACTION (setContents));
+	contextMenu->addAction (ACTION (makeBorders));
 	
 	contextMenu->exec (pos);
 }

mercurial