From 63a388d4332c3f69800ccf52903db4a3c9613a98 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Aug 26 2019 03:40:09 +0000 Subject: Reorganize Default menubar (#2545) * Reorganize menubar --- diff --git a/stuff/profiles/layouts/rooms/Default/menubar_template.xml b/stuff/profiles/layouts/rooms/Default/menubar_template.xml index 06dafa4..1898a36 100644 --- a/stuff/profiles/layouts/rooms/Default/menubar_template.xml +++ b/stuff/profiles/layouts/rooms/Default/menubar_template.xml @@ -1,254 +1,318 @@ - - MI_NewScene - MI_LoadScene - MI_SaveAll - MI_SaveScene - MI_SaveSceneAs - MI_OpenRecentScene - MI_RevertScene - - MI_LoadFolder - MI_LoadSubSceneFile - - MI_NewLevel - MI_LoadLevel - MI_SaveAllLevels - MI_SaveLevel - MI_SaveLevelAs - MI_ExportLevel - MI_OpenRecentLevel - - MI_ConvertFileWithInput - - MI_LoadColorModel - - MI_ImportMagpieFile - - MI_NewProject - MI_ProjectSettings - MI_SaveDefaultSettings - - MI_PreviewSettings - MI_Preview - - MI_OutputSettings - MI_Render - MI_FastRender - MI_SoundTrack - - MI_PrintXsheet - MI_Print - - MI_Preferences - MI_ShortcutPopup - - MI_RunScript - MI_OpenScriptConsole - - MI_Quit - MI_ReloadStyle - - - MI_Undo - MI_Redo - - MI_Cut - MI_Copy - MI_Paste - MI_PasteInto - - MI_Clear - MI_Insert - - MI_SelectAll - MI_InvertSelection - - MI_RemoveEndpoints - - MI_Group - MI_Ungroup - MI_EnterGroup - MI_ExitGroup - - MI_BringToFront - MI_BringForward - MI_SendBack - MI_SendBackward - - MI_TouchGestureControl - - - MI_DefineScanner - MI_ScanSettings - MI_Scan - MI_SetScanCropbox - MI_ResetScanCropbox - - MI_CleanupSettings - MI_CleanupPreview - MI_CameraTest - MI_Cleanup - - MI_PencilTest - - - MI_AddFrames - MI_Renumber - MI_ReplaceLevel - MI_RevertToCleanedUp - MI_RevertToLastSaved - MI_ConvertToVectors - MI_ConvertToToonzRaster - MI_ConvertVectorToVector - MI_Tracking - - MI_ExposeResource - MI_EditLevel - - MI_LevelSettings - MI_FileInfo - - MI_AdjustLevels - MI_AdjustThickness - MI_Antialias - MI_Binarize - MI_BrightnessAndContrast - MI_CanvasSize - MI_LinesFade - - MI_RemoveUnused - - - MI_SceneSettings - MI_CameraSettings - - MI_OpenChild - MI_CloseChild - MI_SaveSubxsheetAs - MI_Collapse - MI_Resequence - MI_CloneChild - MI_ExplodeChild - MI_ToggleEditInPlace - - MI_ApplyMatchLines - MI_MergeCmapped - - MI_MergeColumns - MI_DeleteMatchLines - MI_DeleteInk - - MI_InsertFx - MI_NewOutputFx - MI_NewNoteLevel - - MI_InsertSceneFrame - MI_RemoveSceneFrame - MI_InsertGlobalKeyframe - MI_RemoveGlobalKeyframe - - MI_NextFrame - MI_PrevFrame - MI_FirstFrame - MI_LastFrame - MI_NextDrawing - MI_PrevDrawing - MI_NextStep - MI_PrevStep - - MI_LipSyncPopup - - - MI_Reverse - MI_Swing - MI_Random - MI_Increment - MI_Dup - - MI_ResetStep - MI_IncreaseStep - MI_DecreaseStep - MI_Step2 - MI_Step3 - MI_Step4 - MI_Each2 - MI_Each3 - MI_Each4 - MI_Rollup - MI_Rolldown - MI_TimeStretch - MI_AutoInputCellNumber - - MI_DrawingSubForward - MI_DrawingSubBackward - MI_DrawingSubGroupForward - MI_DrawingSubGroupBackward - - MI_Autorenumber - MI_Duplicate - MI_MergeFrames - MI_CloneLevel - - - MI_ViewCamera - MI_ViewTable - MI_FieldGuide - MI_SafeArea - MI_ViewBBox - MI_ViewColorcard - MI_ViewGuide - MI_ViewRuler - - MI_TCheck - MI_ICheck - MI_Ink1Check - MI_PCheck - MI_IOnly - MI_BCheck - MI_GCheck - MI_ACheck - - MI_ShiftTrace - MI_EditShift - MI_NoShift - MI_ResetShift - - MI_RasterizePli - - MI_Link - - - MI_DockingCheck - - MI_OpenBatchServers - MI_OpenCleanupSettings - MI_OpenColorModel - MI_OpenFileBrowser - MI_OpenFileViewer - MI_OpenFunctionEditor - MI_OpenFilmStrip - MI_OpenPalette - MI_OpenFileBrowser2 - MI_OpenSchematic - MI_OpenStudioPalette - MI_OpenStyleControl - MI_OpenTasks - MI_OpenTMessage - MI_OpenToolbar - MI_OpenCommandToolbar - MI_OpenToolOptionBar - MI_OpenLevelView - MI_OpenComboViewer - MI_OpenXshView - MI_OpenTimelineView - MI_OpenHistoryPanel - MI_AudioRecording - - MI_ResetRoomLayout - - - MI_StartupPopup - MI_About - - \ No newline at end of file + + MI_NewScene + MI_LoadScene + MI_SaveAll + MI_SaveScene + MI_SaveSceneAs + MI_OpenRecentScene + MI_RevertScene + + MI_LoadFolder + MI_LoadSubSceneFile + + MI_ConvertFileWithInput + + MI_LoadColorModel + + + MI_NewProject + MI_ProjectSettings + + MI_SaveDefaultSettings + + + + MI_ImportMagpieFile + + + MI_SoundTrack + + + MI_PrintXsheet + MI_Print + + + MI_RunScript + MI_OpenScriptConsole + + + MI_Preferences + MI_ShortcutPopup + + MI_Quit + + + MI_Undo + MI_Redo + + MI_Cut + MI_Copy + MI_Paste + MI_PasteAbove + MI_PasteInto + MI_Insert + MI_InsertAbove + MI_Clear + + MI_SelectAll + MI_InvertSelection + + + MI_Group + MI_Ungroup + MI_EnterGroup + MI_ExitGroup + + + + MI_BringToFront + MI_BringForward + MI_SendBack + MI_SendBackward + + + + MI_DefineScanner + MI_ScanSettings + MI_Scan + MI_SetScanCropbox + MI_ResetScanCropbox + + MI_CleanupSettings + MI_CleanupPreview + MI_OpacityCheck + MI_CameraTest + MI_Cleanup + + MI_PencilTest + MI_Autocenter + + + + MI_NewLevel + + MI_NewToonzRasterLevel + MI_NewVectorLevel + MI_NewRasterLevel + MI_NewNoteLevel + + MI_LoadLevel + MI_SaveLevel + MI_SaveLevelAs + MI_SaveAllLevels + MI_OpenRecentLevel + MI_ExportLevel + + MI_AddFrames + MI_Renumber + MI_ReplaceLevel + MI_RevertToCleanedUp + MI_RevertToLastSaved + MI_Tracking + + + MI_BrightnessAndContrast + MI_AdjustLevels + MI_AdjustThickness + MI_Antialias + MI_Binarize + MI_LinesFade + + + MI_RemoveEndpoints + MI_ConvertVectorToVector + + + MI_ConvertToVectors + MI_ConvertToToonzRaster + + + MI_ExposeResource + MI_EditLevel + + MI_CanvasSize + MI_LevelSettings + MI_FileInfo + MI_ReplaceParentDirectory + + MI_RemoveUnused + + + MI_SceneSettings + MI_CameraSettings + + MI_OpenChild + MI_CloseChild + MI_SaveSubxsheetAs + MI_Collapse + MI_Resequence + MI_CloneChild + MI_ExplodeChild + MI_ToggleEditInPlace + + MI_ApplyMatchLines + MI_MergeCmapped + + MI_MergeColumns + MI_DeleteMatchLines + MI_DeleteInk + + MI_InsertFx + MI_NewOutputFx + + MI_InsertSceneFrame + MI_RemoveSceneFrame + MI_InsertGlobalKeyframe + MI_RemoveGlobalKeyframe + + MI_LipSyncPopup + + MI_RemoveEmptyColumns + + + MI_Reverse + MI_Swing + MI_Random + MI_Increment + MI_Dup + + + MI_Reframe1 + MI_Reframe2 + MI_Reframe3 + MI_Reframe4 + MI_ReframeWithEmptyInbetweens + + + MI_IncreaseStep + MI_DecreaseStep + MI_ResetStep + MI_Step2 + MI_Step3 + MI_Step4 + + + MI_Each2 + MI_Each3 + MI_Each4 + + MI_Rollup + MI_Rolldown + MI_TimeStretch + MI_AutoInputCellNumber + + + MI_DrawingSubBackward + MI_DrawingSubForward + MI_DrawingSubGroupBackward + MI_DrawingSubGroupForward + + + MI_Autorenumber + MI_Duplicate + MI_MergeFrames + MI_CloneLevel + + MI_FillEmptyCell + + + MI_Play + MI_Pause + MI_Loop + + MI_FirstFrame + MI_LastFrame + MI_PrevFrame + MI_NextFrame + MI_PrevStep + MI_NextStep + + MI_PrevDrawing + MI_NextDrawing + + MI_Link + + + MI_PreviewSettings + MI_Preview + MI_SavePreviewedFrames + + MI_OutputSettings + MI_Render + + MI_FastRender + + + MI_ViewTable + MI_ViewCamera + MI_ViewColorcard + MI_ViewBBox + + MI_SafeArea + MI_FieldGuide + MI_ViewRuler + MI_ViewGuide + + MI_TCheck + MI_ICheck + MI_Ink1Check + MI_PCheck + MI_IOnly + MI_BCheck + MI_GCheck + MI_ACheck + + MI_ShiftTrace + MI_EditShift + MI_NoShift + MI_ResetShift + + MI_RasterizePli + + + + MI_DockingCheck + + MI_ResetRoomLayout + + + MI_OpenCommandToolbar + MI_OpenToolbar + MI_OpenToolOptionBar + + MI_OpenStyleControl + MI_OpenPalette + MI_OpenStudioPalette + MI_OpenColorModel + + MI_OpenComboViewer + MI_OpenLevelView + MI_OpenFileViewer + + MI_OpenXshView + MI_OpenTimelineView + MI_OpenFunctionEditor + MI_OpenSchematic + MI_OpenFilmStrip + + MI_OpenFileBrowser + MI_OpenFileBrowser2 + + MI_OpenCleanupSettings + MI_OpenTasks + MI_OpenBatchServers + MI_OpenTMessage + MI_OpenHistoryPanel + MI_AudioRecording + MI_StartupPopup + + MI_MaximizePanel + MI_FullScreenWindow + + + MI_OpenOnlineManual + + MI_About + + diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp index 523277f..1d2c100 100644 --- a/toonz/sources/toonz/mainwindow.cpp +++ b/toonz/sources/toonz/mainwindow.cpp @@ -450,6 +450,7 @@ centralWidget->setLayout(centralWidgetLayout);*/ setCommandHandler(MI_PickStyleLines, this, &MainWindow::togglePickStyleLines); setCommandHandler(MI_About, this, &MainWindow::onAbout); + setCommandHandler(MI_OpenOnlineManual, this, &MainWindow::onOpenOnlineManual); setCommandHandler(MI_MaximizePanel, this, &MainWindow::maximizePanel); setCommandHandler(MI_FullScreenWindow, this, &MainWindow::fullScreenWindow); setCommandHandler("MI_NewVectorLevel", this, @@ -989,6 +990,12 @@ void MainWindow::onAbout() { //----------------------------------------------------------------------------- +void MainWindow::onOpenOnlineManual() { + QDesktopServices::openUrl(QUrl(tr("http://opentoonz.readthedocs.io"))); +} + +//----------------------------------------------------------------------------- + void MainWindow::autofillToggle() { TPaletteHandle *h = TApp::instance()->getCurrentPalette(); h->toggleAutopaint(); @@ -1629,7 +1636,7 @@ void MainWindow::defineActions() { createMenuEditAction(MI_RemoveEndpoints, tr("&Remove Vector Overflow"), ""); QAction *touchToggle = createToggle(MI_TouchGestureControl, tr("&Touch Gesture Control"), "", - TouchGestureControl ? 1 : 0, MenuEditCommandType); + TouchGestureControl ? 1 : 0, MiscCommandType); touchToggle->setEnabled(true); touchToggle->setIcon(QIcon(":Resources/touch.svg")); @@ -1958,6 +1965,7 @@ void MainWindow::defineActions() { "Ctrl+`"); createMenuWindowsAction(MI_About, tr("&About OpenToonz..."), ""); createMenuWindowsAction(MI_StartupPopup, tr("&Startup Popup..."), "Alt+S"); + createMenuWindowsAction(MI_OpenOnlineManual, tr("&Online Manual..."), "F1"); createRightClickMenuAction(MI_BlendColors, tr("&Blend colors"), ""); diff --git a/toonz/sources/toonz/mainwindow.h b/toonz/sources/toonz/mainwindow.h index ebb09f4..1e7379c 100644 --- a/toonz/sources/toonz/mainwindow.h +++ b/toonz/sources/toonz/mainwindow.h @@ -95,6 +95,7 @@ public: void autofillToggle(); void onUpgradeTabPro(); void onAbout(); + void onOpenOnlineManual(); void checkForUpdates(); int getRoomCount() const; Room *getRoom(int index) const; diff --git a/toonz/sources/toonz/menubar.cpp b/toonz/sources/toonz/menubar.cpp index 9248905..cc8d616 100644 --- a/toonz/sources/toonz/menubar.cpp +++ b/toonz/sources/toonz/menubar.cpp @@ -1087,54 +1087,38 @@ QMenuBar *StackedMenuBar::createFullMenuBar() { addMenuItem(fileMenu, MI_LoadFolder); addMenuItem(fileMenu, MI_LoadSubSceneFile); fileMenu->addSeparator(); - addMenuItem(fileMenu, MI_NewLevel); - addMenuItem(fileMenu, MI_LoadLevel); - addMenuItem(fileMenu, MI_SaveAllLevels); - addMenuItem(fileMenu, MI_SaveLevel); - addMenuItem(fileMenu, MI_SaveLevelAs); - addMenuItem(fileMenu, MI_ExportLevel); - addMenuItem(fileMenu, MI_OpenRecentLevel); - fileMenu->addSeparator(); addMenuItem(fileMenu, MI_ConvertFileWithInput); fileMenu->addSeparator(); addMenuItem(fileMenu, MI_LoadColorModel); fileMenu->addSeparator(); - addMenuItem(fileMenu, MI_ImportMagpieFile); - fileMenu->addSeparator(); - addMenuItem(fileMenu, MI_NewProject); - addMenuItem(fileMenu, MI_ProjectSettings); - addMenuItem(fileMenu, MI_SaveDefaultSettings); - fileMenu->addSeparator(); - addMenuItem(fileMenu, MI_PreviewSettings); - addMenuItem(fileMenu, MI_Preview); - // addMenuItem(fileMenu, MI_SavePreview); + QMenu *projectManagementMenu = fileMenu->addMenu(tr("Project Management")); + { + addMenuItem(projectManagementMenu, MI_NewProject); + addMenuItem(projectManagementMenu, MI_ProjectSettings); + projectManagementMenu->addSeparator(); + addMenuItem(projectManagementMenu, MI_SaveDefaultSettings); + } fileMenu->addSeparator(); - addMenuItem(fileMenu, MI_OutputSettings); - addMenuItem(fileMenu, MI_Render); - addMenuItem(fileMenu, MI_FastRender); - addMenuItem(fileMenu, MI_SoundTrack); - // addMenuItem(fileMenu, MI_SavePreviewedFrames); + QMenu *importMenu = fileMenu->addMenu(tr("Import")); + { addMenuItem(importMenu, MI_ImportMagpieFile); } + QMenu *exportMenu = fileMenu->addMenu(tr("Export")); + { addMenuItem(exportMenu, MI_SoundTrack); } fileMenu->addSeparator(); addMenuItem(fileMenu, MI_PrintXsheet); addMenuItem(fileMenu, MI_Print); + addMenuItem(fileMenu, MI_Export); + fileMenu->addSeparator(); + QMenu *scriptMenu = fileMenu->addMenu(tr("Script")); + { + addMenuItem(scriptMenu, "MI_RunScript"); + addMenuItem(scriptMenu, "MI_OpenScriptConsole"); + } fileMenu->addSeparator(); addMenuItem(fileMenu, MI_Preferences); addMenuItem(fileMenu, MI_ShortcutPopup); fileMenu->addSeparator(); - // addMenuItem(fileMenu, MI_Export); - // addMenuItem(fileMenu, MI_TestAnimation); - // fileMenu->addSeparator(); - - addMenuItem(fileMenu, "MI_RunScript"); - addMenuItem(fileMenu, "MI_OpenScriptConsole"); - - fileMenu->addSeparator(); addMenuItem(fileMenu, MI_Quit); -#ifndef NDEBUG - addMenuItem(fileMenu, "MI_ReloadStyle"); -#endif - // Menu' EDIT QMenu *editMenu = addMenu(tr("Edit"), fullMenuBar); addMenuItem(editMenu, MI_Undo); @@ -1146,29 +1130,28 @@ QMenuBar *StackedMenuBar::createFullMenuBar() { addMenuItem(editMenu, MI_PasteAbove); // addMenuItem(editMenu, MI_PasteNew); addMenuItem(editMenu, MI_PasteInto); - editMenu->addSeparator(); - addMenuItem(editMenu, MI_Clear); addMenuItem(editMenu, MI_Insert); addMenuItem(editMenu, MI_InsertAbove); + addMenuItem(editMenu, MI_Clear); editMenu->addSeparator(); addMenuItem(editMenu, MI_SelectAll); addMenuItem(editMenu, MI_InvertSelection); editMenu->addSeparator(); - addMenuItem(editMenu, MI_RemoveEndpoints); - editMenu->addSeparator(); - addMenuItem(editMenu, MI_Group); - addMenuItem(editMenu, MI_Ungroup); - addMenuItem(editMenu, MI_EnterGroup); - addMenuItem(editMenu, MI_ExitGroup); - editMenu->addSeparator(); - - addMenuItem(editMenu, MI_BringToFront); - addMenuItem(editMenu, MI_BringForward); - addMenuItem(editMenu, MI_SendBack); - addMenuItem(editMenu, MI_SendBackward); - + QMenu *groupMenu = editMenu->addMenu(tr("Group")); + { + addMenuItem(groupMenu, MI_Group); + addMenuItem(groupMenu, MI_Ungroup); + addMenuItem(groupMenu, MI_EnterGroup); + addMenuItem(groupMenu, MI_ExitGroup); + } editMenu->addSeparator(); - addMenuItem(editMenu, MI_TouchGestureControl); + QMenu *arrangeMenu = editMenu->addMenu(tr("Arrange")); + { + addMenuItem(arrangeMenu, MI_BringToFront); + addMenuItem(arrangeMenu, MI_BringForward); + addMenuItem(arrangeMenu, MI_SendBack); + addMenuItem(arrangeMenu, MI_SendBackward); + } // Menu' SCAN CLEANUP #ifdef LINETEST @@ -1176,16 +1159,11 @@ QMenuBar *StackedMenuBar::createFullMenuBar() { #else QMenu *scanCleanupMenu = addMenu(tr("Scan && Cleanup"), fullMenuBar); #endif - addMenuItem(scanCleanupMenu, MI_DefineScanner); addMenuItem(scanCleanupMenu, MI_ScanSettings); addMenuItem(scanCleanupMenu, MI_Scan); addMenuItem(scanCleanupMenu, MI_SetScanCropbox); addMenuItem(scanCleanupMenu, MI_ResetScanCropbox); -#ifdef LINETEST - scanCleanupMenu->addSeparator(); - addMenuItem(scanCleanupMenu, MI_Autocenter); -#else scanCleanupMenu->addSeparator(); addMenuItem(scanCleanupMenu, MI_CleanupSettings); addMenuItem(scanCleanupMenu, MI_CleanupPreview); @@ -1193,33 +1171,63 @@ QMenuBar *StackedMenuBar::createFullMenuBar() { addMenuItem(scanCleanupMenu, MI_Cleanup); scanCleanupMenu->addSeparator(); addMenuItem(scanCleanupMenu, MI_PencilTest); +#ifdef LINETEST + scanCleanupMenu->addSeparator(); + addMenuItem(scanCleanupMenu, MI_Autocenter); #endif // Menu' LEVEL QMenu *levelMenu = addMenu(tr("Level"), fullMenuBar); + QMenu *newMenu = levelMenu->addMenu(tr("New")); + { + addMenuItem(newMenu, MI_NewLevel); + newMenu->addSeparator(); + addMenuItem(newMenu, MI_NewToonzRasterLevel); + addMenuItem(newMenu, MI_NewVectorLevel); + addMenuItem(newMenu, MI_NewRasterLevel); + addMenuItem(newMenu, MI_NewNoteLevel); + } + addMenuItem(levelMenu, MI_LoadLevel); + addMenuItem(levelMenu, MI_SaveLevel); + addMenuItem(levelMenu, MI_SaveLevelAs); + addMenuItem(levelMenu, MI_SaveAllLevels); + addMenuItem(levelMenu, MI_OpenRecentLevel); + addMenuItem(levelMenu, MI_ExportLevel); + levelMenu->addSeparator(); addMenuItem(levelMenu, MI_AddFrames); addMenuItem(levelMenu, MI_Renumber); addMenuItem(levelMenu, MI_ReplaceLevel); addMenuItem(levelMenu, MI_RevertToCleanedUp); addMenuItem(levelMenu, MI_RevertToLastSaved); - addMenuItem(levelMenu, MI_ConvertToVectors); - addMenuItem(levelMenu, MI_ConvertToToonzRaster); - addMenuItem(levelMenu, MI_ConvertVectorToVector); addMenuItem(levelMenu, MI_Tracking); levelMenu->addSeparator(); + QMenu *adjustMenu = levelMenu->addMenu(tr("Adjust")); + { + addMenuItem(adjustMenu, MI_BrightnessAndContrast); + addMenuItem(adjustMenu, MI_AdjustLevels); + addMenuItem(adjustMenu, MI_AdjustThickness); + addMenuItem(adjustMenu, MI_Antialias); + addMenuItem(adjustMenu, MI_Binarize); + addMenuItem(adjustMenu, MI_LinesFade); + } + QMenu *optimizeMenu = levelMenu->addMenu(tr("Optimize")); + { + addMenuItem(optimizeMenu, MI_RemoveEndpoints); + addMenuItem(optimizeMenu, MI_ConvertVectorToVector); + } + QMenu *convertMenu = levelMenu->addMenu(tr("Convert")); + { + addMenuItem(convertMenu, MI_ConvertToVectors); + addMenuItem(convertMenu, MI_ConvertToToonzRaster); + } + levelMenu->addSeparator(); addMenuItem(levelMenu, MI_ExposeResource); addMenuItem(levelMenu, MI_EditLevel); levelMenu->addSeparator(); + addMenuItem(levelMenu, MI_CanvasSize); addMenuItem(levelMenu, MI_LevelSettings); addMenuItem(levelMenu, MI_FileInfo); - levelMenu->addSeparator(); - addMenuItem(levelMenu, MI_AdjustLevels); - addMenuItem(levelMenu, MI_AdjustThickness); - addMenuItem(levelMenu, MI_Antialias); - addMenuItem(levelMenu, MI_Binarize); - addMenuItem(levelMenu, MI_BrightnessAndContrast); - addMenuItem(levelMenu, MI_CanvasSize); - addMenuItem(levelMenu, MI_LinesFade); + addMenuItem(levelMenu, MI_ReplaceParentDirectory); levelMenu->addSeparator(); addMenuItem(levelMenu, MI_RemoveUnused); #ifdef LINETEST @@ -1245,29 +1253,20 @@ QMenuBar *StackedMenuBar::createFullMenuBar() { addMenuItem(xsheetMenu, MI_MergeCmapped); xsheetMenu->addSeparator(); addMenuItem(xsheetMenu, MI_MergeColumns); - addMenuItem(xsheetMenu, MI_DeleteMatchLines); addMenuItem(xsheetMenu, MI_DeleteInk); xsheetMenu->addSeparator(); addMenuItem(xsheetMenu, MI_InsertFx); addMenuItem(xsheetMenu, MI_NewOutputFx); - addMenuItem(xsheetMenu, MI_NewNoteLevel); - addMenuItem(xsheetMenu, MI_RemoveEmptyColumns); xsheetMenu->addSeparator(); addMenuItem(xsheetMenu, MI_InsertSceneFrame); addMenuItem(xsheetMenu, MI_RemoveSceneFrame); addMenuItem(xsheetMenu, MI_InsertGlobalKeyframe); addMenuItem(xsheetMenu, MI_RemoveGlobalKeyframe); xsheetMenu->addSeparator(); - addMenuItem(xsheetMenu, MI_NextFrame); - addMenuItem(xsheetMenu, MI_PrevFrame); - addMenuItem(xsheetMenu, MI_FirstFrame); - addMenuItem(xsheetMenu, MI_LastFrame); - addMenuItem(xsheetMenu, MI_NextDrawing); - addMenuItem(xsheetMenu, MI_PrevDrawing); - addMenuItem(xsheetMenu, MI_NextStep); - addMenuItem(xsheetMenu, MI_PrevStep); addMenuItem(xsheetMenu, MI_LipSyncPopup); + xsheetMenu->addSeparator(); + addMenuItem(xsheetMenu, MI_RemoveEmptyColumns); // Menu' CELLS QMenu *cellsMenu = addMenu(tr("Cells"), fullMenuBar); @@ -1277,41 +1276,90 @@ QMenuBar *StackedMenuBar::createFullMenuBar() { addMenuItem(cellsMenu, MI_Increment); addMenuItem(cellsMenu, MI_Dup); cellsMenu->addSeparator(); - addMenuItem(cellsMenu, MI_ResetStep); - addMenuItem(cellsMenu, MI_IncreaseStep); - addMenuItem(cellsMenu, MI_DecreaseStep); - addMenuItem(cellsMenu, MI_Step2); - addMenuItem(cellsMenu, MI_Step3); - addMenuItem(cellsMenu, MI_Step4); - addMenuItem(cellsMenu, MI_Each2); - addMenuItem(cellsMenu, MI_Each3); - addMenuItem(cellsMenu, MI_Each4); + QMenu *reframeMenu = cellsMenu->addMenu(tr("Reframe")); + { + addMenuItem(reframeMenu, MI_Reframe1); + addMenuItem(reframeMenu, MI_Reframe2); + addMenuItem(reframeMenu, MI_Reframe3); + addMenuItem(reframeMenu, MI_Reframe4); + addMenuItem(reframeMenu, MI_ReframeWithEmptyInbetweens); + } + QMenu *stepMenu = cellsMenu->addMenu(tr("Step")); + { + addMenuItem(stepMenu, MI_IncreaseStep); + addMenuItem(stepMenu, MI_DecreaseStep); + addMenuItem(stepMenu, MI_ResetStep); + addMenuItem(stepMenu, MI_Step2); + addMenuItem(stepMenu, MI_Step3); + addMenuItem(stepMenu, MI_Step4); + } + QMenu *eachMenu = cellsMenu->addMenu(tr("Each")); + { + addMenuItem(eachMenu, MI_Each2); + addMenuItem(eachMenu, MI_Each3); + addMenuItem(eachMenu, MI_Each4); + } addMenuItem(cellsMenu, MI_Rollup); addMenuItem(cellsMenu, MI_Rolldown); addMenuItem(cellsMenu, MI_TimeStretch); - addMenuItem(cellsMenu, MI_FillEmptyCell); + addMenuItem(cellsMenu, MI_AutoInputCellNumber); cellsMenu->addSeparator(); - addMenuItem(cellsMenu, MI_DrawingSubForward); - addMenuItem(cellsMenu, MI_DrawingSubBackward); - addMenuItem(cellsMenu, MI_DrawingSubGroupForward); - addMenuItem(cellsMenu, MI_DrawingSubGroupBackward); + QMenu *drawingSubMenu = cellsMenu->addMenu(tr("Drawing Substitution")); + { + addMenuItem(drawingSubMenu, MI_DrawingSubForward); + addMenuItem(drawingSubMenu, MI_DrawingSubBackward); + addMenuItem(drawingSubMenu, MI_DrawingSubGroupForward); + addMenuItem(drawingSubMenu, MI_DrawingSubGroupBackward); + } cellsMenu->addSeparator(); addMenuItem(cellsMenu, MI_Autorenumber); addMenuItem(cellsMenu, MI_Duplicate); addMenuItem(cellsMenu, MI_MergeFrames); addMenuItem(cellsMenu, MI_CloneLevel); + cellsMenu->addSeparator(); + addMenuItem(cellsMenu, MI_FillEmptyCell); + + // Menu' PLAY + QMenu *playMenu = addMenu(tr("Play"), fullMenuBar); + addMenuItem(playMenu, MI_Play); + addMenuItem(playMenu, MI_Pause); + addMenuItem(playMenu, MI_Loop); + playMenu->addSeparator(); + addMenuItem(playMenu, MI_FirstFrame); + addMenuItem(playMenu, MI_LastFrame); + addMenuItem(playMenu, MI_PrevFrame); + addMenuItem(playMenu, MI_NextFrame); + addMenuItem(playMenu, MI_PrevStep); + addMenuItem(playMenu, MI_NextStep); + playMenu->addSeparator(); + addMenuItem(playMenu, MI_NextDrawing); + addMenuItem(playMenu, MI_PrevDrawing); + playMenu->addSeparator(); + addMenuItem(playMenu, MI_Link); + + // Menu' RENDER + QMenu *renderMenu = addMenu(tr("Render"), fullMenuBar); + addMenuItem(renderMenu, MI_PreviewSettings); + addMenuItem(renderMenu, MI_Preview); + // addMenuItem(renderMenu, MI_SavePreview); + addMenuItem(renderMenu, MI_SavePreviewedFrames); + renderMenu->addSeparator(); + addMenuItem(renderMenu, MI_OutputSettings); + addMenuItem(renderMenu, MI_Render); + renderMenu->addSeparator(); + addMenuItem(renderMenu, MI_FastRender); // Menu' VIEW QMenu *viewMenu = addMenu(tr("View"), fullMenuBar); - - addMenuItem(viewMenu, MI_ViewCamera); addMenuItem(viewMenu, MI_ViewTable); - addMenuItem(viewMenu, MI_FieldGuide); - addMenuItem(viewMenu, MI_SafeArea); - addMenuItem(viewMenu, MI_ViewBBox); + addMenuItem(viewMenu, MI_ViewCamera); addMenuItem(viewMenu, MI_ViewColorcard); - addMenuItem(viewMenu, MI_ViewGuide); + addMenuItem(viewMenu, MI_ViewBBox); + viewMenu->addSeparator(); + addMenuItem(viewMenu, MI_SafeArea); + addMenuItem(viewMenu, MI_FieldGuide); addMenuItem(viewMenu, MI_ViewRuler); + addMenuItem(viewMenu, MI_ViewGuide); viewMenu->addSeparator(); addMenuItem(viewMenu, MI_TCheck); addMenuItem(viewMenu, MI_ICheck); @@ -1328,55 +1376,70 @@ QMenuBar *StackedMenuBar::createFullMenuBar() { addMenuItem(viewMenu, MI_ResetShift); viewMenu->addSeparator(); addMenuItem(viewMenu, MI_RasterizePli); - viewMenu->addSeparator(); - addMenuItem(viewMenu, MI_Link); #ifdef LINETEST viewMenu->addSeparator(); addMenuItem(viewMenu, MI_CapturePanelFieldGuide); #endif // Menu' WINDOWS - QMenu *windowsMenu = addMenu(tr("Windows"), fullMenuBar); - addMenuItem(windowsMenu, MI_DockingCheck); + QMenu *windowsMenu = addMenu(tr("Windows"), fullMenuBar); + QMenu *workspaceMenu = windowsMenu->addMenu(tr("Workspace")); + { + addMenuItem(workspaceMenu, MI_DockingCheck); + workspaceMenu->addSeparator(); + addMenuItem(workspaceMenu, MI_ResetRoomLayout); + } + addMenuItem(windowsMenu, MI_OpenCommandToolbar); + addMenuItem(windowsMenu, MI_OpenToolbar); + addMenuItem(windowsMenu, MI_OpenToolOptionBar); windowsMenu->addSeparator(); - addMenuItem(windowsMenu, MI_OpenBatchServers); - addMenuItem(windowsMenu, MI_OpenCleanupSettings); + addMenuItem(windowsMenu, MI_OpenStyleControl); + addMenuItem(windowsMenu, MI_OpenPalette); + addMenuItem(windowsMenu, MI_OpenStudioPalette); addMenuItem(windowsMenu, MI_OpenColorModel); -#ifdef LINETEST - addMenuItem(windowsMenu, MI_OpenExport); -#endif - addMenuItem(windowsMenu, MI_OpenFileBrowser); + windowsMenu->addSeparator(); + addMenuItem(windowsMenu, MI_OpenComboViewer); + addMenuItem(windowsMenu, MI_OpenLevelView); addMenuItem(windowsMenu, MI_OpenFileViewer); + windowsMenu->addSeparator(); + addMenuItem(windowsMenu, MI_OpenXshView); + addMenuItem(windowsMenu, MI_OpenTimelineView); addMenuItem(windowsMenu, MI_OpenFunctionEditor); + addMenuItem(windowsMenu, MI_OpenSchematic); addMenuItem(windowsMenu, MI_OpenFilmStrip); -#ifdef LINETEST - addMenuItem(windowsMenu, MI_OpenLineTestCapture); - addMenuItem(windowsMenu, MI_OpenLineTestView); -#endif - addMenuItem(windowsMenu, MI_OpenPalette); + windowsMenu->addSeparator(); + addMenuItem(windowsMenu, MI_OpenFileBrowser); addMenuItem(windowsMenu, MI_OpenFileBrowser2); - addMenuItem(windowsMenu, MI_OpenSchematic); - addMenuItem(windowsMenu, MI_OpenStudioPalette); - addMenuItem(windowsMenu, MI_OpenStyleControl); + windowsMenu->addSeparator(); + addMenuItem(windowsMenu, MI_OpenCleanupSettings); addMenuItem(windowsMenu, MI_OpenTasks); + addMenuItem(windowsMenu, MI_OpenBatchServers); addMenuItem(windowsMenu, MI_OpenTMessage); - addMenuItem(windowsMenu, MI_OpenToolbar); - addMenuItem(windowsMenu, MI_OpenCommandToolbar); - addMenuItem(windowsMenu, MI_OpenToolOptionBar); - addMenuItem(windowsMenu, MI_OpenLevelView); - addMenuItem(windowsMenu, MI_OpenComboViewer); - addMenuItem(windowsMenu, MI_OpenXshView); - addMenuItem(windowsMenu, MI_OpenTimelineView); addMenuItem(windowsMenu, MI_OpenHistoryPanel); addMenuItem(windowsMenu, MI_AudioRecording); + addMenuItem(windowsMenu, MI_StartupPopup); +#ifdef LINETEST windowsMenu->addSeparator(); - addMenuItem(windowsMenu, MI_ResetRoomLayout); + addMenuItem(windowsMenu, MI_OpenExport); + addMenuItem(windowsMenu, MI_OpenLineTestCapture); + addMenuItem(windowsMenu, MI_OpenLineTestView); +#endif + windowsMenu->addSeparator(); + addMenuItem(windowsMenu, MI_MaximizePanel); + addMenuItem(windowsMenu, MI_FullScreenWindow); - //---Help Menu + // Menu' HELP QMenu *helpMenu = addMenu(tr("Help"), fullMenuBar); - addMenuItem(helpMenu, MI_StartupPopup); + addMenuItem(helpMenu, MI_OpenOnlineManual); + helpMenu->addSeparator(); addMenuItem(helpMenu, MI_About); +// addMenuItem(fileMenu, MI_TestAnimation); +// fileMenu->addSeparator(); +#ifndef NDEBUG + addMenuItem(fileMenu, "MI_ReloadStyle"); +#endif + return fullMenuBar; } diff --git a/toonz/sources/toonz/menubarcommandids.h b/toonz/sources/toonz/menubarcommandids.h index 996825b..c23f11a 100644 --- a/toonz/sources/toonz/menubarcommandids.h +++ b/toonz/sources/toonz/menubarcommandids.h @@ -344,4 +344,6 @@ #define MI_TouchGestureControl "MI_TouchGestureControl" #define MI_SeparateColors "MI_SeparateColors" +#define MI_OpenOnlineManual "MI_OpenOnlineManual" + #endif diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cpp index 5a88c82..4f7334b 100644 --- a/toonz/sources/toonz/preferencespopup.cpp +++ b/toonz/sources/toonz/preferencespopup.cpp @@ -1240,6 +1240,20 @@ void PreferencesPopup::onCurrentColumnDataChanged(const TPixel32 &, //--------------------------------------------------------------------------------------- +void PreferencesPopup::onEnableTouchGesturesChanged(int index) { + QAction *action = + CommandManager::instance()->getAction(MI_TouchGestureControl); + action->setChecked(index == Qt::Checked); +} + +//--------------------------------------------------------------------------------------- + +void PreferencesPopup::onEnableTouchGesturesTriggered(bool checked) { + m_enableTouchGestures->setChecked(checked); +} + +//--------------------------------------------------------------------------------------- + void PreferencesPopup::onEnableWinInkChanged(int index) { m_pref->enableWinInk(index == Qt::Checked); } @@ -1262,10 +1276,10 @@ PreferencesPopup::PreferencesPopup() , m_inksOnly(0) , m_blanksCount(0) , m_blankColor(0) { - bool showTabletSettings = false; + bool winInkAvailable = false; #ifdef _WIN32 - showTabletSettings = KisTabletSupportWin8::isAvailable(); + winInkAvailable = KisTabletSupportWin8::isAvailable(); #endif setWindowTitle(tr("Preferences")); @@ -1605,9 +1619,13 @@ PreferencesPopup::PreferencesPopup() QLabel *note_tablet; //--- Tablet Settings ------------------------------ - if (showTabletSettings) { - categoryList->addItem(tr("Tablet Settings")); + categoryList->addItem(tr("Touch/Tablet Settings")); + + m_enableTouchGestures = + new DVGui::CheckBox(tr("Enable Touch Gesture Controls")); + + if (winInkAvailable) { m_enableWinInk = new DVGui::CheckBox(tr("Enable Windows Ink Support* (EXPERIMENTAL)")); @@ -1943,7 +1961,11 @@ PreferencesPopup::PreferencesPopup() checkForTheLatestVersionCB->setChecked(m_pref->isLatestVersionCheckEnabled()); //--- Tablet Settings ------------------------------ - if (showTabletSettings) m_enableWinInk->setChecked(m_pref->isWinInkEnabled()); + m_enableTouchGestures->setChecked(CommandManager::instance() + ->getAction(MI_TouchGestureControl) + ->isChecked()); + + if (winInkAvailable) m_enableWinInk->setChecked(m_pref->isWinInkEnabled()); /*--- layout ---*/ @@ -2717,21 +2739,23 @@ PreferencesPopup::PreferencesPopup() stackedWidget->addWidget(versionControlBox); //--- Tablet Settings -------------------------- - if (showTabletSettings) { - QWidget *tabletSettingsBox = new QWidget(this); - QVBoxLayout *tsLay = new QVBoxLayout(); - tsLay->setMargin(15); - tsLay->setSpacing(10); - { + QWidget *tabletSettingsBox = new QWidget(this); + QVBoxLayout *tsLay = new QVBoxLayout(); + tsLay->setMargin(15); + tsLay->setSpacing(10); + { + tsLay->addWidget(m_enableTouchGestures, 0, + Qt::AlignLeft | Qt::AlignVCenter); + + if (winInkAvailable) tsLay->addWidget(m_enableWinInk, 0, Qt::AlignLeft | Qt::AlignVCenter); - tsLay->addStretch(1); + tsLay->addStretch(1); - tsLay->addWidget(note_tablet, 0); - } - tabletSettingsBox->setLayout(tsLay); - stackedWidget->addWidget(tabletSettingsBox); + if (winInkAvailable) tsLay->addWidget(note_tablet, 0); } + tabletSettingsBox->setLayout(tsLay); + stackedWidget->addWidget(tabletSettingsBox); mainLayout->addWidget(stackedWidget, 1); } @@ -3067,8 +3091,16 @@ PreferencesPopup::PreferencesPopup() ret = ret && connect(checkForTheLatestVersionCB, SIGNAL(clicked(bool)), SLOT(onCheckLatestVersionChanged(bool))); - //--- Tablet Settings ---------------------- - if (showTabletSettings) + //--- Touch/Tablet Settings ---------------------- + ret = ret && connect(m_enableTouchGestures, SIGNAL(stateChanged(int)), + SLOT(onEnableTouchGesturesChanged(int))); + + QAction *action = + CommandManager::instance()->getAction(MI_TouchGestureControl); + ret = ret && connect(action, SIGNAL(triggered(bool)), + SLOT(onEnableTouchGesturesTriggered(bool))); + + if (winInkAvailable) ret = ret && connect(m_enableWinInk, SIGNAL(stateChanged(int)), SLOT(onEnableWinInkChanged(int))); diff --git a/toonz/sources/toonz/preferencespopup.h b/toonz/sources/toonz/preferencespopup.h index 02e1d61..c893e3a 100644 --- a/toonz/sources/toonz/preferencespopup.h +++ b/toonz/sources/toonz/preferencespopup.h @@ -82,7 +82,7 @@ private: *m_useHigherDpiOnVectorSimplifyCB, *m_keepFillOnVectorSimplifyCB, *m_newLevelToCameraSizeCB, *m_ignoreImageDpiCB, *m_syncLevelRenumberWithXsheet, *m_downArrowInLevelStripCreatesNewFrame, - *m_enableAutoStretch, *m_enableWinInk, + *m_enableAutoStretch, *m_enableWinInk, *m_enableTouchGestures, *m_useOnionColorsForShiftAndTraceCB; DVGui::FileField *m_customProjectRootFileField; @@ -219,6 +219,8 @@ private slots: void onCursorBrushStyleChanged(int index); void onCursorOutlineChanged(int); void onCurrentColumnDataChanged(const TPixel32 &, bool isDragging); + void onEnableTouchGesturesChanged(int index); + void onEnableTouchGesturesTriggered(bool checked); void onEnableWinInkChanged(int index); void onRasterBackgroundColorChanged(const TPixel32 &, bool isDragging); };