Kstars

summaryfitsview.cpp
1 /*
2  SPDX-FileCopyrightText: 2021 Wolfgang Reissenberger <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5  */
6 
7 #include "summaryfitsview.h"
8 #include "QGraphicsOpacityEffect"
9 
10 
11 SummaryFITSView::SummaryFITSView(QWidget *parent): FITSView(parent, FITS_NORMAL, FITS_NONE)
12 {
13  processInfoWidget = new QWidget(this);
14  processInfoWidget->setVisible(m_showProcessInfo);
15  processInfoWidget->setGraphicsEffect(new QGraphicsOpacityEffect(this));
16 
17  processInfoWidget->raise();
18 }
19 
20 void SummaryFITSView::createFloatingToolBar()
21 {
22  FITSView::createFloatingToolBar();
23 
24  floatingToolBar->addSeparator();
25  toggleProcessInfoAction = floatingToolBar->addAction(QIcon::fromTheme("document-properties"),
26  i18n("Show Capture Process Information"),
27  this, SLOT(toggleShowProcessInfo()));
28  toggleProcessInfoAction->setCheckable(true);
29 }
30 
31 void SummaryFITSView::showProcessInfo(bool show)
32 {
33  m_showProcessInfo = show;
34  processInfoWidget->setVisible(show);
35  if(toggleProcessInfoAction != nullptr)
36  toggleProcessInfoAction->setChecked(show);
37  updateFrame();
38 }
39 
40 void SummaryFITSView::resizeEvent(QResizeEvent *event)
41 {
42  FITSView::resizeEvent(event);
43  // forward the viewport geometry to the overlay
44  processInfoWidget->setGeometry(this->viewport()->geometry());
45 }
46 
47 
QIcon fromTheme(const QString &name)
QString i18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 04:00:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.