File indexing completed on 2024-07-14 07:17:22

0001 /*  Mosaic Panel Component
0002 
0003     SPDX-FileCopyrightText: 2022 Jasem Mutlaq <mutlaqja@ikarustech.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #include "mosaiccomponent.h"
0009 
0010 #include "Options.h"
0011 #include "skypainter.h"
0012 #include "skymap.h"
0013 #include "mosaictiles.h"
0014 
0015 MosaicComponent::MosaicComponent(SkyComposite *parent) : SkyComponent(parent)
0016 {
0017     m_MosaicTiles.reset(new MosaicTiles());
0018 }
0019 
0020 bool MosaicComponent::selected()
0021 {
0022     return Options::showMosaicPanel();
0023 }
0024 
0025 void MosaicComponent::draw(SkyPainter *skyp)
0026 {
0027     if (selected())
0028         skyp->drawMosaicPanel(m_MosaicTiles.data());
0029 }
0030 
0031 const QSharedPointer<MosaicTiles> MosaicComponent::tiles() const
0032 {
0033     return m_MosaicTiles;
0034 }