mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-20 10:17:16 +01:00
bugfix 2423
This commit is contained in:
parent
6840a50785
commit
092a380388
@ -153,7 +153,8 @@ using namespace Ui;
|
||||
void ProjectPanel::initMain(FWWindow *main)
|
||||
{
|
||||
mainW = main;
|
||||
|
||||
firstResize = false ;
|
||||
oldState=-1;
|
||||
if (st->getInfoStyle()!=0) m_panel->oi->show();
|
||||
else m_panel->oi->hide();
|
||||
|
||||
@ -3229,21 +3230,6 @@ void ProjectPanel::showEvent( QShowEvent *ev)
|
||||
if (w1 || w2)
|
||||
m_panel->objInfoSplitter->setSizes( sl );
|
||||
}
|
||||
/* if (rcs!=NULL&&firstResize==false)
|
||||
{
|
||||
// QMdiArea * par = (QMdiArea *)mdiWindow->getParent();
|
||||
QString FileName = rcs->getFileName();
|
||||
int x = st->getInt("Window/"+FileName+"/x");
|
||||
int y = st->getInt("Window/"+FileName+"/y");
|
||||
int width = st->getInt("Window/"+FileName+"/width");
|
||||
int height = st->getInt("Window/"+FileName+"/height");
|
||||
firstResize=true ;
|
||||
mdiWindow->showMinimized();
|
||||
mdiWindow->move(x,y);
|
||||
mdiWindow->showMaximized();
|
||||
// par->addSubWindow(mdiWindow);
|
||||
//this->;
|
||||
}*/
|
||||
|
||||
|
||||
QWidget::showEvent(ev);
|
||||
@ -3269,14 +3255,14 @@ void ProjectPanel::hideEvent( QHideEvent *ev)
|
||||
|
||||
void ProjectPanel::closeEvent( QCloseEvent * ev)
|
||||
{
|
||||
/* if (rcs!=NULL)
|
||||
if (rcs!=NULL)
|
||||
{
|
||||
QString FileName = rcs->getFileName();
|
||||
st->setInt("Window/"+FileName+"/x",mdiWindow->x());
|
||||
st->setInt("Window/"+FileName+"/y",mdiWindow->y());
|
||||
st->setInt("Window/"+FileName+"/width",mdiWindow->width ());
|
||||
st->setInt("Window/"+FileName+"/height",mdiWindow->height ());
|
||||
}*/
|
||||
}
|
||||
if (saveIfModified() && checkin(true))
|
||||
{
|
||||
if (rcs)
|
||||
@ -3292,3 +3278,55 @@ void ProjectPanel::closeEvent( QCloseEvent * ev)
|
||||
QWidget::closeEvent(ev);
|
||||
// emit closed();
|
||||
}
|
||||
|
||||
|
||||
void ProjectPanel::resizeEvent ( QResizeEvent * event )
|
||||
{
|
||||
if (oldState==-1)
|
||||
{
|
||||
if (isMaximized ())
|
||||
oldState=0;
|
||||
return ;
|
||||
}
|
||||
if (!firstResize&&rcs!=NULL)
|
||||
{
|
||||
// if (!isMaximized ())
|
||||
// {
|
||||
QString FileName = rcs->getFileName();
|
||||
if (FileName!="")
|
||||
{
|
||||
if (!mdiWindow->isMaximized ())
|
||||
{
|
||||
int x = st->getInt("Window/"+FileName+"/x");
|
||||
int y = st->getInt("Window/"+FileName+"/y");
|
||||
int width = st->getInt("Window/"+FileName+"/width");
|
||||
int height = st->getInt("Window/"+FileName+"/height");
|
||||
if (width==0||height==0)
|
||||
{
|
||||
x = 10;
|
||||
y = 10;
|
||||
width = 600;
|
||||
height= 600;
|
||||
}
|
||||
firstResize=true ;
|
||||
mdiWindow->setGeometry (x,y,width,height);
|
||||
}
|
||||
}
|
||||
|
||||
if (FileName=="")
|
||||
{
|
||||
if (!mdiWindow->isMaximized ())
|
||||
{
|
||||
int y = st->getInt("Window/"+FileName+"/y");
|
||||
int y2 = st->getInt("Window/"+FileName+"/y");
|
||||
firstResize=true ;
|
||||
//mdiWindow->resize (600,400);
|
||||
//mdiWindow->resize (600,400);
|
||||
mdiWindow->setGeometry (10,10,600,600);
|
||||
//mdiWindow->resize (600,800);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -381,10 +381,11 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
int oldState ;
|
||||
virtual void showEvent( QShowEvent *ev);
|
||||
virtual void hideEvent( QHideEvent *ev);
|
||||
virtual void closeEvent( QCloseEvent * );
|
||||
virtual void resizeEvent ( QResizeEvent * event );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user