mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 06:33:09 +00:00
port to kicker model
still not completely functional, but starts to
This commit is contained in:
parent
93400faa21
commit
4e4cc5abc2
4 changed files with 95 additions and 212 deletions
|
|
@ -39,13 +39,9 @@
|
||||||
|
|
||||||
|
|
||||||
ApplicationListModel::ApplicationListModel(HomeScreen *parent)
|
ApplicationListModel::ApplicationListModel(HomeScreen *parent)
|
||||||
: QAbstractListModel(parent),
|
: QSortFilterProxyModel(parent),
|
||||||
m_homeScreen(parent)
|
m_homeScreen(parent)
|
||||||
{
|
{
|
||||||
//can't use the new syntax as this signal is overloaded
|
|
||||||
connect(KSycoca::self(), SIGNAL(databaseChanged(const QStringList &)),
|
|
||||||
this, SLOT(sycocaDbChanged(const QStringList &)));
|
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,128 +60,23 @@ void ApplicationListModel::loadSettings()
|
||||||
m_appPositions[app] = i;
|
m_appPositions[app] = i;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadApplications();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<int, QByteArray> ApplicationListModel::roleNames() const
|
QHash<int, QByteArray> ApplicationListModel::roleNames() const
|
||||||
{
|
{
|
||||||
QHash<int, QByteArray> roleNames;
|
QHash<int, QByteArray> roleNames;
|
||||||
roleNames[ApplicationNameRole] = "ApplicationNameRole";
|
if (sourceModel()) {
|
||||||
roleNames[ApplicationIconRole] = "ApplicationIconRole";
|
roleNames = sourceModel()->roleNames();
|
||||||
roleNames[ApplicationStorageIdRole] = "ApplicationStorageIdRole";
|
}
|
||||||
roleNames[ApplicationEntryPathRole] = "ApplicationEntryPathRole";
|
|
||||||
roleNames[ApplicationOriginalRowRole] = "ApplicationOriginalRowRole";
|
roleNames[SortKeyRole] = "SortKeyRole";
|
||||||
roleNames[ApplicationStartupNotifyRole] = "ApplicationStartupNotifyRole";
|
|
||||||
roleNames[ApplicationLocationRole] = "ApplicationLocationRole";
|
roleNames[ApplicationLocationRole] = "ApplicationLocationRole";
|
||||||
|
|
||||||
|
const_cast<ApplicationListModel *>(this)->m_urlRole = roleNames.key("url");
|
||||||
|
|
||||||
return roleNames;
|
return roleNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationListModel::sycocaDbChanged(const QStringList &changes)
|
|
||||||
{
|
|
||||||
if (!changes.contains("apps") && !changes.contains("xdgdata-apps")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_applicationList.clear();
|
|
||||||
|
|
||||||
loadApplications();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool appNameLessThan(const ApplicationData &a1, const ApplicationData &a2)
|
|
||||||
{
|
|
||||||
return a1.name.toLower() < a2.name.toLower();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApplicationListModel::loadApplications()
|
|
||||||
{
|
|
||||||
auto cfg = KSharedConfig::openConfig("applications-blacklistrc");
|
|
||||||
auto blgroup = KConfigGroup(cfg, QStringLiteral("Applications"));
|
|
||||||
|
|
||||||
// This is only temporary to get a clue what those apps' desktop files are called
|
|
||||||
// I'll remove it once I've done a blacklist
|
|
||||||
QStringList bl;
|
|
||||||
|
|
||||||
QStringList blacklist = blgroup.readEntry("blacklist", QStringList());
|
|
||||||
|
|
||||||
|
|
||||||
beginResetModel();
|
|
||||||
|
|
||||||
m_applicationList.clear();
|
|
||||||
|
|
||||||
KServiceGroup::Ptr group = KServiceGroup::root();
|
|
||||||
if (!group || !group->isValid()) return;
|
|
||||||
KServiceGroup::List subGroupList = group->entries(true);
|
|
||||||
|
|
||||||
QMap<int, ApplicationData> orderedList;
|
|
||||||
QList<ApplicationData> unorderedList;
|
|
||||||
|
|
||||||
// Iterate over all entries in the group
|
|
||||||
while (!subGroupList.isEmpty()) {
|
|
||||||
KSycocaEntry::Ptr groupEntry = subGroupList.first();
|
|
||||||
subGroupList.pop_front();
|
|
||||||
|
|
||||||
if (groupEntry->isType(KST_KServiceGroup)) {
|
|
||||||
KServiceGroup::Ptr serviceGroup(static_cast<KServiceGroup* >(groupEntry.data()));
|
|
||||||
|
|
||||||
if (!serviceGroup->noDisplay()) {
|
|
||||||
KServiceGroup::List entryGroupList = serviceGroup->entries(true);
|
|
||||||
|
|
||||||
for(KServiceGroup::List::ConstIterator it = entryGroupList.constBegin(); it != entryGroupList.constEnd(); it++) {
|
|
||||||
KSycocaEntry::Ptr entry = (*it);
|
|
||||||
|
|
||||||
if (entry->isType(KST_KServiceGroup)) {
|
|
||||||
KServiceGroup::Ptr serviceGroup(static_cast<KServiceGroup* >(entry.data()));
|
|
||||||
subGroupList << serviceGroup;
|
|
||||||
|
|
||||||
} else if (entry->property("Exec").isValid()) {
|
|
||||||
KService::Ptr service(static_cast<KService* >(entry.data()));
|
|
||||||
|
|
||||||
if (service->isApplication() &&
|
|
||||||
!blacklist.contains(service->desktopEntryName()) &&
|
|
||||||
service->showOnCurrentPlatform() &&
|
|
||||||
!service->property("Terminal", QVariant::Bool).toBool()) {
|
|
||||||
|
|
||||||
bl << service->desktopEntryName();
|
|
||||||
|
|
||||||
ApplicationData data;
|
|
||||||
data.name = service->name();
|
|
||||||
data.icon = service->icon();
|
|
||||||
data.storageId = service->storageId();
|
|
||||||
data.entryPath = service->exec();
|
|
||||||
data.startupNotify = service->property("StartupNotify").toBool();
|
|
||||||
|
|
||||||
if (m_favorites.contains(data.storageId)) {
|
|
||||||
data.location = Favorites;
|
|
||||||
} else if (m_desktopItems.contains(data.storageId)) {
|
|
||||||
data.location = Desktop;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto it = m_appPositions.constFind(service->storageId());
|
|
||||||
if (it != m_appPositions.constEnd()) {
|
|
||||||
orderedList[*it] = data;
|
|
||||||
} else {
|
|
||||||
unorderedList << data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
blgroup.writeEntry("allapps", bl);
|
|
||||||
blgroup.writeEntry("blacklist", blacklist);
|
|
||||||
cfg->sync();
|
|
||||||
|
|
||||||
std::sort(unorderedList.begin(), unorderedList.end(), appNameLessThan);
|
|
||||||
m_applicationList << orderedList.values();
|
|
||||||
m_applicationList << unorderedList;
|
|
||||||
|
|
||||||
endResetModel();
|
|
||||||
emit countChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant ApplicationListModel::data(const QModelIndex &index, int role) const
|
QVariant ApplicationListModel::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
|
|
@ -194,127 +85,117 @@ QVariant ApplicationListModel::data(const QModelIndex &index, int role) const
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case SortKeyRole: {
|
||||||
case ApplicationNameRole:
|
const QString url = QSortFilterProxyModel::data(index, m_urlRole).toString();
|
||||||
return m_applicationList.at(index.row()).name;
|
if (m_appOrder.contains(url)) {
|
||||||
case ApplicationIconRole:
|
return QString::number(m_appOrder.indexOf(url)) + QStringLiteral("_") + QSortFilterProxyModel::data(index, Qt::DisplayRole).toString();
|
||||||
return m_applicationList.at(index.row()).icon;
|
} else {
|
||||||
case ApplicationStorageIdRole:
|
return QStringLiteral("z_") + QSortFilterProxyModel::data(index, Qt::DisplayRole).toString();
|
||||||
return m_applicationList.at(index.row()).storageId;
|
}
|
||||||
case ApplicationEntryPathRole:
|
}
|
||||||
return m_applicationList.at(index.row()).entryPath;
|
|
||||||
case ApplicationOriginalRowRole:
|
case ApplicationLocationRole: {
|
||||||
return index.row();
|
const QString url = QSortFilterProxyModel::data(index, m_urlRole).toString();
|
||||||
case ApplicationStartupNotifyRole:
|
if (m_favorites.contains(url)) {
|
||||||
return m_applicationList.at(index.row()).startupNotify;
|
return Favorites;
|
||||||
case ApplicationLocationRole:
|
} else if (m_desktopItems.contains(url)) {
|
||||||
return m_applicationList.at(index.row()).location;
|
return Desktop;
|
||||||
|
} else {
|
||||||
|
return Grid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QSortFilterProxyModel::data(index, role);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: remove?
|
||||||
Qt::ItemFlags ApplicationListModel::flags(const QModelIndex &index) const
|
Qt::ItemFlags ApplicationListModel::flags(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return Qt::ItemIsDragEnabled|QAbstractItemModel::flags(index);
|
return Qt::ItemIsDragEnabled|QSortFilterProxyModel::flags(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ApplicationListModel::rowCount(const QModelIndex &parent) const
|
|
||||||
{
|
|
||||||
if (parent.isValid()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_applicationList.count();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApplicationListModel::moveRow(const QModelIndex& /* sourceParent */, int sourceRow, const QModelIndex& /* destinationParent */, int destinationChild)
|
|
||||||
{
|
|
||||||
moveItem(sourceRow, destinationChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApplicationListModel::setLocation(int row, LauncherLocation location)
|
void ApplicationListModel::setLocation(int row, LauncherLocation location)
|
||||||
{
|
{
|
||||||
if (row < 0 || row >= m_applicationList.length()) {
|
if (row < 0 || row >= rowCount()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationData &data = m_applicationList[row];
|
const QString url = data(index(row, 0), m_urlRole).toString();
|
||||||
if (data.location == location) {
|
|
||||||
|
if (url.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location == Favorites) {qWarning()<<"favoriting"<<row<<data.name;
|
if (location == Favorites && !m_favorites.contains(url)) {
|
||||||
|
qWarning()<<"favoriting"<<row;
|
||||||
// Deny favorites when full
|
// Deny favorites when full
|
||||||
if (row >= m_maxFavoriteCount || m_favorites.count() >= m_maxFavoriteCount) {
|
if (row >= m_maxFavoriteCount || m_favorites.count() >= m_maxFavoriteCount) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_favorites.insert(row, data.storageId);
|
m_favorites.insert(row, url);
|
||||||
|
|
||||||
m_homeScreen->config().writeEntry("Favorites", m_favorites);
|
m_homeScreen->config().writeEntry("Favorites", m_favorites);
|
||||||
emit favoriteCountChanged();
|
emit favoriteCountChanged();
|
||||||
|
|
||||||
// Out of favorites
|
// Out of favorites
|
||||||
} else if (data.location == Favorites) {
|
} else if (m_favorites.contains(url)) {
|
||||||
m_favorites.removeAll(data.storageId);
|
m_favorites.removeAll(url);
|
||||||
m_homeScreen->config().writeEntry("Favorites", m_favorites);
|
m_homeScreen->config().writeEntry("Favorites", m_favorites);
|
||||||
emit favoriteCountChanged();
|
emit favoriteCountChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
// In Desktop
|
// In Desktop
|
||||||
if (location == Desktop) {
|
if (location == Desktop && m_desktopItems.contains(url)) {
|
||||||
m_desktopItems.insert(data.storageId);
|
m_desktopItems.insert(url);
|
||||||
m_homeScreen->config().writeEntry("DesktopItems", m_desktopItems.toList());
|
m_homeScreen->config().writeEntry("DesktopItems", m_desktopItems.toList());
|
||||||
|
|
||||||
// Out of Desktop
|
// Out of Desktop
|
||||||
} else if (data.location == Desktop) {
|
} else if (m_desktopItems.contains(url)) {
|
||||||
m_desktopItems.remove(data.storageId);
|
m_desktopItems.remove(url);
|
||||||
m_homeScreen->config().writeEntry("DesktopItems", m_desktopItems.toList());
|
m_homeScreen->config().writeEntry("DesktopItems", m_desktopItems.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
data.location = location;
|
|
||||||
emit m_homeScreen->configNeedsSaving();
|
emit m_homeScreen->configNeedsSaving();
|
||||||
emit dataChanged(index(row, 0), index(row, 0));
|
emit dataChanged(index(row, 0), index(row, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationListModel::moveItem(int row, int destination)
|
void ApplicationListModel::moveItem(int row, int destination)
|
||||||
{
|
{
|
||||||
if (row < 0 || destination < 0 || row >= m_applicationList.length() ||
|
if (row < 0 || destination < 0 || row >= rowCount() ||
|
||||||
destination >= m_applicationList.length() || row == destination) {
|
destination >= rowCount() || row == destination) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (destination > row) {
|
if (destination > row) {
|
||||||
++destination;
|
++destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
beginMoveRows(QModelIndex(), row, row, QModelIndex(), destination);
|
const QString url = data(index(row, 0), m_urlRole).toString();
|
||||||
if (destination > row) {
|
|
||||||
ApplicationData data = m_applicationList.at(row);
|
|
||||||
m_applicationList.insert(destination, data);
|
|
||||||
m_applicationList.takeAt(row);
|
|
||||||
|
|
||||||
} else {
|
if (url.isEmpty()) {
|
||||||
ApplicationData data = m_applicationList.takeAt(row);
|
return;
|
||||||
m_applicationList.insert(destination, data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_appOrder.length() < qMax(row, destination)) {
|
||||||
|
for (int i = m_appOrder.length(); i <= qMax(row, destination); ++i) {
|
||||||
|
m_appOrder << data(index(i, 0), m_urlRole).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (destination > row) {
|
||||||
|
m_appOrder.insert(destination, url);
|
||||||
|
m_appOrder.takeAt(row);
|
||||||
|
|
||||||
m_appOrder.clear();
|
} else {
|
||||||
m_appPositions.clear();
|
m_appOrder.takeAt(row);
|
||||||
int i = 0;
|
m_appOrder.insert(destination, url);
|
||||||
for (auto app : m_applicationList) {
|
|
||||||
m_appOrder << app.storageId;
|
|
||||||
m_appPositions[app.storageId] = i;
|
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_homeScreen->config().writeEntry("AppOrder", m_appOrder);
|
m_homeScreen->config().writeEntry("AppOrder", m_appOrder);
|
||||||
|
|
||||||
endMoveRows();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationListModel::runApplication(const QString &storageId)
|
void ApplicationListModel::runApplication(const QString &storageId)
|
||||||
|
|
@ -344,7 +225,7 @@ void ApplicationListModel::setMaxFavoriteCount(int count)
|
||||||
m_favorites.pop_back();
|
m_favorites.pop_back();
|
||||||
}
|
}
|
||||||
emit favoriteCountChanged();
|
emit favoriteCountChanged();
|
||||||
|
/*TODO
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (auto &app : m_applicationList) {
|
for (auto &app : m_applicationList) {
|
||||||
if (i >= count && app.location == Favorites) {
|
if (i >= count && app.location == Favorites) {
|
||||||
|
|
@ -352,7 +233,7 @@ void ApplicationListModel::setMaxFavoriteCount(int count)
|
||||||
emit dataChanged(index(i, 0), index(i, 0));
|
emit dataChanged(index(i, 0), index(i, 0));
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
m_maxFavoriteCount = count;
|
m_maxFavoriteCount = count;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
// Qt
|
// Qt
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QAbstractListModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
#include "homescreen.h"
|
#include "homescreen.h"
|
||||||
|
|
@ -31,16 +31,7 @@ class QString;
|
||||||
|
|
||||||
class ApplicationListModel;
|
class ApplicationListModel;
|
||||||
|
|
||||||
struct ApplicationData {
|
class ApplicationListModel : public QSortFilterProxyModel {
|
||||||
QString name;
|
|
||||||
QString icon;
|
|
||||||
QString storageId;
|
|
||||||
QString entryPath;
|
|
||||||
int location = 0; //FIXME
|
|
||||||
bool startupNotify = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ApplicationListModel : public QAbstractListModel {
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
||||||
|
|
@ -56,12 +47,7 @@ public:
|
||||||
Q_ENUM(LauncherLocation)
|
Q_ENUM(LauncherLocation)
|
||||||
|
|
||||||
enum Roles {
|
enum Roles {
|
||||||
ApplicationNameRole = Qt::UserRole + 1,
|
SortKeyRole = Qt::UserRole + 100,
|
||||||
ApplicationIconRole,
|
|
||||||
ApplicationStorageIdRole,
|
|
||||||
ApplicationEntryPathRole,
|
|
||||||
ApplicationOriginalRowRole,
|
|
||||||
ApplicationStartupNotifyRole,
|
|
||||||
ApplicationLocationRole
|
ApplicationLocationRole
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -70,11 +56,7 @@ public:
|
||||||
|
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
int count() const { return rowCount(); }
|
||||||
|
|
||||||
void moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild);
|
|
||||||
|
|
||||||
int count() const { return m_applicationList.count(); }
|
|
||||||
int favoriteCount() const { return m_favorites.count();}
|
int favoriteCount() const { return m_favorites.count();}
|
||||||
|
|
||||||
int maxFavoriteCount() const;
|
int maxFavoriteCount() const;
|
||||||
|
|
@ -92,10 +74,7 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE void runApplication(const QString &storageId);
|
Q_INVOKABLE void runApplication(const QString &storageId);
|
||||||
|
|
||||||
Q_INVOKABLE void loadApplications();
|
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void sycocaDbChanged(const QStringList &change);
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void countChanged();
|
void countChanged();
|
||||||
|
|
@ -103,10 +82,9 @@ Q_SIGNALS:
|
||||||
void maxFavoriteCountChanged();
|
void maxFavoriteCountChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ApplicationData> m_applicationList;
|
|
||||||
|
|
||||||
HomeScreen *m_homeScreen = nullptr;
|
HomeScreen *m_homeScreen = nullptr;
|
||||||
int m_maxFavoriteCount = 0;
|
int m_maxFavoriteCount = 0;
|
||||||
|
int m_urlRole = 0;
|
||||||
QStringList m_appOrder;
|
QStringList m_appOrder;
|
||||||
QStringList m_favorites;
|
QStringList m_favorites;
|
||||||
QSet<QString> m_desktopItems;
|
QSet<QString> m_desktopItems;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ ContainmentLayoutManager.ItemContainer {
|
||||||
|
|
||||||
opacity: dragActive ? 0.4 : 1
|
opacity: dragActive ? 0.4 : 1
|
||||||
|
|
||||||
key: model.ApplicationStorageIdRole
|
key: model.url
|
||||||
property real dragCenterX
|
property real dragCenterX
|
||||||
property real dragCenterY
|
property real dragCenterY
|
||||||
|
|
||||||
|
|
@ -93,8 +93,8 @@ ContainmentLayoutManager.ItemContainer {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
clickFedbackAnimation.target = delegate;
|
clickFedbackAnimation.target = delegate;
|
||||||
clickFedbackAnimation.running = true;
|
clickFedbackAnimation.running = true;
|
||||||
feedbackWindow.title = modelData.ApplicationNameRole;
|
feedbackWindow.title = model.display;
|
||||||
feedbackWindow.icon = modelData.ApplicationIconRole;
|
feedbackWindow.icon = model.decoration;
|
||||||
feedbackWindow.state = "open";
|
feedbackWindow.state = "open";
|
||||||
|
|
||||||
plasmoid.nativeInterface.applicationListModel.runApplication(modelData.ApplicationStorageIdRole);
|
plasmoid.nativeInterface.applicationListModel.runApplication(modelData.ApplicationStorageIdRole);
|
||||||
|
|
@ -112,7 +112,7 @@ ContainmentLayoutManager.ItemContainer {
|
||||||
Layout.minimumHeight: parent.height - root.reservedSpaceForLabel
|
Layout.minimumHeight: parent.height - root.reservedSpaceForLabel
|
||||||
Layout.preferredHeight: Layout.minimumHeight
|
Layout.preferredHeight: Layout.minimumHeight
|
||||||
|
|
||||||
source: modelData ? modelData.ApplicationIconRole : ""
|
source: model.decoration
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: units.longDuration
|
duration: units.longDuration
|
||||||
|
|
@ -133,7 +133,7 @@ ContainmentLayoutManager.ItemContainer {
|
||||||
maximumLineCount: 2
|
maximumLineCount: 2
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
|
||||||
text: model.ApplicationNameRole
|
text: model.display
|
||||||
font.pixelSize: theme.defaultFont.pixelSize
|
font.pixelSize: theme.defaultFont.pixelSize
|
||||||
color: model.ApplicationLocationRole == ApplicationListModel.Desktop ? "white" : theme.textColor
|
color: model.ApplicationLocationRole == ApplicationListModel.Desktop ? "white" : theme.textColor
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@ import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutM
|
||||||
|
|
||||||
import org.kde.phone.homescreen 1.0
|
import org.kde.phone.homescreen 1.0
|
||||||
|
|
||||||
|
import org.kde.plasma.private.kicker 0.1 as Kicker
|
||||||
|
|
||||||
LauncherContainer {
|
LauncherContainer {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
|
@ -39,6 +41,28 @@ LauncherContainer {
|
||||||
|
|
||||||
frame.width: width
|
frame.width: width
|
||||||
|
|
||||||
|
Kicker.RootModel {
|
||||||
|
id: kickerRootModel
|
||||||
|
appNameFormat: 0
|
||||||
|
|
||||||
|
autoPopulate: false
|
||||||
|
flat: true
|
||||||
|
sorted: true
|
||||||
|
showSeparators: false
|
||||||
|
appletInterface: plasmoid
|
||||||
|
paginate: false
|
||||||
|
showAllApps: true
|
||||||
|
showTopLevelItems: false
|
||||||
|
showRecentApps: false
|
||||||
|
showRecentDocs: false
|
||||||
|
showRecentContacts: false
|
||||||
|
recentOrdering: 0
|
||||||
|
Component.onCompleted: {
|
||||||
|
kickerRootModel.refresh();
|
||||||
|
plasmoid.nativeInterface.applicationListModel.sourceModel = kickerRootModel.modelForRow(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: plasmoid.nativeInterface.applicationListModel
|
model: plasmoid.nativeInterface.applicationListModel
|
||||||
delegate: Delegate {
|
delegate: Delegate {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue