From d2bd465dbcf3495639705b8f3adf3c551071d52b Mon Sep 17 00:00:00 2001 From: Arthur Glowacki Date: Fri, 28 Jun 2024 11:13:32 -0500 Subject: [PATCH] Auto hide annotations/roi --- src/gstar/AbstractImageWidget.cpp | 9 +++++++-- src/gstar/AbstractImageWidget.h | 3 +++ src/mvc/MapsElementsWidget.cpp | 8 +++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/gstar/AbstractImageWidget.cpp b/src/gstar/AbstractImageWidget.cpp index 465b733..37007bf 100644 --- a/src/gstar/AbstractImageWidget.cpp +++ b/src/gstar/AbstractImageWidget.cpp @@ -409,10 +409,15 @@ QLayout* AbstractImageWidget::generateDefaultLayout(bool add_tab_widget) splitter->setOrientation(Qt::Horizontal); splitter->addWidget(m_imageViewWidget); + splitter->setStretchFactor(0, 1); if (add_tab_widget) { - splitter->setStretchFactor(0, 1); - splitter->addWidget(m_tabWidget); + //_anim_widget = new AnnimateSlideWidget(); + //_anim_widget->setAnimWidget(m_tabWidget, "<"); + splitter->addWidget(m_tabWidget); + splitter->setStretchFactor(1, 1); + //splitter->setCollapsible(0, false); + //splitter->setCollapsible(1, true); } createToolBar(m_imageViewWidget); diff --git a/src/gstar/AbstractImageWidget.h b/src/gstar/AbstractImageWidget.h index 9d5bbf6..769d582 100644 --- a/src/gstar/AbstractImageWidget.h +++ b/src/gstar/AbstractImageWidget.h @@ -27,6 +27,7 @@ #include "gstar/ImageViewToolBar.h" #include "gstar/RangeWidget.h" #include "gstar/RulerUnitsDialog.h" +#include "mvc/AnnimateSlideWidget.h" //--------------------------------------------------------------------------- @@ -414,6 +415,8 @@ protected slots: */ QWidget* m_treeTabWidget; + AnnimateSlideWidget* _anim_widget; + }; } diff --git a/src/mvc/MapsElementsWidget.cpp b/src/mvc/MapsElementsWidget.cpp index 0fcc87c..ccc2b44 100644 --- a/src/mvc/MapsElementsWidget.cpp +++ b/src/mvc/MapsElementsWidget.cpp @@ -120,11 +120,17 @@ void MapsElementsWidget::_createLayout(bool create_image_nav, bool restore_float //hbox2->addWidget(_dataset_name); hbox2->addItem(new QSpacerItem(9999, 40, QSizePolicy::Maximum)); + + _anim_widget = new AnnimateSlideWidget(); + _anim_widget->setAnimWidget(m_tabWidget, "<"); + QSplitter* splitter = new QSplitter(); splitter->setOrientation(Qt::Horizontal); splitter->addWidget(m_imageViewWidget); splitter->setStretchFactor(0, 1); - splitter->addWidget(m_tabWidget); + splitter->addWidget(_anim_widget); + splitter->setCollapsible(0, false); + splitter->setCollapsible(1, true); createToolBar(m_imageViewWidget, create_image_nav);