diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp index c1a379f..aa23093 100644 --- a/toonz/sources/toonz/mainwindow.cpp +++ b/toonz/sources/toonz/mainwindow.cpp @@ -433,6 +433,8 @@ centralWidget->setLayout(centralWidgetLayout);*/ setCommandHandler(MI_PickStyleLines, this, &MainWindow::togglePickStyleLines); setCommandHandler(MI_About, this, &MainWindow::onAbout); + setCommandHandler(MI_MaximizePanel, this, &MainWindow::maximizePanel); + setCommandHandler(MI_FullScreenWindow, this, &MainWindow::fullScreenWindow); } //----------------------------------------------------------------------------- @@ -1094,6 +1096,21 @@ void MainWindow::resetRoomsLayout() { QObject::tr("The rooms will be reset the next time you run Toonz.")); } +void MainWindow::maximizePanel() { + DockLayout *currDockLayout = getCurrentRoom()->dockLayout(); + QPoint p = mapFromGlobal(QCursor::pos()); + QWidget *currWidget = currDockLayout->containerOf(p); + DockWidget *currW = dynamic_cast(currWidget); + if (currW) currW->maximizeDock(); +} + +void MainWindow::fullScreenWindow() { + if (isFullScreen()) + setWindowState(Qt::WindowMaximized); + else + setWindowState(Qt::WindowFullScreen); +} + //----------------------------------------------------------------------------- void MainWindow::onCurrentRoomChanged(int newRoomIndex) { @@ -1881,12 +1898,15 @@ void MainWindow::defineActions() { createMenuWindowsAction(MI_ResetRoomLayout, tr("&Reset to Default Rooms"), ""); - + createMenuWindowsAction(MI_MaximizePanel, tr("Toggle Maximize Panel"), "`"); + createMenuWindowsAction(MI_FullScreenWindow, + tr("Toggle Main Window's Full Screen Mode"), + "Ctrl+`"); createMenuWindowsAction(MI_About, tr("&About OpenToonz..."), ""); createRightClickMenuAction(MI_BlendColors, tr("&Blend colors"), ""); - createToggle(MI_OnionSkin, tr("Onion Skin"), "", false, + createToggle(MI_OnionSkin, tr("Onion Skin Toggle"), "//", false, RightClickMenuCommandType); createToggle(MI_ZeroThick, tr("Zero Thick Lines"), "Shift+/", false, RightClickMenuCommandType); diff --git a/toonz/sources/toonz/mainwindow.h b/toonz/sources/toonz/mainwindow.h index 2b3d8c0..8efc118 100644 --- a/toonz/sources/toonz/mainwindow.h +++ b/toonz/sources/toonz/mainwindow.h @@ -69,7 +69,6 @@ class MainWindow final : public QMainWindow { bool m_saveSettingsOnQuit; int m_oldRoomIndex; QString m_currentRoomsChoice; - UpdateChecker *m_updateChecker; TopBar *m_topBar; @@ -100,6 +99,8 @@ public: void onLoadScene(); void onLoadSubScene(); void resetRoomsLayout(); + void maximizePanel(); + void fullScreenWindow(); void autofillToggle(); void onUpgradeTabPro(); void onAbout(); diff --git a/toonz/sources/toonz/menubarcommandids.h b/toonz/sources/toonz/menubarcommandids.h index 7df35db..ac9a5bf 100644 --- a/toonz/sources/toonz/menubarcommandids.h +++ b/toonz/sources/toonz/menubarcommandids.h @@ -220,7 +220,8 @@ #define MI_OpenXshView "MI_OpenXshView" #define MI_OpenCleanupSettings "MI_OpenCleanupSettings" #define MI_ResetRoomLayout "MI_ResetRoomLayout" - +#define MI_MaximizePanel "MI_MaximizePanel" +#define MI_FullScreenWindow "MI_FullScreenWindow" #define MI_OnionSkin "MI_OnionSkin" #define MI_ZeroThick "MI_ZeroThick" diff --git a/toonz/sources/toonzqt/docklayout.h b/toonz/sources/toonzqt/docklayout.h index 9867b5a..b19472a 100644 --- a/toonz/sources/toonzqt/docklayout.h +++ b/toonz/sources/toonzqt/docklayout.h @@ -168,6 +168,8 @@ class DVAPI DockWidget : public QWidget { // privates friend class DockPlaceholder; // As above. // friend Region; //Regions need access to m_saveIndex field. +public: + void maximizeDock(); protected: // Private attributes for dragging purposes diff --git a/toonz/sources/toonzqt/dockwidget.cpp b/toonz/sources/toonzqt/dockwidget.cpp index 3f28c25..44b58cf 100644 --- a/toonz/sources/toonzqt/dockwidget.cpp +++ b/toonz/sources/toonzqt/dockwidget.cpp @@ -385,6 +385,13 @@ void DockWidget::mouseDoubleClickEvent(QMouseEvent *me) { //------------------------------------- +void DockWidget::maximizeDock() { + if (!m_floating) { + parentLayout()->setMaximized(this, !m_maximized); + } +} + +//------------------------------------- //! Switch in selected dock placeholder's hierarchy. void DockWidget::wheelEvent(QWheelEvent *we) { if (m_dragging) {