mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
Rename containments
This commit is contained in:
parent
3bd81a68dd
commit
3ede60a091
40 changed files with 184 additions and 126 deletions
|
|
@ -26,4 +26,4 @@ target_link_libraries(plasma_containment_phone_homescreen
|
||||||
|
|
||||||
install(TARGETS plasma_containment_phone_homescreen DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
install(TARGETS plasma_containment_phone_homescreen DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
||||||
|
|
||||||
plasma_install_package(package org.kde.phone.homescreen)
|
plasma_install_package(package org.kde.plasma.mobile.homescreen.folio)
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
||||||
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.phone.homescreen.pot
|
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.mobile.homescreen.pot
|
||||||
rm -f rc.cpp
|
rm -f rc.cpp
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,7 @@
|
||||||
ApplicationListModel::ApplicationListModel(QObject *parent)
|
ApplicationListModel::ApplicationListModel(QObject *parent)
|
||||||
: QAbstractListModel(parent)
|
: QAbstractListModel(parent)
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
connect(KSycoca::self(), qOverload<const QStringList &>(&KSycoca::databaseChanged), this, &ApplicationListModel::sycocaDbChanged);
|
|
||||||
#else
|
|
||||||
connect(KSycoca::self(), &KSycoca::databaseChanged, this, &ApplicationListModel::sycocaDbChanged);
|
connect(KSycoca::self(), &KSycoca::databaseChanged, this, &ApplicationListModel::sycocaDbChanged);
|
||||||
#endif
|
|
||||||
|
|
||||||
// initialize wayland window checking
|
// initialize wayland window checking
|
||||||
KWayland::Client::ConnectionThread *connection = KWayland::Client::ConnectionThread::fromApplication(this);
|
KWayland::Client::ConnectionThread *connection = KWayland::Client::ConnectionThread::fromApplication(this);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
"Description[uk]": "Домашня сторінка для мобільних пристроїв із акцентом на можливості налаштовування.",
|
"Description[uk]": "Домашня сторінка для мобільних пристроїв із акцентом на можливості налаштовування.",
|
||||||
"Description[x-test]": "xxMobile homescreen with a focus on customizability.xx",
|
"Description[x-test]": "xxMobile homescreen with a focus on customizability.xx",
|
||||||
"Description[zh_CN]": "高可定制性的手机主屏幕方案。",
|
"Description[zh_CN]": "高可定制性的手机主屏幕方案。",
|
||||||
"Id": "org.kde.phone.homescreen",
|
"Id": "org.kde.plasma.mobile.homescreen.folio",
|
||||||
"License": "GPLv2+",
|
"License": "GPLv2+",
|
||||||
"Name": "Folio",
|
"Name": "Folio",
|
||||||
"Name[ca@valencia]": "Folio",
|
"Name[ca@valencia]": "Folio",
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,8 @@
|
||||||
# SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
# SPDX-FileCopyrightText: 2022-2023 Devin Lin <devin@kde.org>
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
set(homescreen_SRCS
|
set(homescreen_SRCS
|
||||||
homescreen.cpp
|
homescreen.cpp
|
||||||
application.cpp
|
|
||||||
applicationfolder.cpp
|
|
||||||
applicationlistmodel.cpp
|
|
||||||
pinnedmodel.cpp
|
|
||||||
windowlistener.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(plasma_containment_phone_homescreen_halcyon MODULE ${homescreen_SRCS})
|
add_library(plasma_containment_phone_homescreen_halcyon MODULE ${homescreen_SRCS})
|
||||||
|
|
@ -27,4 +22,6 @@ target_link_libraries(plasma_containment_phone_homescreen_halcyon
|
||||||
|
|
||||||
install(TARGETS plasma_containment_phone_homescreen_halcyon DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
install(TARGETS plasma_containment_phone_homescreen_halcyon DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
||||||
|
|
||||||
plasma_install_package(package org.kde.phone.homescreen.halcyon)
|
plasma_install_package(package org.kde.plasma.mobile.homescreen.halcyon)
|
||||||
|
|
||||||
|
add_subdirectory(plugin)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,6 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
||||||
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.phone.homescreen.simple.pot
|
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.mobile.homescreen.halcyon.pot
|
||||||
rm -f rc.cpp
|
rm -f rc.cpp
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "homescreen.h"
|
#include "homescreen.h"
|
||||||
#include "application.h"
|
|
||||||
#include "applicationfolder.h"
|
|
||||||
#include "pinnedmodel.h"
|
|
||||||
#include "windowlistener.h"
|
|
||||||
|
|
||||||
#include <KIO/ApplicationLauncherJob>
|
#include <KIO/ApplicationLauncherJob>
|
||||||
#include <KWindowSystem>
|
#include <KWindowSystem>
|
||||||
|
|
@ -18,25 +14,6 @@ HomeScreen::HomeScreen(QObject *parent, const KPluginMetaData &data, const QVari
|
||||||
: Plasma::Containment{parent, data, args}
|
: Plasma::Containment{parent, data, args}
|
||||||
{
|
{
|
||||||
setHasConfigurationInterface(true);
|
setHasConfigurationInterface(true);
|
||||||
|
|
||||||
WindowListener::instance(); // ensure it is created
|
|
||||||
|
|
||||||
ApplicationListModel *applicationListModel = new ApplicationListModel{this};
|
|
||||||
qmlRegisterSingletonType<ApplicationListModel>("org.kde.phone.homescreen.halcyon",
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
"ApplicationListModel",
|
|
||||||
[applicationListModel](QQmlEngine *, QJSEngine *) -> QObject * {
|
|
||||||
return applicationListModel;
|
|
||||||
});
|
|
||||||
|
|
||||||
PinnedModel *pinnedModel = new PinnedModel{this, this};
|
|
||||||
qmlRegisterSingletonType<PinnedModel>("org.kde.phone.homescreen.halcyon", 1, 0, "PinnedModel", [pinnedModel](QQmlEngine *, QJSEngine *) -> QObject * {
|
|
||||||
return pinnedModel;
|
|
||||||
});
|
|
||||||
|
|
||||||
qmlRegisterType<Application>("org.kde.phone.homescreen.halcyon", 1, 0, "Application");
|
|
||||||
qmlRegisterType<ApplicationFolder>("org.kde.phone.homescreen.halcyon", 1, 0, "ApplicationFolder");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HomeScreen::~HomeScreen() = default;
|
HomeScreen::~HomeScreen() = default;
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@
|
||||||
|
|
||||||
#include <Plasma/Containment>
|
#include <Plasma/Containment>
|
||||||
|
|
||||||
#include <applicationlistmodel.h>
|
|
||||||
|
|
||||||
class HomeScreen : public Plasma::Containment
|
class HomeScreen : public Plasma::Containment
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
|
|
||||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
// SPDX-FileCopyrightText: 2022 Devin Lin <espidev@gmail.com>
|
// SPDX-FileCopyrightText: 2022 Devin Lin <espidev@gmail.com>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.3 as Controls
|
import QtQuick.Controls as Controls
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
import org.kde.kquickcontrolsaddons 2.0
|
import org.kde.kquickcontrolsaddons 2.0
|
||||||
|
|
||||||
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager
|
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager
|
||||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||||
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
|
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
|
||||||
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami 2.19 as Kirigami
|
||||||
|
|
||||||
|
|
@ -99,12 +99,12 @@ Item {
|
||||||
sourceComponent: PlasmaComponents.Menu {
|
sourceComponent: PlasmaComponents.Menu {
|
||||||
id: menu
|
id: menu
|
||||||
title: label.text
|
title: label.text
|
||||||
closePolicy: PlasmaComponents.Menu.CloseOnReleaseOutside | PlasmaComponents.Menu.CloseOnEscape
|
closePolicy: PlasmaExtras.Menu.CloseOnReleaseOutside | PlasmaExtras.Menu.CloseOnEscape
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: menuActions
|
model: menuActions
|
||||||
delegate: PlasmaComponents.MenuItem {
|
delegate: PlasmaExtras.MenuItem {
|
||||||
icon.name: modelData.iconName
|
icon: modelData.iconName
|
||||||
text: modelData.text
|
text: modelData.text
|
||||||
onClicked: modelData.triggered()
|
onClicked: modelData.triggered()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Controls as QQC2
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
import QtQml.Models 2.15
|
import QtQml.Models
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras as PlasmaExtras
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
import org.kde.draganddrop 2.0 as DragDrop
|
import org.kde.draganddrop as DragDrop
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
import org.kde.private.mobile.homescreen.halcyon as Halcyon
|
||||||
|
|
||||||
MobileShell.GridView {
|
MobileShell.GridView {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -56,6 +56,11 @@ MobileShell.GridView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Halcyon.PinnedModel {
|
||||||
|
id: pinnedModel
|
||||||
|
applet: plasmoid.nativeInterface
|
||||||
|
}
|
||||||
|
|
||||||
// open wallpaper menu when held on click
|
// open wallpaper menu when held on click
|
||||||
TapHandler {
|
TapHandler {
|
||||||
onLongPressed: root.openConfigureRequested()
|
onLongPressed: root.openConfigureRequested()
|
||||||
|
|
@ -77,7 +82,7 @@ MobileShell.GridView {
|
||||||
|
|
||||||
model: DelegateModel {
|
model: DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
model: Halcyon.PinnedModel
|
model: pinnedModel
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: delegateRoot
|
id: delegateRoot
|
||||||
|
|
@ -89,7 +94,7 @@ MobileShell.GridView {
|
||||||
function moveDragToCurrentPos(from, to) {
|
function moveDragToCurrentPos(from, to) {
|
||||||
if (from !== to) {
|
if (from !== to) {
|
||||||
visualModel.items.move(from, to);
|
visualModel.items.move(from, to);
|
||||||
Halcyon.PinnedModel.moveEntry(from, to);
|
pinnedModel.moveEntry(from, to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -191,9 +196,9 @@ MobileShell.GridView {
|
||||||
onDropped: (drop) => {
|
onDropped: (drop) => {
|
||||||
if (transitionAnim.running || appDelegate.drag.active || drag.source.isFolder) return; // don't do anything when reordering
|
if (transitionAnim.running || appDelegate.drag.active || drag.source.isFolder) return; // don't do anything when reordering
|
||||||
if (appDelegate.isFolder) {
|
if (appDelegate.isFolder) {
|
||||||
Halcyon.PinnedModel.addAppToFolder(drop.source.visualIndex, appDelegate.visualIndex);
|
pinnedModel.addAppToFolder(drop.source.visualIndex, appDelegate.visualIndex);
|
||||||
} else {
|
} else {
|
||||||
Halcyon.PinnedModel.createFolderFromApps(drop.source.visualIndex, appDelegate.visualIndex);
|
pinnedModel.createFolderFromApps(drop.source.visualIndex, appDelegate.visualIndex);
|
||||||
}
|
}
|
||||||
folderAnim.to = 0;
|
folderAnim.to = 0;
|
||||||
folderAnim.restart();
|
folderAnim.restart();
|
||||||
|
|
@ -222,7 +227,7 @@ MobileShell.GridView {
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
iconName: "emblem-favorite"
|
iconName: "emblem-favorite"
|
||||||
text: i18n("Remove from favourites")
|
text: i18n("Remove from favourites")
|
||||||
onTriggered: Halcyon.PinnedModel.removeEntry(model.index)
|
onTriggered: pinnedModel.removeEntry(model.index)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import org.kde.draganddrop 2.0 as DragDrop
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami 2.19 as Kirigami
|
||||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||||
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Controls as QQC2
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
import QtQml.Models 2.15
|
import QtQml.Models
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras as PlasmaExtras
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
import org.kde.draganddrop 2.0 as DragDrop
|
import org.kde.draganddrop as DragDrop
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
import org.kde.private.mobile.homescreen.halcyon as Halcyon
|
||||||
|
|
||||||
MobileShell.GridView {
|
MobileShell.GridView {
|
||||||
id: root
|
id: root
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,20 @@
|
||||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.15 as Controls
|
import QtQuick.Controls as Controls
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
import org.kde.kquickcontrolsaddons 2.0
|
import org.kde.plasma.extras as PlasmaExtras
|
||||||
|
import org.kde.kquickcontrolsaddons
|
||||||
|
|
||||||
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
import org.kde.private.mobile.homescreen.halcyon as Halcyon
|
||||||
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: delegate
|
id: delegate
|
||||||
|
|
@ -59,8 +59,8 @@ MouseArea {
|
||||||
title: label.text
|
title: label.text
|
||||||
closePolicy: PlasmaComponents.Menu.CloseOnReleaseOutside | PlasmaComponents.Menu.CloseOnEscape
|
closePolicy: PlasmaComponents.Menu.CloseOnReleaseOutside | PlasmaComponents.Menu.CloseOnEscape
|
||||||
|
|
||||||
PlasmaComponents.MenuItem {
|
PlasmaExtras.MenuItem {
|
||||||
icon.name: "emblem-favorite"
|
icon: "emblem-favorite"
|
||||||
text: i18n("Add to favourites")
|
text: i18n("Add to favourites")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Halcyon.PinnedModel.addApp(application.storageId, 0);
|
Halcyon.PinnedModel.addApp(application.storageId, 0);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import org.kde.kirigami 2.10 as Kirigami
|
||||||
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
||||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||||
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
|
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
|
||||||
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
import org.kde.private.mobile.homescreen.halcyon 1.0 as Halcyon
|
||||||
|
|
||||||
MobileShell.GridView {
|
MobileShell.GridView {
|
||||||
id: gridView
|
id: gridView
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,19 @@
|
||||||
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2022-2023 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Controls as QQC2
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
import org.kde.plasma.plasmoid
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras as PlasmaExtras
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
import org.kde.draganddrop 2.0 as DragDrop
|
import org.kde.draganddrop as DragDrop
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
||||||
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2022-2023 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
import org.kde.plasma.plasmoid
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
|
|
||||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
||||||
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
import org.kde.private.mobile.homescreen.halcyon as Halcyon
|
||||||
|
|
||||||
MobileShell.HomeScreen {
|
MobileShell.HomeScreen {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -26,7 +26,6 @@ MobileShell.HomeScreen {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
Halcyon.ApplicationListModel.loadApplications();
|
Halcyon.ApplicationListModel.loadApplications();
|
||||||
Halcyon.PinnedModel.load();
|
|
||||||
forceActiveFocus();
|
forceActiveFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
"Description[uk]": "Домашній екран для мобільних пристроїв із акцентом на простоті та зручності.",
|
"Description[uk]": "Домашній екран для мобільних пристроїв із акцентом на простоті та зручності.",
|
||||||
"Description[x-test]": "xxA mobile homescreen focused on simplicity and ease-of-use.xx",
|
"Description[x-test]": "xxA mobile homescreen focused on simplicity and ease-of-use.xx",
|
||||||
"Description[zh_CN]": "简约易用的手机主屏幕方案。",
|
"Description[zh_CN]": "简约易用的手机主屏幕方案。",
|
||||||
"Id": "org.kde.phone.homescreen.halcyon",
|
"Id": "org.kde.plasma.mobile.homescreen.halcyon",
|
||||||
"License": "GPLv2+",
|
"License": "GPLv2+",
|
||||||
"Name": "Halcyon",
|
"Name": "Halcyon",
|
||||||
"Name[az]": "Halcyon",
|
"Name[az]": "Halcyon",
|
||||||
|
|
|
||||||
30
containments/homescreens/halcyon/plugin/CMakeLists.txt
Normal file
30
containments/homescreens/halcyon/plugin/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
# SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
set(halcyonplugin_SRCS
|
||||||
|
halcyonplugin.cpp
|
||||||
|
application.cpp
|
||||||
|
applicationfolder.cpp
|
||||||
|
applicationlistmodel.cpp
|
||||||
|
pinnedmodel.cpp
|
||||||
|
windowlistener.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/private/mobile/homescreen/halcyon)
|
||||||
|
|
||||||
|
add_library(halcyonplugin SHARED ${halcyonplugin_SRCS})
|
||||||
|
|
||||||
|
target_link_libraries(halcyonplugin
|
||||||
|
Qt::Gui
|
||||||
|
Qt::Qml
|
||||||
|
Qt::Quick
|
||||||
|
KF6::Plasma
|
||||||
|
KF6::I18n
|
||||||
|
KF6::Service
|
||||||
|
KF6::KIOGui
|
||||||
|
KF6::Notifications
|
||||||
|
KF6::WaylandClient
|
||||||
|
KF6::WindowSystem)
|
||||||
|
|
||||||
|
set_property(TARGET halcyonplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/mm)
|
||||||
|
install(TARGETS halcyonplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/private/mobile/homescreen/halcyon)
|
||||||
25
containments/homescreens/halcyon/plugin/halcyonplugin.cpp
Normal file
25
containments/homescreens/halcyon/plugin/halcyonplugin.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "halcyonplugin.h"
|
||||||
|
#include "application.h"
|
||||||
|
#include "applicationfolder.h"
|
||||||
|
#include "applicationlistmodel.h"
|
||||||
|
#include "pinnedmodel.h"
|
||||||
|
#include "windowlistener.h"
|
||||||
|
|
||||||
|
void HalcyonPlugin::registerTypes(const char *uri)
|
||||||
|
{
|
||||||
|
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.private.mobile.homescreen.halcyon"));
|
||||||
|
|
||||||
|
WindowListener::instance(); // ensure it is created
|
||||||
|
|
||||||
|
ApplicationListModel *applicationListModel = new ApplicationListModel{this};
|
||||||
|
qmlRegisterSingletonType<ApplicationListModel>(uri, 1, 0, "ApplicationListModel", [applicationListModel](QQmlEngine *, QJSEngine *) -> QObject * {
|
||||||
|
return applicationListModel;
|
||||||
|
});
|
||||||
|
|
||||||
|
qmlRegisterType<PinnedModel>(uri, 1, 0, "PinnedModel");
|
||||||
|
qmlRegisterType<Application>(uri, 1, 0, "Application");
|
||||||
|
qmlRegisterType<ApplicationFolder>(uri, 1, 0, "ApplicationFolder");
|
||||||
|
}
|
||||||
16
containments/homescreens/halcyon/plugin/halcyonplugin.h
Normal file
16
containments/homescreens/halcyon/plugin/halcyonplugin.h
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QQmlEngine>
|
||||||
|
#include <QQmlExtensionPlugin>
|
||||||
|
|
||||||
|
class HalcyonPlugin : public QQmlExtensionPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
|
||||||
|
|
||||||
|
public:
|
||||||
|
void registerTypes(const char *uri) override;
|
||||||
|
};
|
||||||
|
|
@ -8,9 +8,8 @@
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
PinnedModel::PinnedModel(QObject *parent, Plasma::Applet *applet)
|
PinnedModel::PinnedModel(QObject *parent)
|
||||||
: QAbstractListModel{parent}
|
: QAbstractListModel{parent}
|
||||||
, m_applet{applet}
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -241,3 +240,14 @@ void PinnedModel::addAppFromFolder(const QString &storageId)
|
||||||
{
|
{
|
||||||
addApp(storageId, 0);
|
addApp(storageId, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Plasma::Applet *PinnedModel::applet()
|
||||||
|
{
|
||||||
|
return m_applet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PinnedModel::setApplet(Plasma::Applet *applet)
|
||||||
|
{
|
||||||
|
m_applet = applet;
|
||||||
|
load();
|
||||||
|
}
|
||||||
|
|
@ -25,11 +25,12 @@
|
||||||
class PinnedModel : public QAbstractListModel
|
class PinnedModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(Plasma::Applet *applet READ applet WRITE setApplet CONSTANT)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Roles { IsFolderRole = Qt::UserRole + 1, ApplicationRole, FolderRole };
|
enum Roles { IsFolderRole = Qt::UserRole + 1, ApplicationRole, FolderRole };
|
||||||
|
|
||||||
PinnedModel(QObject *parent = nullptr, Plasma::Applet *applet = nullptr);
|
PinnedModel(QObject *parent = nullptr);
|
||||||
~PinnedModel() override;
|
~PinnedModel() override;
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
|
@ -44,13 +45,17 @@ public:
|
||||||
Q_INVOKABLE void createFolderFromApps(int sourceAppRow, int draggedAppRow);
|
Q_INVOKABLE void createFolderFromApps(int sourceAppRow, int draggedAppRow);
|
||||||
Q_INVOKABLE void addAppToFolder(int appRow, int folderRow);
|
Q_INVOKABLE void addAppToFolder(int appRow, int folderRow);
|
||||||
|
|
||||||
Q_INVOKABLE void load();
|
|
||||||
void save();
|
void save();
|
||||||
|
|
||||||
|
Plasma::Applet *applet();
|
||||||
|
void setApplet(Plasma::Applet *applet);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void addAppFromFolder(const QString &storageId);
|
void addAppFromFolder(const QString &storageId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void load();
|
||||||
|
|
||||||
QList<Application *> m_applications;
|
QList<Application *> m_applications;
|
||||||
QList<ApplicationFolder *> m_folders;
|
QList<ApplicationFolder *> m_folders;
|
||||||
|
|
||||||
2
containments/homescreens/halcyon/plugin/qmldir
Normal file
2
containments/homescreens/halcyon/plugin/qmldir
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
module org.kde.private.mobile.homescreen.halcyon
|
||||||
|
plugin halcyonplugin
|
||||||
|
|
@ -20,5 +20,5 @@ target_link_libraries(plasma_applet_phonepanel
|
||||||
install(TARGETS plasma_applet_phonepanel DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
install(TARGETS plasma_applet_phonepanel DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
||||||
#install(FILES plasma-phonepanel-default.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
|
#install(FILES plasma-phonepanel-default.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
|
||||||
|
|
||||||
plasma_install_package(package org.kde.phone.panel)
|
plasma_install_package(package org.kde.plasma.mobile.panel)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,5 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
||||||
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.phone.panel.pot
|
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.mobile.panel.pot
|
||||||
rm -f rc.cpp
|
rm -f rc.cpp
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
"Description[uk]": "Верхня панель для мобільної Плазми",
|
"Description[uk]": "Верхня панель для мобільної Плазми",
|
||||||
"Description[x-test]": "xxTop panel for Plasma Mobilexx",
|
"Description[x-test]": "xxTop panel for Plasma Mobilexx",
|
||||||
"Description[zh_CN]": "Plasma Mobile 的顶部面板",
|
"Description[zh_CN]": "Plasma Mobile 的顶部面板",
|
||||||
"Id": "org.kde.phone.panel",
|
"Id": "org.kde.plasma.mobile.panel",
|
||||||
"License": "GPLv2+",
|
"License": "GPLv2+",
|
||||||
"Name": "Phone Panel",
|
"Name": "Phone Panel",
|
||||||
"Name[az]": "Telefon paneli",
|
"Name[az]": "Telefon paneli",
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,5 @@ target_link_libraries(plasma_containment_phone_taskpanel
|
||||||
|
|
||||||
install(TARGETS plasma_containment_phone_taskpanel DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
install(TARGETS plasma_containment_phone_taskpanel DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
||||||
|
|
||||||
plasma_install_package(package org.kde.phone.taskpanel)
|
plasma_install_package(package org.kde.plasma.mobile.taskpanel)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
||||||
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.phone.taskpanel.pot
|
$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.mobile.taskpanel.pot
|
||||||
rm -f rc.cpp
|
rm -f rc.cpp
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
"Description[uk]": "Панель навігації для мобільної Плазми",
|
"Description[uk]": "Панель навігації для мобільної Плазми",
|
||||||
"Description[x-test]": "xxNavigation panel for Plasma Mobilexx",
|
"Description[x-test]": "xxNavigation panel for Plasma Mobilexx",
|
||||||
"Description[zh_CN]": "Plasma 移动版导航面板",
|
"Description[zh_CN]": "Plasma 移动版导航面板",
|
||||||
"Id": "org.kde.phone.taskpanel",
|
"Id": "org.kde.plasma.mobile.taskpanel",
|
||||||
"License": "GPLv2+",
|
"License": "GPLv2+",
|
||||||
"Name": "Phone Task panel",
|
"Name": "Phone Task panel",
|
||||||
"Name[az]": "Telefon tapşırıq paneli",
|
"Name[az]": "Telefon tapşırıq paneli",
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ TaskPanel::TaskPanel(QObject *parent, const KPluginMetaData &data, const QVarian
|
||||||
setHasConfigurationInterface(true);
|
setHasConfigurationInterface(true);
|
||||||
initWayland();
|
initWayland();
|
||||||
|
|
||||||
qmlRegisterUncreatableType<KWayland::Client::Output>("org.kde.plasma.phone.taskpanel", 1, 0, "Output", "nope");
|
qmlRegisterUncreatableType<KWayland::Client::Output>("org.kde.plasma.mobile.taskpanel", 1, 0, "Output", "nope");
|
||||||
|
|
||||||
// register type for Keyboards.KWinVirtualKeyboard.forceActivate();
|
// register type for Keyboards.KWinVirtualKeyboard.forceActivate();
|
||||||
qRegisterMetaType<QDBusPendingReply<>>();
|
qRegisterMetaType<QDBusPendingReply<>>();
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
LookAndFeelPackage=org.kde.breeze.mobile
|
LookAndFeelPackage=org.kde.breeze.mobile
|
||||||
|
|
||||||
[Desktop]
|
[Desktop]
|
||||||
Containment=org.kde.phone.homescreen.halcyon
|
Containment=org.kde.plasma.mobile.homescreen.halcyon
|
||||||
ToolBox=org.kde.plasma.nano.desktoptoolbox
|
ToolBox=org.kde.plasma.nano.desktoptoolbox
|
||||||
|
|
||||||
[Desktop][ContainmentActions]
|
[Desktop][ContainmentActions]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue