From c0fff9bd50b3cbd194b5b8850384195a74bd58b9 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 24 Dec 2008 11:03:32 +0000 Subject: [PATCH] Now after "Update Study" NoteBook dialog box keep its position. --- src/SalomeApp/SalomeApp_Application.cxx | 3 +++ src/SalomeApp/SalomeApp_NoteBookDlg.cxx | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 574f271b4..4a6d7d433 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -727,6 +727,9 @@ void SalomeApp_Application::onNoteBook() } else if(!myNoteBook->isVisible()){ myNoteBook->Init(aStudy); + myNoteBook->adjustSize(); + myNoteBook->move((int)(desktop()->x() + desktop()->width()/2 - myNoteBook->frameGeometry().width()/2), + (int)(desktop()->y() + desktop()->height()/2 - myNoteBook->frameGeometry().height()/2)); } myNoteBook->show(); } diff --git a/src/SalomeApp/SalomeApp_NoteBookDlg.cxx b/src/SalomeApp/SalomeApp_NoteBookDlg.cxx index a5c148be8..6005d889a 100644 --- a/src/SalomeApp/SalomeApp_NoteBookDlg.cxx +++ b/src/SalomeApp/SalomeApp_NoteBookDlg.cxx @@ -1044,6 +1044,11 @@ void SalomeApp_NoteBookDlg::clearStudy() QList aList = SUIT_Session::session()->applications(); int anIndex = aList.indexOf( app ); + //Store position and size of the this dialog + int aW = width(); + int aH = height(); + int aX = x(); + int aY = y(); // Disconnect dialog from application desktop in case if: // 1) Application is not the first application in the session @@ -1070,5 +1075,8 @@ void SalomeApp_NoteBookDlg::clearStudy() setParent( app->desktop(), Qt::Dialog ); app->setNoteBook(this); } + //Set position and size of the this dialog + resize( aW, aH ); + move( aX, aY ); show(); } -- 2.39.2