File indexing completed on 2024-03-24 15:17:03

0001 /*
0002     SPDX-FileCopyrightText: 2021 Wolfgang Reissenberger <sterne-jaeger@openfuture.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #include "summaryfitsview.h"
0008 #include "QGraphicsOpacityEffect"
0009 
0010 
0011 SummaryFITSView::SummaryFITSView(QWidget *parent): FITSView(parent, FITS_NORMAL, FITS_NONE)
0012 {
0013     processInfoWidget = new QWidget(this);
0014     processInfoWidget->setVisible(m_showProcessInfo);
0015     processInfoWidget->setGraphicsEffect(new QGraphicsOpacityEffect(this));
0016 
0017     processInfoWidget->raise();
0018 }
0019 
0020 void SummaryFITSView::createFloatingToolBar()
0021 {
0022     FITSView::createFloatingToolBar();
0023 
0024     floatingToolBar->addSeparator();
0025     toggleProcessInfoAction = floatingToolBar->addAction(QIcon::fromTheme("document-properties"),
0026                                                          i18n("Show Capture Process Information"),
0027                                                          this, SLOT(toggleShowProcessInfo()));
0028     toggleProcessInfoAction->setCheckable(true);
0029 }
0030 
0031 void SummaryFITSView::showProcessInfo(bool show)
0032 {
0033     m_showProcessInfo = show;
0034     processInfoWidget->setVisible(show);
0035     if(toggleProcessInfoAction != nullptr)
0036         toggleProcessInfoAction->setChecked(show);
0037     updateFrame();
0038 }
0039 
0040 void SummaryFITSView::resizeEvent(QResizeEvent *event)
0041 {
0042     FITSView::resizeEvent(event);
0043     // forward the viewport geometry to the overlay
0044     processInfoWidget->setGeometry(this->viewport()->geometry());
0045 }
0046 
0047