]> git.sesse.net Git - kdenlive/commitdiff
Improve title widget (zoom + object position)
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 31 Mar 2008 19:46:41 +0000 (19:46 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 31 Mar 2008 19:46:41 +0000 (19:46 +0000)
svn path=/branches/KDE4/; revision=2153

src/graphicsscenerectmove.cpp
src/graphicsscenerectmove.h
src/titlewidget.cpp
src/titlewidget.h
src/widgets/timelinebuttons_ui.ui
src/widgets/titlewidget_ui.ui

index 98c63d7c959bed02a4b438ec3125e4e9796d3c58..d6bd318893dd7601905702e5c1d38d70b99a539e 100644 (file)
@@ -72,21 +72,21 @@ void GraphicsSceneRectMove::mousePressEvent(QGraphicsSceneMouseEvent* e) {
             QGraphicsRectItem *gi = (QGraphicsRectItem*)item;
             QRectF r = gi->rect();
             r.translate(gi->scenePos());
-            if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6) {
+            if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
                 resizeMode = TopLeft;
-            } else if ((r.toRect().bottomLeft() - e->scenePos().toPoint()).manhattanLength() < 6) {
+            } else if ((r.toRect().bottomLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
                 resizeMode = BottomLeft;
-            } else if ((r.toRect().topRight() - e->scenePos().toPoint()).manhattanLength() < 6) {
+            } else if ((r.toRect().topRight() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
                 resizeMode = TopRight;
-            } else if ((r.toRect().bottomRight() - e->scenePos().toPoint()).manhattanLength() < 6) {
+            } else if ((r.toRect().bottomRight() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
                 resizeMode = BottomRight;
-            } else if (qAbs(r.toRect().left() - e->scenePos().toPoint().x()) < 3) {
+            } else if (qAbs(r.toRect().left() - e->scenePos().toPoint().x()) < 3 / zoom) {
                 resizeMode = Left;
-            } else if (qAbs(r.toRect().right() - e->scenePos().toPoint().x()) < 3) {
+            } else if (qAbs(r.toRect().right() - e->scenePos().toPoint().x()) < 3 / zoom) {
                 resizeMode = Right;
-            } else if (qAbs(r.toRect().top() - e->scenePos().toPoint().y()) < 3) {
+            } else if (qAbs(r.toRect().top() - e->scenePos().toPoint().y()) < 3 / zoom) {
                 resizeMode = Up;
-            } else if (qAbs(r.toRect().bottom() - e->scenePos().toPoint().y()) < 3) {
+            } else if (qAbs(r.toRect().bottom() - e->scenePos().toPoint().y()) < 3 / zoom) {
                 resizeMode = Down;
             }
         }
@@ -111,31 +111,36 @@ void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e) {
             QGraphicsRectItem *gi = (QGraphicsRectItem*)m_selectedItem;
             QRectF newrect = gi->rect();
             QPointF newpoint = e->scenePos();
-            newpoint -= m_selectedItem->scenePos();
+            //newpoint -= m_selectedItem->scenePos();
             switch (resizeMode) {
             case TopLeft:
-                newrect.setTopLeft(newpoint);
+                newrect.setBottomRight(newrect.bottomRight() + gi->pos() - newpoint);
+                gi->setPos(newpoint);
                 break;
             case BottomLeft:
-                newrect.setBottomLeft(newpoint);
+                newrect.setBottomRight(QPointF(newrect.bottomRight().x() + gi->pos().x() - newpoint.x(), newpoint.y() - gi->pos().y()));
+                gi->setPos(QPointF(newpoint.x(), gi->pos().y()));
                 break;
             case TopRight:
-                newrect.setTopRight(newpoint);
+                newrect.setBottomRight(QPointF(newpoint.x() - gi->pos().x(), newrect.bottom() + gi->pos().y() - newpoint.y()));
+                gi->setPos(QPointF(gi->pos().x(), newpoint.y()));
                 break;
             case BottomRight:
-                newrect.setBottomRight(newpoint);
+                newrect.setBottomRight(newpoint - gi->pos());
                 break;
             case Left:
-                newrect.setLeft(newpoint.x());
+                newrect.setRight(gi->pos().x() + newrect.width() - newpoint.x());
+                gi->setPos(QPointF(newpoint.x(), gi->pos().y()));
                 break;
             case Right:
-                newrect.setRight(newpoint.x());
+                newrect.setRight(newpoint.x() - gi->pos().x());
                 break;
             case Up:
-                newrect.setTop(newpoint.y());
+                newrect.setBottom(gi->pos().y() + newrect.bottom() - newpoint.y());
+                gi->setPos(QPointF(gi->pos().x(), newpoint.y()));
                 break;
             case Down:
-                newrect.setBottom(newpoint.y());
+                newrect.setBottom(newpoint.y() - gi->pos().y());
                 break;
             default:
                 QPointF diff = e->scenePos() - m_clickPoint;
@@ -159,6 +164,7 @@ void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e) {
             m_clickPoint = e->scenePos();
             m_selectedItem->moveBy(diff.x(), diff.y());
         }
+        emit itemMoved();
     } else {
 
         QPointF p = e->scenePos();
@@ -173,21 +179,21 @@ void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e) {
                 QRectF r = gi->rect();
                 r.translate(gi->scenePos());
 
-                if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6) {
+                if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
                     setCursor(QCursor(Qt::SizeFDiagCursor));
-                } else if ((r.toRect().bottomLeft() - e->scenePos().toPoint()).manhattanLength() < 6) {
+                } else if ((r.toRect().bottomLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
                     setCursor(QCursor(Qt::SizeBDiagCursor));
-                } else if ((r.toRect().topRight() - e->scenePos().toPoint()).manhattanLength() < 6) {
+                } else if ((r.toRect().topRight() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
                     setCursor(QCursor(Qt::SizeBDiagCursor));
-                } else if ((r.toRect().bottomRight() - e->scenePos().toPoint()).manhattanLength() < 6) {
+                } else if ((r.toRect().bottomRight() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
                     setCursor(QCursor(Qt::SizeFDiagCursor));
-                } else if (qAbs(r.toRect().left() - e->scenePos().toPoint().x()) < 3) {
+                } else if (qAbs(r.toRect().left() - e->scenePos().toPoint().x()) < 3 / zoom) {
                     setCursor(Qt::SizeHorCursor);
-                } else if (qAbs(r.toRect().right() - e->scenePos().toPoint().x()) < 3) {
+                } else if (qAbs(r.toRect().right() - e->scenePos().toPoint().x()) < 3 / zoom) {
                     setCursor(Qt::SizeHorCursor);
-                } else if (qAbs(r.toRect().top() - e->scenePos().toPoint().y()) < 3) {
+                } else if (qAbs(r.toRect().top() - e->scenePos().toPoint().y()) < 3 / zoom) {
                     setCursor(Qt::SizeVerCursor);
-                } else if (qAbs(r.toRect().bottom() - e->scenePos().toPoint().y()) < 3) {
+                } else if (qAbs(r.toRect().bottom() - e->scenePos().toPoint().y()) < 3 / zoom) {
                     setCursor(Qt::SizeVerCursor);
                 } else setCursor(QCursor(Qt::ArrowCursor));
             }
@@ -199,27 +205,34 @@ void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e) {
 
 void GraphicsSceneRectMove::wheelEvent(QGraphicsSceneWheelEvent * wheelEvent) {
     QList<QGraphicsView*> viewlist = views();
-    kDebug() << wheelEvent->delta() << " " << zoom;
+    //kDebug() << wheelEvent->delta() << " " << zoom;
     double scale = 1.0;
     if (viewlist.size() > 0) {
-        if (wheelEvent->delta() < 0 && zoom < 20.0) {
-            scale = 1.1;
-
-        } else if (wheelEvent->delta() > 0 && zoom > .05) {
-            scale = 1 / 1.1;
-        }
-        setScale(scale);
-        //viewlist[0]->resetTransform();
-        //viewlist[0]->scale(zoom, zoom);
+        if (wheelEvent->delta() < 0) emit sceneZoom(true);
+        else emit sceneZoom(false);
     }
 }
 
 void GraphicsSceneRectMove::setScale(double s) {
+    if (zoom < 1.0 / 7.0 && s < 1.0) return;
+    else if (zoom > 10.0 / 7.9 && s > 1.0) return;
     QList<QGraphicsView*> viewlist = views();
     if (viewlist.size() > 0) {
         viewlist[0]->scale(s, s);
         zoom = zoom * s;
     }
+    //kDebug()<<"//////////  ZOOM: "<<zoom;
+}
+
+void GraphicsSceneRectMove::setZoom(double s) {
+    QList<QGraphicsView*> viewlist = views();
+    if (viewlist.size() > 0) {
+        viewlist[0]->resetTransform();
+        viewlist[0]->scale(s, s);
+        zoom = s;
+    }
+
+    //kDebug()<<"//////////  ZOOM: "<<zoom;
 }
 
 void GraphicsSceneRectMove::setCursor(QCursor c) {
index a1c7d90e3101dc4707fa462f0347d0b982b19e78..662a746028b7e6b250404072056669d7b385702b 100644 (file)
@@ -6,10 +6,12 @@
 enum resizeModes {NoResize, TopLeft, BottomLeft, TopRight, BottomRight, Left, Right, Up, Down};
 
 class GraphicsSceneRectMove: public QGraphicsScene {
+    Q_OBJECT
 public:
     GraphicsSceneRectMove(QObject* parent = 0);
 
     void setScale(double s);
+    void setZoom(double s);
 
     virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
     virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e);
@@ -23,6 +25,10 @@ private:
     QGraphicsItem* m_selectedItem;
     resizeModes resizeMode;
     QPointF m_clickPoint;
+
+signals:
+    void itemMoved();
+    void sceneZoom(bool);
 };
 
 #endif
index 02c89a2e153259112f9cc0b354e7bf9f95db5787..6e457bd67c3755031ae533de514a7be289ae41bd 100644 (file)
 #include <QGraphicsView>
 #include <QDomDocument>
 #include <KDebug>
+#include <KGlobalSettings>
 #include <QGraphicsItem>
 #include <QGraphicsSvgItem>
 #include <KFileDialog>
 
 #include "titlewidget.h"
-
+#include "kdenlivesettings.h"
 
 int settingUp = false;
 
 TitleWidget::TitleWidget(Render *render, QWidget *parent): QDialog(parent) {
     setupUi(this);
+    frame_properties->setFont(KGlobalSettings::toolBarFont());
+    frame_properties->setEnabled(false);
     connect(newTextButton, SIGNAL(clicked()), this, SLOT(slotNewText()));
     connect(newRectButton, SIGNAL(clicked()), this, SLOT(slotNewRect()));
     connect(kcolorbutton, SIGNAL(clicked()), this, SLOT(slotChangeBackground())) ;
@@ -64,6 +67,15 @@ TitleWidget::TitleWidget(Render *render, QWidget *parent): QDialog(parent) {
     connect(itemzoom, SIGNAL(valueChanged(int)), this, SLOT(itemScaled(int)));
     connect(itemrotate, SIGNAL(valueChanged(int)), this, SLOT(itemRotate(int)));
 
+    connect(value_x, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustSelectedItem()));
+    connect(value_y, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustSelectedItem()));
+    connect(value_w, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustSelectedItem()));
+    connect(value_h, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustSelectedItem()));
+    connect(buttonFitZoom, SIGNAL(clicked()), this, SLOT(slotAdjustZoom()));
+    connect(buttonRealSize, SIGNAL(clicked()), this, SLOT(slotZoomOneToOne()));
+
+    buttonFitZoom->setIcon(KIcon("zoom-fit-best"));
+    buttonRealSize->setIcon(KIcon("zoom-original"));
     m_scene = new GraphicsSceneRectMove(this);
 
     // a gradient background
@@ -75,6 +87,10 @@ TitleWidget::TitleWidget(Render *render, QWidget *parent): QDialog(parent) {
     graphicsView->setScene(m_scene);
     m_titledocument.setScene(m_scene);
     connect(graphicsView->scene(), SIGNAL(selectionChanged()), this , SLOT(selectionChanged()));
+    connect(m_scene, SIGNAL(itemMoved()), this , SLOT(selectionChanged()));
+    connect(m_scene, SIGNAL(sceneZoom(bool)), this , SLOT(slotZoom(bool)));
+    connect(zoom_slider, SIGNAL(valueChanged(int)), this , SLOT(slotUpdateZoom(int)));
+
 
     QPen framepen(Qt::DotLine);
     framepen.setColor(Qt::red);
@@ -90,11 +106,9 @@ TitleWidget::TitleWidget(Render *render, QWidget *parent): QDialog(parent) {
     graphicsView->show();
     graphicsView->setRenderHint(QPainter::Antialiasing);
     graphicsView->setInteractive(true);
-    graphicsView->resize(400, 300);
+    slotAdjustZoom();
+    //graphicsView->resize(400, 300);
     kDebug() << "// TITLE WIDGWT: " << graphicsView->viewport()->width() << "x" << graphicsView->viewport()->height();
-
-    graphicsView->centerOn(m_frameBorder);
-
     toolBox->setItemEnabled(2, false);
     toolBox->setItemEnabled(3, false);
 }
@@ -102,14 +116,7 @@ TitleWidget::TitleWidget(Render *render, QWidget *parent): QDialog(parent) {
 
 //virtual
 void TitleWidget::resizeEvent(QResizeEvent * event) {
-    kDebug() << "// TITLE WIDGET:-- " << graphicsView->width() << "x" << graphicsView->height();
-    kDebug() << "// FRAME WIDGET:-- " << graphicsView->mapFromScene(QPointF(m_frameBorder->rect().width() + 50, 0)).x() << "x" << graphicsView->mapFromScene(QPointF(m_frameBorder->rect().height() + 50, 0)).x();
-    double scalex = graphicsView->width() / (double) graphicsView->mapFromScene(QPointF(m_frameBorder->rect().width() + 50, 0)).x();
-    double scaley = graphicsView->height() / (double)graphicsView->mapFromScene(QPointF(m_frameBorder->rect().height() + 50, 0)).x();
-    kDebug() << "-- SCALES: " << scalex << "x" << scaley;
-    if (scalex < scaley) m_scene->setScale(scalex);
-    else m_scene->setScale(scaley);
-    graphicsView->centerOn(m_frameBorder);
+    //slotAdjustZoom();
 }
 
 void TitleWidget::initViewports() {
@@ -137,10 +144,36 @@ void TitleWidget::initViewports() {
     graphicsView->scene()->addItem(endViewport);
 }
 
-void TitleWidget::slotNewRect() {
+void TitleWidget::slotUpdateZoom(int pos) {
+    m_scene->setZoom((double) pos / 7);
+    zoom_label->setText("x" + QString::number((double) pos / 7, 'g', 2));
+}
 
-    QGraphicsRectItem * ri = graphicsView->scene()->addRect(m_frameWidth / 2, m_frameHeight / 2, 100, 100);
+void TitleWidget::slotZoom(bool up) {
+    int pos = zoom_slider->value();
+    if (up) pos++;
+    else pos--;
+    zoom_slider->setValue(pos);
+}
+
+void TitleWidget::slotAdjustZoom() {
+    double scalex = graphicsView->width() / (double)(m_frameWidth * 1.2);
+    double scaley = graphicsView->height() / (double)(m_frameHeight * 1.2);
+    if (scalex > scaley) scalex = scaley;
+    int zoompos = (int)(scalex * 7 + 0.5);
+    zoom_slider->setValue(zoompos);
+    graphicsView->centerOn(m_frameBorder);
+}
+
+void TitleWidget::slotZoomOneToOne() {
+    zoom_slider->setValue(7);
+    graphicsView->centerOn(m_frameBorder);
+}
+
+void TitleWidget::slotNewRect() {
+    QGraphicsRectItem * ri = graphicsView->scene()->addRect(0, 0, 100, 100);
     ri->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+    ri->setPos(m_frameWidth / 2, m_frameHeight / 2);
     QColor f = rectFColor->color();
     f.setAlpha(rectFAlpha->value());
     QPen penf(f);
@@ -175,6 +208,10 @@ void TitleWidget::selectionChanged() {
     QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
     toolBox->setItemEnabled(2, false);
     toolBox->setItemEnabled(3, false);
+    value_x->blockSignals(true);
+    value_y->blockSignals(true);
+    value_w->blockSignals(true);
+    value_h->blockSignals(true);
     if (l.size() == 1) {
         if ((l[0])->type() == 8) {
             QGraphicsTextItem* i = ((QGraphicsTextItem*)l[0]);
@@ -182,6 +219,13 @@ void TitleWidget::selectionChanged() {
                 ktextedit->setHtml(i->toHtml());
             toolBox->setCurrentIndex(2);
             toolBox->setItemEnabled(2, true);
+            value_x->setValue((int) i->pos().x());
+            value_y->setValue((int) i->pos().y());
+            value_w->setValue((int) i->boundingRect().width());
+            value_h->setValue((int) i->boundingRect().height());
+            frame_properties->setEnabled(true);
+            value_w->setEnabled(false);
+            value_h->setEnabled(false);
         } else
             if ((l[0])->type() == 3) {
                 settingUp = true;
@@ -199,12 +243,40 @@ void TitleWidget::selectionChanged() {
                 rectBColor->setColor(bcol);
                 settingUp = false;
                 rectLineWidth->setValue(rec->pen().width());
+                value_x->setValue((int) rec->pos().x());
+                value_y->setValue((int) rec->pos().y());
+                value_w->setValue((int) rec->rect().width());
+                value_h->setValue((int) rec->rect().height());
+                frame_properties->setEnabled(true);
+                value_w->setEnabled(true);
+                value_h->setEnabled(true);
             } else {
                 //toolBox->setCurrentIndex(0);
+                frame_properties->setEnabled(false);
             }
         zValue->setValue((int)l[0]->zValue());
         itemzoom->setValue((int)transformations[l[0]].scalex*100);
         itemrotate->setValue((int)transformations[l[0]].rotate);
+        value_x->blockSignals(false);
+        value_y->blockSignals(false);
+        value_w->blockSignals(false);
+        value_h->blockSignals(false);
+    }
+}
+
+void TitleWidget::slotAdjustSelectedItem() {
+    QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
+    if (l.size() >= 1) {
+        if (l[0]->type() == 3) {
+            //rect item
+            QGraphicsRectItem *rec = ((QGraphicsRectItem*)l[0]);
+            rec->setPos(value_x->value(), value_y->value());
+            rec->setRect(QRect(0, 0, value_w->value(), value_h->value()));
+        } else if (l[0]->type() == 8) {
+            //text item
+            QGraphicsTextItem *rec = ((QGraphicsTextItem*)l[0]);
+            rec->setPos(value_x->value(), value_y->value());
+        }
     }
 }
 
index 029a811a4f6328ce971683d2857233327be3b345..02e4a463587cb0da889acaefb0377f766ea42cf8 100644 (file)
@@ -71,6 +71,13 @@ public slots:
     void itemRotate(int);
     void saveTitle();
     void loadTitle();
+
+private slots:
+    void slotAdjustSelectedItem();
+    void slotUpdateZoom(int pos);
+    void slotZoom(bool up);
+    void slotAdjustZoom();
+    void slotZoomOneToOne();
 };
 
 
index 324db7b50c8c1efa1ffd6bf13293fe965d81da18..83a42d93fd63c2757eae1efd9d3e6180bfd987ab 100644 (file)
@@ -5,21 +5,22 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>183</width>
-    <height>30</height>
+    <width>248</width>
+    <height>36</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
   <layout class="QGridLayout" name="gridLayout" >
-   <property name="verticalSpacing" >
-    <number>0</number>
-   </property>
-   <property name="margin" >
-    <number>0</number>
-   </property>
    <item row="0" column="0" >
+    <widget class="QToolButton" name="buttonFitZoom" >
+     <property name="text" >
+      <string>V</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1" >
     <widget class="QSlider" name="zoom_slider" >
      <property name="minimumSize" >
       <size>
      </property>
     </widget>
    </item>
-   <item row="0" column="1" >
-    <widget class="QToolButton" name="buttonFitZoom" >
-     <property name="text" >
-      <string>V</string>
-     </property>
-    </widget>
-   </item>
    <item row="0" column="2" >
     <spacer name="horizontalSpacer" >
      <property name="orientation" >
index 14b2ed80ff104ff8620b7e4eb2e36d62d9c97626..5caa8a96f29c5d33050e987a86564ed7e1a1a728 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>738</width>
-    <height>532</height>
+    <width>794</width>
+    <height>598</height>
    </rect>
   </property>
   <property name="sizePolicy" >
@@ -18,8 +18,8 @@
   <property name="windowTitle" >
    <string>Dialog</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout" >
-   <item row="0" column="0" >
+  <layout class="QGridLayout" name="gridLayout_2" >
+   <item row="0" column="0" colspan="6" >
     <layout class="QHBoxLayout" >
      <item>
       <widget class="QPushButton" name="newRectButton" >
        </property>
       </spacer>
      </item>
-     <item>
-      <widget class="QLabel" name="label_12" >
-       <property name="text" >
-        <string>Z-Index:</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QSpinBox" name="zValue" >
-       <property name="minimum" >
-        <number>-1000</number>
-       </property>
-       <property name="maximum" >
-        <number>1000</number>
-       </property>
-      </widget>
-     </item>
     </layout>
    </item>
-   <item row="1" column="0" >
+   <item row="1" column="0" colspan="6" >
+    <widget class="QFrame" name="frame_properties" >
+     <property name="frameShape" >
+      <enum>QFrame::StyledPanel</enum>
+     </property>
+     <property name="frameShadow" >
+      <enum>QFrame::Raised</enum>
+     </property>
+     <layout class="QGridLayout" name="gridLayout" >
+      <item row="0" column="0" >
+       <layout class="QHBoxLayout" name="positionLayout" >
+        <item>
+         <widget class="QLabel" name="label_16" >
+          <property name="text" >
+           <string>X</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="value_x" >
+          <property name="minimum" >
+           <number>-1000</number>
+          </property>
+          <property name="maximum" >
+           <number>5000</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_17" >
+          <property name="text" >
+           <string>Y</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="value_y" >
+          <property name="minimum" >
+           <number>-1000</number>
+          </property>
+          <property name="maximum" >
+           <number>5000</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_18" >
+          <property name="text" >
+           <string>W</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="value_w" >
+          <property name="minimum" >
+           <number>-1000</number>
+          </property>
+          <property name="maximum" >
+           <number>5000</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_19" >
+          <property name="text" >
+           <string>H</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="value_h" >
+          <property name="minimum" >
+           <number>-1000</number>
+          </property>
+          <property name="maximum" >
+           <number>5000</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_12" >
+          <property name="text" >
+           <string>Z-Index:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="zValue" >
+          <property name="minimum" >
+           <number>-1000</number>
+          </property>
+          <property name="maximum" >
+           <number>1000</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer" >
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>241</width>
+            <height>28</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="2" column="0" colspan="6" >
     <widget class="QSplitter" name="splitter" >
      <property name="sizePolicy" >
       <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
      <widget class="QGraphicsView" name="graphicsView" />
      <widget class="QToolBox" name="toolBox" >
       <property name="currentIndex" >
-       <number>2</number>
+       <number>3</number>
       </property>
       <widget class="QWidget" name="BasicOperations" >
        <property name="geometry" >
         <rect>
          <x>0</x>
          <y>0</y>
-         <width>407</width>
-         <height>250</height>
+         <width>287</width>
+         <height>265</height>
         </rect>
        </property>
        <attribute name="label" >
         <rect>
          <x>0</x>
          <y>0</y>
-         <width>407</width>
-         <height>250</height>
+         <width>287</width>
+         <height>265</height>
         </rect>
        </property>
        <attribute name="label" >
         <rect>
          <x>0</x>
          <y>0</y>
-         <width>407</width>
-         <height>250</height>
+         <width>358</width>
+         <height>246</height>
         </rect>
        </property>
        <attribute name="label" >
         <rect>
          <x>0</x>
          <y>0</y>
-         <width>407</width>
-         <height>250</height>
+         <width>287</width>
+         <height>265</height>
         </rect>
        </property>
        <attribute name="label" >
         <string>Rectangle</string>
        </attribute>
-       <layout class="QGridLayout" >
+       <layout class="QGridLayout" name="gridLayout_3" >
         <item row="0" column="0" >
          <layout class="QVBoxLayout" >
           <item>
         <rect>
          <x>0</x>
          <y>0</y>
-         <width>407</width>
-         <height>250</height>
+         <width>287</width>
+         <height>265</height>
         </rect>
        </property>
        <attribute name="label" >
         <rect>
          <x>0</x>
          <y>0</y>
-         <width>407</width>
-         <height>250</height>
+         <width>287</width>
+         <height>265</height>
         </rect>
        </property>
        <attribute name="label" >
      </widget>
     </widget>
    </item>
-   <item row="2" column="0" >
+   <item row="3" column="0" >
+    <widget class="QToolButton" name="buttonFitZoom" >
+     <property name="text" >
+      <string>V</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1" >
+    <widget class="QToolButton" name="buttonRealSize" >
+     <property name="text" >
+      <string>V</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2" >
+    <widget class="QSlider" name="zoom_slider" >
+     <property name="minimumSize" >
+      <size>
+       <width>100</width>
+       <height>0</height>
+      </size>
+     </property>
+     <property name="maximumSize" >
+      <size>
+       <width>150</width>
+       <height>16777215</height>
+      </size>
+     </property>
+     <property name="minimum" >
+      <number>1</number>
+     </property>
+     <property name="maximum" >
+      <number>10</number>
+     </property>
+     <property name="pageStep" >
+      <number>2</number>
+     </property>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3" >
+    <widget class="QLabel" name="zoom_label" >
+     <property name="text" >
+      <string>x1</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="4" >
+    <spacer name="horizontalSpacer_2" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0" >
+      <size>
+       <width>387</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="3" column="5" >
     <widget class="QDialogButtonBox" name="buttonBox" >
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>