add type() to layouts

pull/5/head
Michail Vourlakos 6 years ago
parent 9e9990e2df
commit e417a8d4ba

@ -254,6 +254,11 @@ void AbstractLayout::setLaunchers(QStringList launcherList)
emit launchersChanged();
}
Type AbstractLayout::type() const
{
return Type::Abstract;
}
QList<Plasma::Types::Location> combinedFreeEdges(const QList<Plasma::Types::Location> &edges1, const QList<Plasma::Types::Location> &edges2)
{
QList<Plasma::Types::Location> validFreeEdges;

@ -33,6 +33,21 @@ namespace Plasma {
class Types;
}
namespace Latte {
namespace Layout {
Q_NAMESPACE
enum Type {
Abstract = 0,
Generic,
Active,
Shared
};
Q_ENUM_NS(Type);
}
}
namespace Latte {
namespace Layout {
@ -80,6 +95,8 @@ public:
QStringList launchers() const;
void setLaunchers(QStringList launcherList);
virtual Type type() const;
// STATIC
static QString layoutName(const QString &fileName);
static QList<Plasma::Types::Location> combinedFreeEdges(const QList<Plasma::Types::Location> &edges1,

@ -170,6 +170,11 @@ void ActiveLayout::setShowInMenu(bool show)
emit showInMenuChanged();
}
Layout::Type ActiveLayout::type() const
{
return Layout::Type::Active;
}
QStringList ActiveLayout::activities() const
{
return m_activities;

@ -75,6 +75,8 @@ public:
int viewsCount(QScreen *screen) const override;
int viewsCount() const override;
Layout::Type type() const override;
//! Available edges for specific view in that screen
QList<Plasma::Types::Location> availableEdgesForView(QScreen *scr, Latte::View *forView) const override;
//! All free edges in that screen

@ -55,6 +55,11 @@ GenericLayout::~GenericLayout()
{
}
Type GenericLayout::type() const
{
return Type::Generic;
}
void GenericLayout::unloadContainments()
{
if (!m_corona) {

@ -62,7 +62,7 @@ class GenericLayout : public AbstractLayout
Q_OBJECT
Q_PROPERTY(int viewsCount READ viewsCount NOTIFY viewsCountChanged)
public:
public:
GenericLayout(QObject *parent, QString layoutFile, QString assignedName = QString());
~GenericLayout() override;
@ -79,6 +79,8 @@ public:
virtual int viewsCount(QScreen *screen) const;
virtual int viewsCount() const;
Type type() const override;
Latte::Corona *corona();
QStringList unloadedContainmentsIds();

@ -55,6 +55,12 @@ bool SharedLayout::isCurrent() const
return false;
}
Layout::Type SharedLayout::type() const
{
return Layout::Type::Shared;
}
const QStringList SharedLayout::appliedActivities()
{
if (!m_corona) {

@ -56,6 +56,8 @@ public:
int viewsCount(QScreen *screen) const override;
int viewsCount() const override;
Layout::Type type() const override;
//! Available edges for specific view in that screen
QList<Plasma::Types::Location> availableEdgesForView(QScreen *scr, Latte::View *forView) const override;
//! All free edges in that screen

Loading…
Cancel
Save