这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions app/src/mainwindow2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,11 +1049,25 @@ void MainWindow2::preferences()

void MainWindow2::resetAndDockAllSubWidgets()
{
QSettings settings(PENCIL2D, PENCIL2D);
settings.remove(SETTING_WINDOW_GEOMETRY);
settings.remove(SETTING_WINDOW_STATE);

for (BaseDockWidget* dock : mDockWidgets)
{
dock->setFloating(false);
dock->raise();
dock->show();
}

addDockWidget(Qt::RightDockWidgetArea, mColorBox);
addDockWidget(Qt::RightDockWidgetArea, mColorInspector);
addDockWidget(Qt::RightDockWidgetArea, mColorPalette);
addDockWidget(Qt::LeftDockWidgetArea, mToolBox);
addDockWidget(Qt::LeftDockWidgetArea, mToolOptions);
addDockWidget(Qt::LeftDockWidgetArea, mDisplayOptionWidget);
addDockWidget(Qt::LeftDockWidgetArea, mOnionSkinWidget);
addDockWidget(Qt::BottomDockWidgetArea, mTimeLine);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if these were refactored into their own private function so the code could be shared with the same code in MainWindow2::createDockWidgets.

}

bool MainWindow2::newObject()
Expand Down Expand Up @@ -1150,17 +1164,14 @@ void MainWindow2::readSettings()
QVariant winState = settings.value(SETTING_WINDOW_STATE);
restoreState(winState.toByteArray());

QString myPath = settings.value(LAST_PCLX_PATH, QVariant(QDir::homePath())).toString();
QString myPath = settings.value(LAST_PCLX_PATH, QDir::homePath()).toString();

int opacity = mEditor->preference()->getInt(SETTING::WINDOW_OPACITY);

setOpacity(100 - opacity);
}

void MainWindow2::writeSettings()
{
qDebug("Save current windows layout.");

QSettings settings(PENCIL2D, PENCIL2D);
settings.setValue(SETTING_WINDOW_GEOMETRY, saveGeometry());
settings.setValue(SETTING_WINDOW_STATE, saveState());
Expand Down
4 changes: 1 addition & 3 deletions app/src/mainwindow2.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ public slots:
void closeEvent(QCloseEvent*) override;
void showEvent(QShowEvent*) override;

private slots:
void resetAndDockAllSubWidgets();

private:
bool newObject();
bool newObjectFromPresets(int presetIndex);
Expand All @@ -136,6 +133,7 @@ private slots:

void readSettings();
void writeSettings();
void resetAndDockAllSubWidgets();

void changePlayState(bool isPlaying);

Expand Down