mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-29 21:00:06 +00:00
Only restore geometry on first show, not restore from minimize
This commit is contained in:
parent
de43670ec2
commit
3c5c9ea27e
1 changed files with 19 additions and 9 deletions
|
|
@ -463,6 +463,12 @@ void MainWindow::keyReleaseEvent(QKeyEvent* ev)
|
|||
void MainWindow::showEvent(QShowEvent* event)
|
||||
{
|
||||
QMainWindow::showEvent(event);
|
||||
|
||||
static bool firstShowEvent = true;
|
||||
bool restored = false;
|
||||
|
||||
if (firstShowEvent)
|
||||
{
|
||||
auto& uiSettings = settings::UiSettings::Instance();
|
||||
|
||||
// restore the geometry state
|
||||
|
|
@ -473,8 +479,12 @@ void MainWindow::showEvent(QShowEvent* event)
|
|||
// restore the UI state
|
||||
std::string uiState = uiSettings.main_ui_state().GetValue();
|
||||
|
||||
bool restored =
|
||||
restoreState(QByteArray::fromBase64(QByteArray::fromStdString(uiState)));
|
||||
restored = restoreState(
|
||||
QByteArray::fromBase64(QByteArray::fromStdString(uiState)));
|
||||
|
||||
firstShowEvent = false;
|
||||
}
|
||||
|
||||
if (!restored)
|
||||
{
|
||||
resizeDocks({ui->radarToolboxDock}, {194}, Qt::Horizontal);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue