Commit a65a3063 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE #239] the screen recorder setup dialog is now also available via the views title bar.

parent afd0294d
......@@ -244,10 +244,7 @@ void WMainWindow::setupGUI()
WQtGLDockWidget* mainGLDock = new WQtGLDockWidget( "Main View", "3D View", m_glDock );
mainGLDock->getGLWidget()->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
m_mainGLWidget = mainGLDock->getGLWidget();
// m_mainGLWidgetScreenCapture = mainGLDock->getScreenCapture();
m_glDock->addDockWidget( Qt::RightDockWidgetArea, mainGLDock );
// addDockWidget( Qt::RightDockWidgetArea, m_mainGLWidgetScreenCapture );
// tabifyDockWidget( m_controlPanel->getRoiDock(), m_mainGLWidgetScreenCapture );
connect( m_mainGLWidget.get(), SIGNAL( renderedFirstFrame() ), this, SLOT( handleGLVendor() ) );
addDockWidget( Qt::RightDockWidgetArea, m_controlPanel );
......@@ -415,8 +412,6 @@ void WMainWindow::setupGUI()
m_permanentToolBar->addAction( m_loadButton );
m_permanentToolBar->addAction( m_saveAction );
m_permanentToolBar->addSeparator();
// m_permanentToolBar->addAction( m_mainGLWidgetScreenCapture->getScreenshotTrigger() );
m_permanentToolBar->addSeparator();
m_permanentToolBar->addAction( roiButton );
m_permanentToolBar->addSeparator();
m_permanentToolBar->addAction( showAxial );
......@@ -1290,7 +1285,6 @@ void WMainWindow::addGlobalMenu( QWidget* widget )
widget->addAction( m_saveAction );
widget->addAction( createSeperator( this ) );
widget->addAction( m_viewAction );
widget->addAction( m_cameraAction );
widget->addAction( m_settingsAction );
widget->addAction( createSeperator( this ) );
widget->addAction( m_helpAction );
......
......@@ -391,9 +391,6 @@ private:
QAction* m_viewAction; //!< the view controls
QMenu* m_viewMenu; //!< view and camera control menu
QAction* m_cameraAction; //!< the camera controls
QMenu* m_cameraMenu; //!< the camera menu
QAction* m_settingsAction; //!< the settings
QMenu* m_settingsMenu; //!< the settings
......
......@@ -23,6 +23,7 @@
//---------------------------------------------------------------------------
#include <QtGui/QAction>
#include <QtGui/QWidgetAction>
#include <QtGui/QDockWidget>
#include <QtGui/QVBoxLayout>
#include <QtGui/QHBoxLayout>
......@@ -70,7 +71,7 @@ WQtGLDockWidget::WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget*
// all view docks have a screen capture object
m_screenCapture = new WQtGLScreenCapture( this );
// hide the screen capture object by default
m_screenCapture->setHidden( true );
//m_screenCapture->setHidden( true );
// set custom title
setTitleBarWidget( new WQtGLDockWidgetTitle( this, dockTitle ) );
......@@ -113,24 +114,34 @@ void setupButton( QToolButton* btn )
{
btn->setToolButtonStyle( Qt::ToolButtonIconOnly );
btn->setContentsMargins( 0, 0, 0, 0 );
btn->setFixedWidth( 24 );
//btn->setFixedWidth( 24 );
btn->setFixedHeight( 24 );
btn->setAutoRaise( true );
}
WQtGLDockWidgetTitle::WQtGLDockWidgetTitle( WQtGLDockWidget* parent, const QString& dockTitle ):
QWidget( parent )
{
QFrame* line = new QFrame();
line->setFrameShape( QFrame::VLine );
line->setFrameShadow( QFrame::Sunken );
// screen capture trigger
QToolButton* screenShotBtn = new QToolButton( this );
screenShotBtn->setDefaultAction( parent->getScreenCapture()->getScreenshotTrigger() );
setupButton( screenShotBtn );
QMenu* m = new QMenu();
QWidgetAction* a = new QWidgetAction( this );
a->setDefaultWidget( parent->getScreenCapture() );
m->addAction( a );
screenShotBtn->setMenu( m );
screenShotBtn->setPopupMode( QToolButton::MenuButtonPopup );
// camera presets
QAction* camPresets = new QAction( WQt4Gui::getIconManager()->getIcon( "view" ), "Camera Presets", this );
camPresets->setMenu( parent->getGLWidget()->getCameraPresetsAndResetMenu() );
QToolButton* presetBtn = new QToolButton( this );
presetBtn->setDefaultAction( camPresets );
presetBtn->setPopupMode( QToolButton::InstantPopup );
presetBtn->setDefaultAction( parent->getGLWidget()->getCameraResetAction() );
presetBtn->setMenu( parent->getGLWidget()->getCameraPresetsMenu() );
presetBtn->setPopupMode( QToolButton::MenuButtonPopup );
setupButton( presetBtn );
QToolButton* settingsBtn = new QToolButton( this );
......@@ -166,19 +177,11 @@ WQtGLDockWidgetTitle::WQtGLDockWidgetTitle( WQtGLDockWidget* parent, const QStri
layout->addStretch( 100000 );
layout->addWidget( screenShotBtn );
layout->addWidget( presetBtn );
layout->addWidget( line );
layout->addWidget( settingsBtn );
layout->addWidget( closeBtn );
setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );
setStyleSheet(
"QToolButton{"
"border-style: none;"
"}"
"QPushButton{"
"border-style: none;"
"}"
);
}
WQtGLScreenCapture* WQtGLDockWidget::getScreenCapture()
......@@ -203,3 +206,9 @@ const QString& WQtGLDockWidget::getDockTitle() const
{
return m_dockTitle;
}
void WQtGLDockWidget::openScreenCaptureConfig()
{
m_screenCapture->setWindowFlags( Qt::Tool );
m_screenCapture->show();
}
......@@ -92,6 +92,11 @@ public:
*/
const QString& getDockTitle() const;
public slots:
/**
* Open screen capture config options
*/
void openScreenCaptureConfig();
protected:
/**
......
......@@ -43,18 +43,19 @@
#include "WQtGLScreenCapture.moc"
WQtGLScreenCapture::WQtGLScreenCapture( WQtGLDockWidget* parent ):
QDockWidget( "Recorder", parent ),
QWidget( parent ),
m_glDockWidget( parent ),
m_viewer( m_glDockWidget->getGLWidget()->getViewer() )
{
// initialize
setObjectName( "Recorder Dock" );
setAllowedAreas( Qt::AllDockWidgetAreas );
setFeatures( QDockWidget::AllDockWidgetFeatures );
setObjectName( "Recorder Dock - " + parent->getDockTitle() );
setWindowTitle( "Recorder - " + parent->getDockTitle() );
// create our toolbox and add it to the main layout
m_toolbox = new QToolBox( this );
setWidget( m_toolbox );
QHBoxLayout* layout = new QHBoxLayout( this );
layout->addWidget( m_toolbox );
connect( m_toolbox, SIGNAL( currentChanged( int ) ), this, SLOT( toolBoxChanged( int ) ) );
/////////////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -331,7 +332,7 @@ bool WQtGLScreenCapture::event( QEvent* event )
}
}
return QDockWidget::event( event );
return QWidget::event( event );
}
void WQtGLScreenCapture::screenShot()
......
......@@ -29,7 +29,7 @@
#include <boost/signals2.hpp>
#include <QtGui/QDockWidget>
#include <QtGui/QWidget>
#include <QtGui/QToolBox>
#include <QtGui/QPushButton>
#include <QtGui/QLabel>
......@@ -49,7 +49,7 @@ class WQtGLDockWidget;
/**
* This class is a screen recorder adapter in QT. It uses WGEScreenCapture and provides a nice widget around it.
*/
class WQtGLScreenCapture: public QDockWidget
class WQtGLScreenCapture: public QWidget
{
Q_OBJECT
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment