Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

add small fix and clang format

shun_iwasawa01efa1435879
diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp
index 956ab0a98..9e02bb666 100644
--- a/toonz/sources/toonz/mainwindow.cpp
+++ b/toonz/sources/toonz/mainwindow.cpp
@@ -432,9 +432,9 @@ centralWidget->setLayout(centralWidgetLayout);*/
setCommandHandler(MI_PickStyleAreas, this, &MainWindow::togglePickStyleAreas);
setCommandHandler(MI_PickStyleLines, this, &MainWindow::togglePickStyleLines);
- setCommandHandler(MI_About, this, &MainWindow::onAbout);
- setCommandHandler(MI_MaximizePanel, this, &MainWindow::maximizePanel);
- setCommandHandler(MI_FullScreenWindow, this, &MainWindow::fullScreenWindow);
+ setCommandHandler(MI_About, this, &MainWindow::onAbout);
+ setCommandHandler(MI_MaximizePanel, this, &MainWindow::maximizePanel);
+ setCommandHandler(MI_FullScreenWindow, this, &MainWindow::fullScreenWindow);
}
//-----------------------------------------------------------------------------
@@ -1096,34 +1096,19 @@ 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;
- if (!panelMaximized)
- {
- p = mapFromGlobal(QCursor::pos());
- panelMaximized = true;
- }
- else {
- panelMaximized = false;
- }
- QWidget* currWidget = currDockLayout->containerOf(p);
- DockWidget* currW = static_cast<DockWidget*>(currWidget);
- if (currW)
- currW->maximizeDock();
+void MainWindow::maximizePanel() {
+ DockLayout *currDockLayout = getCurrentRoom()->dockLayout();
+ QPoint p = mapFromGlobal(QCursor::pos());
+ QWidget *currWidget = currDockLayout->containerOf(p);
+ DockWidget *currW = dynamic_cast<DockWidget *>(currWidget);
+ if (currW) currW->maximizeDock();
}
-void MainWindow::fullScreenWindow()
-{
- QMainWindow *currWindow = TApp::instance()->getMainWindow();
- if (currWindow->isFullScreen()) {
- currWindow->setWindowState(Qt::WindowMaximized);
- }
- else {
- currWindow->setWindowState(Qt::WindowFullScreen);
- }
-
+void MainWindow::fullScreenWindow() {
+ if (isFullScreen())
+ setWindowState(Qt::WindowMaximized);
+ else
+ setWindowState(Qt::WindowFullScreen);
}
//-----------------------------------------------------------------------------
@@ -1911,7 +1896,9 @@ void MainWindow::defineActions() {
createMenuWindowsAction(MI_ResetRoomLayout, tr("&Reset to Default Rooms"),
"");
createMenuWindowsAction(MI_MaximizePanel, tr("Toggle Maximize Panel"), "`");
- createMenuWindowsAction(MI_FullScreenWindow, tr("Toggle Full Screen"), "Ctrl+`");
+ createMenuWindowsAction(MI_FullScreenWindow,
+ tr("Toggle Main Window's Full Screen Mode"),
+ "Ctrl+`");
createMenuWindowsAction(MI_About, tr("&About OpenToonz..."), "");
createRightClickMenuAction(MI_BlendColors, tr("&Blend colors"), "");
diff --git a/toonz/sources/toonz/mainwindow.h b/toonz/sources/toonz/mainwindow.h
index 051fb5e76..8efc118b8 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;
- bool panelMaximized;
UpdateChecker *m_updateChecker;
TopBar *m_topBar;
@@ -101,7 +100,7 @@ public:
void onLoadSubScene();
void resetRoomsLayout();
void maximizePanel();
- void fullScreenWindow();
+ void fullScreenWindow();
void autofillToggle();
void onUpgradeTabPro();
void onAbout();
diff --git a/toonz/sources/toonzqt/docklayout.h b/toonz/sources/toonzqt/docklayout.h
index c21d0472a..b19472ac2 100644
--- a/toonz/sources/toonzqt/docklayout.h
+++ b/toonz/sources/toonzqt/docklayout.h
@@ -168,8 +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();
+public:
+ void maximizeDock();
protected:
// Private attributes for dragging purposes
diff --git a/toonz/sources/toonzqt/dockwidget.cpp b/toonz/sources/toonzqt/dockwidget.cpp
index 5a56a8d68..44b58cf1b 100644
--- a/toonz/sources/toonzqt/dockwidget.cpp
+++ b/toonz/sources/toonzqt/dockwidget.cpp
@@ -385,11 +385,10 @@ void DockWidget::mouseDoubleClickEvent(QMouseEvent *me) {
//-------------------------------------
-void DockWidget::maximizeDock()
-{
- if (!m_floating) {
- parentLayout()->setMaximized(this, !m_maximized);
- }
+void DockWidget::maximizeDock() {
+ if (!m_floating) {
+ parentLayout()->setMaximized(this, !m_maximized);
+ }
}
//-------------------------------------