Commit 8e950332 authored by Jan Hambrecht's avatar Jan Hambrecht

Change canvas mode AlignLeft to AlignTop and set

canvas size to viewport size when canvas mode is 
set to Infinite.


svn path=/trunk/koffice/; revision=648819
parent 82e616d0
......@@ -57,7 +57,7 @@ class FLAKE_EXPORT KoCanvasController : public QAbstractScrollArea {
Q_OBJECT
public:
enum CanvasMode {
AlignLeft, ///< canvas is left aligned if smaller than the viewport
AlignTop, ///< canvas is top aligned if smaller than the viewport
Centered, ///< canvas is centered if smaller than the viewport
Infinite ///< canvas is never smaller than the viewport
};
......
......@@ -299,11 +299,14 @@ void Viewport::resetLayout()
if ( marginBottom > 0 ) resizeH = viewH - marginBottom;
}
if( m_parent->canvasMode() == KoCanvasController::AlignLeft ) {
if( m_parent->canvasMode() == KoCanvasController::AlignTop ) {
resizeH -= moveY;
moveY = 0;
}
m_canvas->setGeometry( moveX, moveY, resizeW, resizeH );
if( m_parent->canvasMode() == KoCanvasController::Infinite )
m_canvas->setGeometry( 0, 0, viewW, viewH );
else
m_canvas->setGeometry( moveX, moveY, resizeW, resizeH );
// kDebug() << "View port geom: " << geometry() << endl;
// kDebug() << "Canvas widget geom: " << m_canvas->geometry() << endl;
......
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