From ab96e8167443c7c4ba11ab21342a51193cca2b51 Mon Sep 17 00:00:00 2001 From: contradict Date: Mon, 20 Feb 2017 12:37:20 -0800 Subject: [PATCH] [rqt_image_view] Add a scroll area When selecting a 1-to-1 pixel view, the previous implementation resized the window to the full image size. This is inconvenient for images much larger than the screen resolution. This patch places the RatioLayoutedFrame in a ScrollArea so the window still fits on the screen and the user can pan on the full image. --- .../src/rqt_image_view/image_view.cpp | 3 - .../src/rqt_image_view/image_view.ui | 90 +++++++++---------- 2 files changed, 43 insertions(+), 50 deletions(-) diff --git a/rqt_image_view/src/rqt_image_view/image_view.cpp b/rqt_image_view/src/rqt_image_view/image_view.cpp index 518b6a6b..0319fd4b 100644 --- a/rqt_image_view/src/rqt_image_view/image_view.cpp +++ b/rqt_image_view/src/rqt_image_view/image_view.cpp @@ -293,9 +293,6 @@ void ImageView::onZoom1(bool checked) return; } ui_.image_frame->setInnerFrameFixedSize(ui_.image_frame->getImage().size()); - widget_->resize(ui_.image_frame->size()); - widget_->setMinimumSize(widget_->sizeHint()); - widget_->setMaximumSize(widget_->sizeHint()); } else { ui_.image_frame->setInnerFrameMinimumSize(QSize(80, 60)); ui_.image_frame->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); diff --git a/rqt_image_view/src/rqt_image_view/image_view.ui b/rqt_image_view/src/rqt_image_view/image_view.ui index 1585ba36..185a6273 100644 --- a/rqt_image_view/src/rqt_image_view/image_view.ui +++ b/rqt_image_view/src/rqt_image_view/image_view.ui @@ -149,58 +149,54 @@ 0 - - - - 0 - 0 - - - - - 80 - 60 - - - - QFrame::Box - - - 1 + + + true + + + + 0 + 0 + 767 + 650 + + + + + 0 + 0 + + + + + + + + 0 + 0 + + + + + 80 + 60 + + + + QFrame::Box + + + 1 + + + + + - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 0 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 0 - - - -