Kstars

summaryfitsview.cpp
1/*
2 SPDX-FileCopyrightText: 2021 Wolfgang Reissenberger <sterne-jaeger@openfuture.de>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include "summaryfitsview.h"
8#include "QGraphicsOpacityEffect"
9
10
11SummaryFITSView::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
20void 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
31void 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
40void 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
QString i18n(const char *text, const TYPE &arg...)
QWidget * viewport() const const
void setCheckable(bool)
void setChecked(bool)
QIcon fromTheme(const QString &name)
QAction * addSeparator()
QAction * addAction(const QIcon &icon, const QString &text)
void setGeometry(const QRect &)
void show()
virtual void setVisible(bool visible)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:57:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.