diff --git a/MainWindow.h b/MainWindow.h index f0f4640..449bd88 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -284,6 +284,8 @@ public: static const int PROPERTY_PANEL_MINIMUM_WIDTH = 400; static const int CANVAS_MINIMUM_WIDTH = 480; static const int CANVAS_MINIMUM_HEIGHT = 270; + static const int OUTPUT_WINDOW_MINIMUM_WIDTH = 480; + static const int OUTPUT_WINDOW_MINIMUM_HEIGHT = 270; }; #endif /* MAIN_WINDOW_H_ */ diff --git a/MapperGLCanvas.cpp b/MapperGLCanvas.cpp index bfa3a08..8934bf6 100644 --- a/MapperGLCanvas.cpp +++ b/MapperGLCanvas.cpp @@ -36,16 +36,17 @@ void MapperGLCanvas::initializeGL() //glEnable(GL_CULL_FACE); } -void MapperGLCanvas::resizeGL(int /* width */, int /* height */) +void MapperGLCanvas::resizeGL(int width, int height) { - glViewport(0, 0, width(), height()); + qDebug() << "Resize to " << width << "x" << height << endl; + glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode (GL_PROJECTION); glLoadIdentity (); glOrtho ( - 0.0f, (GLfloat) width(), // left, right - (GLfloat) height(), 0.0f, // bottom, top + 0.0f, (GLfloat) width, // left, right + (GLfloat) height, 0.0f, // bottom, top -1.0, 1.0f); glMatrixMode (GL_MODELVIEW); diff --git a/OutputGLWindow.cpp b/OutputGLWindow.cpp index 4cd04de..71975ab 100644 --- a/OutputGLWindow.cpp +++ b/OutputGLWindow.cpp @@ -23,10 +23,16 @@ OutputGLWindow::OutputGLWindow(QWidget* parent, const QGLWidget * shareWidget) : QDialog(parent) { + resize(MainWindow::OUTPUT_WINDOW_MINIMUM_WIDTH, MainWindow::OUTPUT_WINDOW_MINIMUM_HEIGHT); canvas = new DestinationGLCanvas(this, shareWidget); canvas->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + canvas->setMinimumSize(MainWindow::OUTPUT_WINDOW_MINIMUM_WIDTH, MainWindow::OUTPUT_WINDOW_MINIMUM_HEIGHT); + QLayout* layout = new QVBoxLayout; + layout->setContentsMargins(0,0,0,0); // remove margin + layout->addWidget(canvas); + setLayout(layout); } //void OutputGLWindow::updateCanvas() {