From: vsv Date: Mon, 21 Apr 2014 07:23:42 +0000 (+0400) Subject: Adaptation of toolbar size corrected (issue #32) X-Git-Tag: V_0.2~145 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=64cb828489d907970f667ec18d1e149ea335f9c6;p=modules%2Fshaper.git Adaptation of toolbar size corrected (issue #32) --- diff --git a/src/XGUI/XGUI_ViewPort.cpp b/src/XGUI/XGUI_ViewPort.cpp index d0cfa2d55..c71796465 100644 --- a/src/XGUI/XGUI_ViewPort.cpp +++ b/src/XGUI/XGUI_ViewPort.cpp @@ -178,6 +178,8 @@ OpenGLUtils_FrameBuffer::~OpenGLUtils_FrameBuffer() bool OpenGLUtils_FrameBuffer::init(const GLsizei& xSize, const GLsizei& ySize) { char* ext = (char*) glGetString(GL_EXTENSIONS); + if (!ext) + return false; if (!IsEXTInitialized || strstr(ext, "GL_EXT_framebuffer_object") == NULL) { //qDebug( "Initializing OpenGL FrameBuffer extension failed"); return false; diff --git a/src/XGUI/XGUI_ViewWindow.cpp b/src/XGUI/XGUI_ViewWindow.cpp index b8b90d696..5e56d61db 100644 --- a/src/XGUI/XGUI_ViewWindow.cpp +++ b/src/XGUI/XGUI_ViewWindow.cpp @@ -259,7 +259,6 @@ XGUI_ViewWindow::XGUI_ViewWindow(XGUI_Viewer* theViewer, V3d_TypeOfView theType) myWindowBar = new ViewerToolbar(this, myViewPort); myWindowBar->setCursor(Qt::PointingHandCursor); aToolLay->addWidget(myWindowBar); - myWindowBar->setFixedWidth(100); myMinimizeBtn = new QAction(myWindowBar); myMinimizeBtn->setIcon(MinimizeIco); @@ -289,6 +288,14 @@ XGUI_ViewWindow::~XGUI_ViewWindow() { } + +//**************************************************************** +void XGUI_ViewWindow::showEvent(QShowEvent* theEvent) +{ + QFrame::showEvent(theEvent); + myWindowBar->setFixedSize(myWindowBar->sizeHint()); +} + //**************************************************************** void XGUI_ViewWindow::changeEvent(QEvent* theEvent) { diff --git a/src/XGUI/XGUI_ViewWindow.h b/src/XGUI/XGUI_ViewWindow.h index 0af119b37..e528138a3 100644 --- a/src/XGUI/XGUI_ViewWindow.h +++ b/src/XGUI/XGUI_ViewWindow.h @@ -190,6 +190,8 @@ protected: virtual bool eventFilter(QObject *theObj, QEvent *theEvent); + virtual void showEvent(QShowEvent* theEvent); + private slots: void onClose(); void onMinimize(); @@ -302,7 +304,7 @@ public: { setBackgroundRole(QPalette::NoRole); setAttribute(Qt::WA_NoSystemBackground); - setAttribute(Qt::WA_PaintOnScreen); + //setAttribute(Qt::WA_PaintOnScreen); setAutoFillBackground(false); } @@ -328,7 +330,7 @@ public: { setBackgroundRole(QPalette::NoRole); setAttribute(Qt::WA_NoSystemBackground); - setAttribute(Qt::WA_PaintOnScreen); + //setAttribute(Qt::WA_PaintOnScreen); setAutoFillBackground(false); } diff --git a/src/XGUI/XGUI_Viewer.cpp b/src/XGUI/XGUI_Viewer.cpp index 30ac2e1d3..917b3d552 100644 --- a/src/XGUI/XGUI_Viewer.cpp +++ b/src/XGUI/XGUI_Viewer.cpp @@ -415,10 +415,8 @@ void XGUI_Viewer::addView(QMdiSubWindow* theView) /*! Emit activated for view \a view. */ -static int AA = 0; void XGUI_Viewer::onWindowActivated(QMdiSubWindow* view) { - qDebug("### windowActivated %i\n", AA++); if (view && (view != myActiveView)) { myActiveView = view; ((XGUI_ViewWindow*)myActiveView->widget())->windowActivated();