Changeset 1181 for trunk


Ignore:
Timestamp:
Nov 17, 2009, 7:32:39 PM (15 years ago)
Author:
garnier
Message:

fix for tab

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r1164 r1181  
    119119  G4Qt* interactorManager = G4Qt::getInstance ();
    120120
     121  ResizeWindow(fVP.GetWindowSizeHintX(),fVP.GetWindowSizeHintY());
     122   
    121123  // FIXME L.Garnier 9/11/09 Has to be check !!!
    122124  // Qt UI with Qt Vis
     
    127129
    128130  // return false if G4UIQt was not launch
    129   bool res = interactorManager->AddTabVisWidget(fWindow,name);
     131  bool res = interactorManager->AddTabVisWidget(fWindow,name,getWinWidth(),getWinHeight());
    130132
    131133  if (!res) { // we have to do a dialog
     
    169171    fGLWindow->setLayout(mainLayout);
    170172#endif
     173
     174   
     175    //useful for MACOSX, we have to compt the menuBar height
     176    int offset = QApplication::desktop()->height()
     177      - QApplication::desktop()->availableGeometry().height();
     178   
     179    G4int YPos= fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height());
     180    if (fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height())< offset) {
     181      YPos = offset;
     182    }
     183    fGLWindow->resize(getWinWidth(), getWinHeight());
     184#ifdef G4DEBUG_VIS_OGL
     185    printf("G4OpenGLQtViewer::CreateMainWindow :: resizing to %d %d \n",getWinWidth(), getWinHeight());
     186#endif
     187    fGLWindow->move(fVP.GetWindowAbsoluteLocationHintX(QApplication::desktop()->width()),YPos);
     188    fGLWindow->show();
    171189  } else {
    172190    fGLWindow = fWindow;
     
    174192 
    175193 
    176   ResizeWindow(fVP.GetWindowSizeHintX(),fVP.GetWindowSizeHintY());
    177  
    178   //useful for MACOSX, we have to compt the menuBar height
    179   int offset = QApplication::desktop()->height()
    180     - QApplication::desktop()->availableGeometry().height();
    181  
    182   G4int YPos= fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height());
    183   if (fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height())< offset) {
    184     YPos = offset;
    185   }
    186   fGLWindow->resize(getWinWidth(), getWinHeight());
    187   fGLWindow->move(fVP.GetWindowAbsoluteLocationHintX(QApplication::desktop()->width()),YPos);
    188   fGLWindow->show();
    189194 
    190195  if(!fWindow) return;
Note: See TracChangeset for help on using the changeset viewer.