新增开始菜单扩展界面开发接口
This commit is contained in:
parent
bcada80b0d
commit
add50cca1a
|
@ -61,10 +61,13 @@ message(STATUS "QML_IMPORT_PATH: ${QML_IMPORT_PATH}")
|
||||||
# 基础设置
|
# 基础设置
|
||||||
set(UKUI_MENU_DATA_DIR "/usr/share/ukui-menu")
|
set(UKUI_MENU_DATA_DIR "/usr/share/ukui-menu")
|
||||||
set(UKUI_MENU_TRANSLATION_DIR "${UKUI_MENU_DATA_DIR}/translations")
|
set(UKUI_MENU_TRANSLATION_DIR "${UKUI_MENU_DATA_DIR}/translations")
|
||||||
|
set(UKUI_MENU_EXTENSION_DIR "${UKUI_MENU_DATA_DIR}/extensions")
|
||||||
|
#set(UKUI_MENU_EXTENSION_IFACE_QML_DIR "/usr/lib/x86_64-linux-gnu/qt5/qml/org/ukui/menu/extension")
|
||||||
|
|
||||||
# 宏定义
|
# 宏定义
|
||||||
add_compile_definitions(UKUI_MENU_TRANSLATION_DIR="${UKUI_MENU_TRANSLATION_DIR}"
|
add_compile_definitions(UKUI_MENU_TRANSLATION_DIR="${UKUI_MENU_TRANSLATION_DIR}"
|
||||||
UKUI_MENU_DATA_DIR="${UKUI_MENU_DATA_DIR}"
|
UKUI_MENU_DATA_DIR="${UKUI_MENU_DATA_DIR}"
|
||||||
|
UKUI_MENU_EXTENSION_DIR="${UKUI_MENU_EXTENSION_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# ukui-menu的源码
|
# ukui-menu的源码
|
||||||
|
@ -80,6 +83,8 @@ set(SOURCE_FILES
|
||||||
src/model/model-manager.cpp src/model/model-manager.h
|
src/model/model-manager.cpp src/model/model-manager.h
|
||||||
src/appdata/app-icon-provider.cpp src/appdata/app-icon-provider.h
|
src/appdata/app-icon-provider.cpp src/appdata/app-icon-provider.h
|
||||||
src/windows/menu-main-window.cpp src/windows/menu-main-window.h
|
src/windows/menu-main-window.cpp src/windows/menu-main-window.h
|
||||||
|
src/extension/menu-extension.cpp src/extension/menu-extension.h
|
||||||
|
src/extension/menu-extension-iface.h
|
||||||
)
|
)
|
||||||
|
|
||||||
# qrc文件
|
# qrc文件
|
||||||
|
@ -89,6 +94,8 @@ set(DESKTOP_FILE data/ukui-menu.desktop)
|
||||||
set(GSETTING_FILE data/org.ukui.menu.settings.gschema.xml)
|
set(GSETTING_FILE data/org.ukui.menu.settings.gschema.xml)
|
||||||
# data files
|
# data files
|
||||||
#set(DATA_FILES data/xxx)
|
#set(DATA_FILES data/xxx)
|
||||||
|
# extension
|
||||||
|
#file(GLOB EXTENSION_IFACE_QML_FILES "qml/org/ukui/menu/extension/*")
|
||||||
|
|
||||||
# 翻译文件
|
# 翻译文件
|
||||||
file(GLOB TS_FILES "${PROJECT_SOURCE_DIR}/translations/*.ts")
|
file(GLOB TS_FILES "${PROJECT_SOURCE_DIR}/translations/*.ts")
|
||||||
|
@ -126,3 +133,4 @@ install(FILES ${QM_FILES} DESTINATION "${UKUI_MENU_TRANSLATION_DIR}")
|
||||||
# 安装desktop文件
|
# 安装desktop文件
|
||||||
install(FILES ${DESKTOP_FILE} DESTINATION "/etc/xdg/autostart")
|
install(FILES ${DESKTOP_FILE} DESTINATION "/etc/xdg/autostart")
|
||||||
install(FILES ${GSETTING_FILE} DESTINATION "/usr/share/glib-2.0/schemas")
|
install(FILES ${GSETTING_FILE} DESTINATION "/usr/share/glib-2.0/schemas")
|
||||||
|
#install(FILES ${EXTENSION_IFACE_QML_FILES} DESTINATION "${UKUI_MENU_EXTENSION_IFACE_QML_DIR}")
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import QtQuick 2.12
|
import QtQuick 2.12
|
||||||
import QtQuick.Controls 2.0 as QQC2
|
import QtQuick.Controls 2.0 as QQC2
|
||||||
|
import org.ukui.menu.extension 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Row {
|
Row {
|
||||||
|
@ -11,7 +12,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Sidebar {
|
Sidebar {
|
||||||
width: parent.width - 300;
|
width: parent.width - 400;
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
@ -21,5 +22,10 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UkuiMenuExtension {
|
||||||
|
width: 100;
|
||||||
|
height: parent.height;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: extensionView;
|
||||||
|
property var data;
|
||||||
|
signal send(var data);
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
module org.ukui.menu.extension
|
||||||
|
UkuiMenuExtension 1.0 UkuiMenuExtension.qml
|
|
@ -1,6 +1,8 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/qml">
|
<qresource prefix="/qml">
|
||||||
<file>main.qml</file>
|
<file>main.qml</file>
|
||||||
|
<file>org/ukui/menu/extension/qmldir</file>
|
||||||
|
<file>org/ukui/menu/extension/UkuiMenuExtension.qml</file>
|
||||||
<file>AppUI/qmldir</file>
|
<file>AppUI/qmldir</file>
|
||||||
<file>AppUI/NormalUI.qml</file>
|
<file>AppUI/NormalUI.qml</file>
|
||||||
<file>AppUI/FullScreenUI.qml</file>
|
<file>AppUI/FullScreenUI.qml</file>
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2022, KylinSoft Co., Ltd.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef UKUI_MENU_MENU_EXTENSION_I_FACE_H
|
||||||
|
#define UKUI_MENU_MENU_EXTENSION_I_FACE_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QString>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
|
namespace UkuiMenu {
|
||||||
|
|
||||||
|
class MenuExtensionIFace : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
virtual int index() = 0;
|
||||||
|
virtual QString name() = 0;
|
||||||
|
virtual QString url() = 0;
|
||||||
|
virtual QVariantMap data() = 0;
|
||||||
|
virtual void receive(QVariantMap data) = 0;
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void dataUpdated();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //UKUI_MENU_MENU_EXTENSION_I_FACE_H
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2022, KylinSoft Co., Ltd.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "menu-extension.h"
|
||||||
|
|
||||||
|
namespace UkuiMenu {
|
||||||
|
|
||||||
|
|
||||||
|
} // UkuiMenu
|
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2022, KylinSoft Co., Ltd.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef UKUI_MENU_MENU_EXTENSION_H
|
||||||
|
#define UKUI_MENU_MENU_EXTENSION_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace UkuiMenu {
|
||||||
|
|
||||||
|
class MenuExtension : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} // UkuiMenu
|
||||||
|
|
||||||
|
#endif //UKUI_MENU_MENU_EXTENSION_H
|
Loading…
Reference in New Issue