diff --git a/src/gui/UBLibPathViewer.cpp b/src/gui/UBLibPathViewer.cpp index 8436a028..341f673c 100644 --- a/src/gui/UBLibPathViewer.cpp +++ b/src/gui/UBLibPathViewer.cpp @@ -22,9 +22,6 @@ UBLibPathViewer::UBLibPathViewer(QWidget *parent, const char *name):QGraphicsVie setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setAcceptDrops(true); setStyleSheet(QString("QGraphicsView{background:#EEEEEE; border-radius:10px; border:2px solid #999999;}")); - // setStyleSheet(QString("QScrollArea{background-color: #EEEEEE;}QScrollBar::horizontal{border-radius:2px;background-color:transparent;height:15px;}QScrollBar::add-line::horizontal{background-color:transparent;border-radius:5px;}QScrollBar::sub-line::horizontal{background-color:transparent;border-radius:5px;}QScrollBar::left-arrow::horizontal{background-color:white;width:3px;height:3px;}")); - // For later --> QScrollBar::horizontal{border-radius:2px; background-color:#DDDDDD; height:10px;} QScrollBar::handle::horizontal{color:#BBBBBB;} -// mpScene = new QGraphicsScene(this); mpScene = new UBPathScene(this); setScene(mpScene); @@ -175,15 +172,21 @@ void UBLibPathViewer::addItem(UBChainedLibElement *elem) */ void UBLibPathViewer::resizeEvent(QResizeEvent *event) { - if(NULL != mpContainer) - { - mpContainer->setMinimumWidth(width() - 20); - } + qDebug() << "old" << event->oldSize(); + qDebug() << "new" << event->size(); + + if(event->oldSize() == event->size()) + event->ignore(); + else{ + if(NULL != mpContainer){ + mpContainer->setMinimumWidth(width() - 20); + } - viewport()->resize(width() - 10, viewport()->height()); + viewport()->resize(width() - 10, viewport()->height()); - updateScrolls(); - event->accept(); + updateScrolls(); + event->accept(); + } } void UBLibPathViewer::showEvent(QShowEvent *event) diff --git a/src/gui/UBLibPathViewer.h b/src/gui/UBLibPathViewer.h index 2dd23203..87ba855f 100644 --- a/src/gui/UBLibPathViewer.h +++ b/src/gui/UBLibPathViewer.h @@ -71,10 +71,7 @@ signals: protected: void resizeEvent(QResizeEvent *event); -// void mousePressEvent(QMouseEvent *event); -// void mouseReleaseEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); -// void paintEvent(QPaintEvent *event); void showEvent(QShowEvent *event); private slots: