summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics/rbviewport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/graphics/rbviewport.cpp')
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index f7b1bc4ca2..fe17ebbeef 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -39,7 +39,7 @@
39const double RBViewport::scrollRate = 30; 39const double RBViewport::scrollRate = 30;
40 40
41RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info) 41RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info)
42 : QGraphicsItem(info.screen()), foreground(info.screen()->foreground()), 42 : RBMovable(info.screen()), foreground(info.screen()->foreground()),
43 background(info.screen()->background()), textOffset(0,0), 43 background(info.screen()->background()), textOffset(0,0),
44 screen(info.screen()), textAlign(Left), showStatusBar(false), 44 screen(info.screen()), textAlign(Left), showStatusBar(false),
45 statusBarTexture(":/render/statusbar.png"), 45 statusBarTexture(":/render/statusbar.png"),
@@ -178,6 +178,8 @@ void RBViewport::paint(QPainter *painter,
178 178
179 if(showStatusBar) 179 if(showStatusBar)
180 painter->fillRect(QRectF(0, 0, size.width(), 8), statusBarTexture); 180 painter->fillRect(QRectF(0, 0, size.width(), 8), statusBarTexture);
181
182 RBMovable::paint(painter, option, widget);
181} 183}
182 184
183void RBViewport::newLine() 185void RBViewport::newLine()
@@ -297,24 +299,9 @@ void RBViewport::showPlaylist(const RBRenderInfo &info, int start,
297 } 299 }
298} 300}
299 301
300QVariant RBViewport::itemChange(GraphicsItemChange change, 302void RBViewport::saveGeometry()
301 const QVariant &value)
302{ 303{
303 if(change == ItemPositionChange)
304 {
305 QPointF pos = value.toPointF();
306 QRectF bound = parentItem()->boundingRect();
307
308 pos.setX(qMax(0., pos.x()));
309 pos.setX(qMin(pos.x(), bound.width() - boundingRect().width()));
310
311 pos.setY(qMax(0., pos.y()));
312 pos.setY(qMin(pos.y(), bound.height() - boundingRect().height()));
313
314 return pos;
315 }
316 304
317 return QGraphicsItem::itemChange(change, value);
318} 305}
319 306
320void RBViewport::alignLeft() 307void RBViewport::alignLeft()