mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:00:04 +00:00
Save the general state of the docks (position, size, corner, etc)
This commit is contained in:
parent
3789845a36
commit
bc62236351
4 changed files with 33 additions and 3 deletions
|
|
@ -460,7 +460,25 @@ void MainWindow::showEvent(QShowEvent* event)
|
|||
{
|
||||
QMainWindow::showEvent(event);
|
||||
|
||||
resizeDocks({ui->radarToolboxDock}, {194}, Qt::Horizontal);
|
||||
// restore the UI state
|
||||
std::string uiState =
|
||||
settings::UiSettings::Instance().main_ui_state().GetValue();
|
||||
|
||||
bool restored =
|
||||
restoreState(QByteArray::fromBase64(QByteArray::fromStdString(uiState)));
|
||||
if (!restored)
|
||||
{
|
||||
resizeDocks({ui->radarToolboxDock}, {194}, Qt::Horizontal);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
// save the UI state
|
||||
QByteArray uiState = saveState().toBase64();
|
||||
settings::UiSettings::Instance().main_ui_state().StageValue(uiState.data());
|
||||
|
||||
QMainWindow::closeEvent(event);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionOpenNexrad_triggered()
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ public:
|
|||
void keyPressEvent(QKeyEvent* ev) override final;
|
||||
void keyReleaseEvent(QKeyEvent* ev) override final;
|
||||
void showEvent(QShowEvent* event) override;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
signals:
|
||||
void ActiveMapMoved(double latitude, double longitude);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue