mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Currently modules are initialized as QQuickItems. In order to be able to add custom properties for modules to set in the future, introduce InitialStartModule as the top-level QML object for modules to initialize. Currently only two properties are implemented: `available` for whether to show the module in the wizard, and `contentItem` for the visual module item.
42 lines
863 B
C++
42 lines
863 B
C++
// SPDX-FileCopyrightText: 2024 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
#include "initialstartmodule.h"
|
|
|
|
InitialStartModule::InitialStartModule(QObject *parent)
|
|
: QObject{parent}
|
|
{
|
|
}
|
|
|
|
bool InitialStartModule::available() const
|
|
{
|
|
return m_available;
|
|
}
|
|
|
|
void InitialStartModule::setAvailable(bool available)
|
|
{
|
|
if (m_available == available) {
|
|
return;
|
|
}
|
|
m_available = available;
|
|
Q_EMIT availableChanged();
|
|
}
|
|
|
|
QQuickItem *InitialStartModule::contentItem()
|
|
{
|
|
return m_contentItem;
|
|
}
|
|
|
|
void InitialStartModule::setContentItem(QQuickItem *contentItem)
|
|
{
|
|
if (m_contentItem == contentItem) {
|
|
return;
|
|
}
|
|
m_contentItem = contentItem;
|
|
Q_EMIT contentItemChanged();
|
|
}
|
|
|
|
QQmlListProperty<QObject> InitialStartModule::children()
|
|
{
|
|
return QQmlListProperty<QObject>(this, &m_children);
|
|
}
|