Introduces a new `core/applications` QML/C++ module (`Nebula.Applications`) to discover `.desktop` entries, expose filterable application models, and launch installed apps safely from the shell. The desktop launcher now uses real installed apps with themed icon loading and fallback glyphs, adds output-aware surface sizing via `OutputTracker`, and wires in image/icon providers. It also adds VMware-focused Sway/shell wrapper scripts, updates Sway config/session env defaults, and refreshes README docs to document the new development flow and Desktop 0.1 behavior.
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "DesktopEntry.hpp"
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QVector>
|
|
#include <QtQml/qqmlregistration.h>
|
|
|
|
class ApplicationModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_UNCREATABLE("Obtained from ApplicationService")
|
|
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
|
|
|
public:
|
|
enum Roles {
|
|
DesktopIdRole = Qt::UserRole + 1,
|
|
NameRole,
|
|
GenericNameRole,
|
|
CommentRole,
|
|
IconNameRole,
|
|
CategoriesRole,
|
|
TerminalRole
|
|
};
|
|
Q_ENUM(Roles)
|
|
|
|
explicit ApplicationModel(QObject *parent = nullptr);
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
int count() const;
|
|
void setEntries(QVector<DesktopEntry> entries);
|
|
const DesktopEntry *entryAt(int row) const;
|
|
const DesktopEntry *entryById(const QString &desktopId) const;
|
|
|
|
signals:
|
|
void countChanged();
|
|
|
|
private:
|
|
QVector<DesktopEntry> m_entries;
|
|
};
|