gui.cpp

changeset 155
e21c24bfcdf3
parent 154
cc53e5cbad54
child 156
d35b7e440585
equal deleted inserted replaced
154:cc53e5cbad54 155:e21c24bfcdf3
66 EXTERN_ACTION (about) 66 EXTERN_ACTION (about)
67 EXTERN_ACTION (aboutQt) 67 EXTERN_ACTION (aboutQt)
68 EXTERN_ACTION (undo) 68 EXTERN_ACTION (undo)
69 EXTERN_ACTION (redo) 69 EXTERN_ACTION (redo)
70 EXTERN_ACTION (showHistory) 70 EXTERN_ACTION (showHistory)
71 EXTERN_ACTION (selectAll)
71 EXTERN_ACTION (selectByColor) 72 EXTERN_ACTION (selectByColor)
72 EXTERN_ACTION (selectByType) 73 EXTERN_ACTION (selectByType)
73 EXTERN_ACTION (moveXNeg) 74 EXTERN_ACTION (moveXNeg)
74 EXTERN_ACTION (moveYNeg) 75 EXTERN_ACTION (moveYNeg)
75 EXTERN_ACTION (moveZNeg) 76 EXTERN_ACTION (moveZNeg)
237 qEditMenu->addAction (ACTION (cut)); // Cut 238 qEditMenu->addAction (ACTION (cut)); // Cut
238 qEditMenu->addAction (ACTION (copy)); // Copy 239 qEditMenu->addAction (ACTION (copy)); // Copy
239 qEditMenu->addAction (ACTION (paste)); // Paste 240 qEditMenu->addAction (ACTION (paste)); // Paste
240 qEditMenu->addAction (ACTION (del)); // Delete 241 qEditMenu->addAction (ACTION (del)); // Delete
241 qEditMenu->addSeparator (); // ----- 242 qEditMenu->addSeparator (); // -----
243 qEditMenu->addAction (ACTION (selectAll)); // Select All
242 qEditMenu->addAction (ACTION (selectByColor)); // Select by Color 244 qEditMenu->addAction (ACTION (selectByColor)); // Select by Color
243 qEditMenu->addAction (ACTION (selectByType)); // Select by Type 245 qEditMenu->addAction (ACTION (selectByType)); // Select by Type
244 qEditMenu->addSeparator (); // ----- 246 qEditMenu->addSeparator (); // -----
245 247
246 QMenu* toolsMenu = menuBar ()->addMenu (tr ("&Tools")); 248 QMenu* toolsMenu = menuBar ()->addMenu (tr ("&Tools"));
356 g_CurrentToolBar->addAction (ACTION (paste)); 358 g_CurrentToolBar->addAction (ACTION (paste));
357 g_CurrentToolBar->addAction (ACTION (del)); 359 g_CurrentToolBar->addAction (ACTION (del));
358 360
359 // ========================================== 361 // ==========================================
360 initSingleToolBar ("Select"); 362 initSingleToolBar ("Select");
363 g_CurrentToolBar->addAction (ACTION (selectAll));
361 g_CurrentToolBar->addAction (ACTION (selectByColor)); 364 g_CurrentToolBar->addAction (ACTION (selectByColor));
362 g_CurrentToolBar->addAction (ACTION (selectByType)); 365 g_CurrentToolBar->addAction (ACTION (selectByType));
363 366
364 addToolBarBreak (Qt::TopToolBarArea); 367 addToolBarBreak (Qt::TopToolBarArea);
365 368
909 912
910 // ============================================================================= 913 // =============================================================================
911 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 914 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
912 // ============================================================================= 915 // =============================================================================
913 void ForgeWindow::spawnContextMenu (const QPoint pos) { 916 void ForgeWindow::spawnContextMenu (const QPoint pos) {
917 const bool single = (g_ForgeWindow->sel.size () == 1);
918
914 QMenu* contextMenu = new QMenu; 919 QMenu* contextMenu = new QMenu;
915 contextMenu->addAction (ACTION (editObject)); 920
916 contextMenu->addSeparator (); 921 if (single) {
922 contextMenu->addAction (ACTION (editObject));
923 contextMenu->addSeparator ();
924 }
925
917 contextMenu->addAction (ACTION (cut)); 926 contextMenu->addAction (ACTION (cut));
918 contextMenu->addAction (ACTION (copy)); 927 contextMenu->addAction (ACTION (copy));
919 contextMenu->addAction (ACTION (paste)); 928 contextMenu->addAction (ACTION (paste));
920 contextMenu->addAction (ACTION (del)); 929 contextMenu->addAction (ACTION (del));
921 930 contextMenu->addSeparator ();
922 ACTION (editObject)->setEnabled (g_ForgeWindow->sel.size () == 1); 931 contextMenu->addAction (ACTION (setColor));
932 if (single)
933 contextMenu->addAction (ACTION (setContents));
934 contextMenu->addAction (ACTION (makeBorders));
923 935
924 contextMenu->exec (pos); 936 contextMenu->exec (pos);
925 } 937 }
926 938
927 // ============================================================================= 939 // =============================================================================

mercurial